Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Download RPG Sources To PC Text Files 4

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
0
0
US
I'm moving to a nnew job soon and the old AS400 system I have worked on for many years is being switched off.
I want to download all the RPG sources so that I have a quick reference for technical issues at my next job.
I tend to remember where I have solved a problem in the past but not exactly how I did it so I often go back to an old program to remind me how to achieve something. This is why it would be handy to download all source members from a QRPGSRC file on a PC with one text file per member.

Can't quite come up with a good way of doing it. Client Access only allows you to do it one member at a time. Is there a way of downloading from the AS400 via Client access from a AS400 seesion where you specify the source name and destination name of a file?

 
Hi,
this maybe little messy but you can use for example:
CPYSRCF.
Data base source file . . . . . > SQLRPGLE
Library . . . . . . . . . . . > WITEKR3
To file . . . . . . . . . . . . > *PRINT
Library . . . . . . . . . . .
From member . . . . . . . . . . > *ALL
To member or label . . . . . . . *FROMMBR
Replace or add records . . . . . *REPLACE
Source update options . . . . . *SAME

and then cpysplf and then download that that file via Client Acces to your PC as ascii file. Only tricky thin afterwards is to seperate those sources.
 
and ofcourse a quicker way instead of cpysplf use CA Operation Navigator where you can copy/paste spoolfile to ascii file.
 
Hmm the tricky bit is certainly creating one source member per text file to make the sources easier to work with.

But using a combination of the two methods there is an easy way!

1) Create a temporary OUTQ.

2) Write a simple CL program to CPYSRCF each member in
a source file to *PRINT in the OUTQ. I will then have
an OUTQ with one print for each source member.

3) Use Client Access Operations Navigator to look at
the OUTQ and select all of the entries in the OUTQ.
This can be achieved by using the standard windows
selection of click and shift-click to highlight
a range of files ( just like in file explorer ).

4) Copy and paste the selections to a folder in file
explorer and there you have it. :eek:).

Thanks chaps.



 
Well it all works fine except for one little problem.

The CPYSRCF command I use for each source member sets the name of the spool file to the same name as the source member
instead of 'QSYSPRT'. This works fine and in AS/400 Operations Navigator I can copy and paste them into a folder on my laptop.

However.....

For some reason all of the source files are pasted with '906003' appended to the member name. Why is this and how can I stop it?

 
You could always copy all the source files into one library and save that to a savf and then ftp that to a pc. That way you will just have to ftp to your new as/400 and restore your savf to be able to view/copy your source code.

Hope this helps.

--------------------------------
If it ain't broke, don't fix it!
 
The best is to send the program by Client Access from file -
library/QRPGLESRC/member.
 
Try this:
Write a CL program that retrieves the list of members, then does a copy to pc document on each member.

Code:
        Pgm

        DclF MyFile

        DspFd File(SourceLib/SourceFile) +
              Type(*MbrList) +
              Output(*OutFile) +
              OutFile(MyLib/MyFile)

Start:  RcvF
          MonMsg  MsgId(Cpf0864) Exec(Goto CmdLbl(End))

        CpyToPcd  FromFile(SourceLib/SourceFile) +
                  ToFlr(MyFolder) +
                  FromMbr(&MlName) +
                  ToDoc(&MlName)

        Goto      CmdLbl(Start)

End:    EndPgm

The dspfd retrieves all of the member names from the source file. Then you just read the file, the field &MLNAME is the field in MyFile that contains the member name. Copy all the the members into a pc file in a folder under qdls, then drag and drop them using either Ops Nav, or Windows Explorer to where ever you want the files.

RedMage1967
IBM Certifed - RPG IV Progammer
 
Hi!

when i needed to backup all my programs i use a ftp connection and then i did the following:

ftp -i <you_AS>

cd <my_as_library>
mget qrpgsrc.*
mget qclsrc.*

it creates all the sources in the directory where you called the FTP command.
hope it helps.
karina
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top