Copying from source member from IFS - IBM AS400

This is a discussion on Copying from source member from IFS - IBM AS400 ; I downloaded a project from SourceForge.net, but the source files are in ASCII format and have the 12 positions containing the sequence and date information from the source member. I have been trying to figure out an easy way to ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Copying from source member from IFS

  1. Copying from source member from IFS

    I downloaded a project from SourceForge.net, but the source files are
    in ASCII format and have the 12 positions containing the sequence and
    date information from the source member. I have been trying to figure
    out an easy way to get these files imported into a source member
    without having to go through them and remove the sequence and date
    information. Anyone have an idea of how to fix this?


  2. Re: Copying from source member from IFS

    If you have WDSC or the Code Editor, they will "see" these files
    correctly if you use a file name extension they recognize .clp,
    ..rpgle, .dds and so on. Then you can do a save as to the iSeries.

    Otherwise, create yourself a wide text file, say crtsrcpf qtxt132
    RCDLEN(144)

    Put the source in that and then open with SEU and enter the SEU
    command LLT12 on the first and last line. LL= multi line move left, T
    = Truncate and 12 characters. Make sure you have a blank after the 12

    Dennyh

    On Tue, 24 Jul 2007 14:09:50 -0700, Matt
    wrote:

    >I downloaded a project from SourceForge.net, but the source files are
    >in ASCII format and have the 12 positions containing the sequence and
    >date information from the source member. I have been trying to figure
    >out an easy way to get these files imported into a source member
    >without having to go through them and remove the sequence and date
    >information. Anyone have an idea of how to fix this?


  3. Re: Copying from source member from IFS

    Thanks for the suggestion. The one issue here is there are about 54
    members that need to be imported, so I was looking for a solution that
    could be coded simply in CL and would take care of the whole process.
    In other words, I was hoping someone would tell me about a command or
    parameter I was unaware of. If there is no easy way to do this, it
    might be worth my time to write an RPG program to handle the importing
    and exporting source members to the IFS. That would be a very handy
    tool. Has anyone else wrote something similar that wouldn't mind
    sharing?


  4. Re: Copying from source member from IFS

    On Wed, 25 Jul 2007 13:05:03 -0000, Matt wrote:
    > Thanks for the suggestion. The one issue here is there are about 54
    > members that need to be imported, so I was looking for a solution that
    > could be coded simply in CL and would take care of the whole process.
    > In other words, I was hoping someone would tell me about a command or
    > parameter I was unaware of. If there is no easy way to do this, it
    > might be worth my time to write an RPG program to handle the importing
    > and exporting source members to the IFS. That would be a very handy
    > tool. Has anyone else wrote something similar that wouldn't mind
    > sharing?


    There might be even easier ways, depending... which project was it?

    One of the things I'm considering is that it kind of sounds like it
    might be a File System export of a WebShpere Dev Client project, in
    which case, the easy way would be to import the project, fuss with the
    properties to point it to your iSeries, and push.

    --
    6. I will not gloat over my enemies' predicament before killing them.
    --Peter Anspach's list of things to do as an Evil Overlord

  5. Re: Copying from source member from IFS


    "Matt" skrev i en meddelelse
    news:1185311390.966653.230250@q75g2000hsh.googlegr oups.com...
    >I downloaded a project from SourceForge.net, but the source files are
    > in ASCII format and have the 12 positions containing the sequence and
    > date information from the source member. I have been trying to figure
    > out an easy way to get these files imported into a source member
    > without having to go through them and remove the sequence and date
    > information. Anyone have an idea of how to fix this?
    >


    The only way that I know of is to copy the stream file to a temporary PF (a
    regular PF, not a source PF) with a record length of at least 92 bytes (or
    112 bytes for a RPGLE source). This can be done with a CPYFRMSTMF command.
    Then create an RPG program with two program-described files (one input and
    one output) that will copy the records from the input file to the output
    file. Of course you will have to first add a correct member to the output
    file and provide overrides for the member names. But the whole process can
    definitely be automated in a CLP once the RPG copy program is created.

    Hope this helps...





  6. Re: Copying from source member from IFS

    On Jul 25, 2:05 pm, Matt wrote:
    > Thanks for the suggestion. The one issue here is there are about 54
    > members that need to be imported, so I was looking for a solution that
    > could be coded simply in CL and would take care of the whole process.
    > In other words, I was hoping someone would tell me about a command or
    > parameter I was unaware of. If there is no easy way to do this, it
    > might be worth my time to write an RPG program to handle the importing
    > and exporting source members to the IFS. That would be a very handy
    > tool. Has anyone else wrote something similar that wouldn't mind
    > sharing?


    You could zip them into 1 file then xfer to tha as400 & unzip using
    qsh & the jar command. Then move them into a sourcfile which will
    leave the 12 numerics at the frontend.
    I think jar tvf myzip.zip will list the contents & jar xvf myzip.zip
    will extract them. Dont use /qdls as java dosnt seem to like it much.
    You can use cp from the shell eg
    cp file1 /qsys.lib/mylib.lib/source.file/file1.mbr but this wil not
    add a type to the member or give it a description.

    Try this:
    for name in *.*;do cp $name /qsys.lib/mylib.lib/source.file/
    $name.mbr;done
    You may want to adjust the *.* & maybe use sed to 1st strip the
    leading 12 chars like this. First make the target directory ../
    anotherdir
    for name in *.*;do cat $name | cut -c 13- > ../anotherdir/$name;done

    HTH
    Jonathan


  7. Re: Copying from source member from IFS

    On Jul 24, 2:09 pm, Matt wrote:
    > I downloaded a project from SourceForge.net, but the source files are
    > in ASCII format and have the 12 positions containing the sequence and
    > date information from the source member. I have been trying to figure
    > out an easy way to get these files imported into a source member
    > without having to go through them and remove the sequence and date
    > information. Anyone have an idea of how to fix this?


    I might have downloaded something different, but I downloaded a save
    file from there, ISTKTV5R1, and the contents are normal iSeries
    objects. In particular, the source files restore as normal iSeries
    source files.

    In the event you have something different and the contents really are
    ASCII text, including the source statement and date, you could copy
    the contents to a non-source PF, then create a SQL view over the
    actual source statement portion:

    create view mylib.sourceview as
    select substr(sourceline, 13,80) srcdta
    from mylib.sourcepf

    Now you could copy this view to the source PF member using CPYF and
    *MAP/*DROP.


+ Reply to Thread