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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP source code from I-series to PC

Status
Not open for further replies.

wombatnc

Programmer
Feb 21, 2012
5
US
This can't be that hard. All of want is a copy of my source code downloaded to my pc. I have tried just about everything. I cannot get the files to my pc. Can anyone provide a real basic ftp sequence to get my source code to the pc?
 
The only way I could get the source code to transfer was to ftp from the pc to the i-series. If I use get I can bring over single source pgms as a renamed .TXT file that I can send to the pc. Other wise the mget would not bring then over as .TXT. I would have to rename each pgm to .TXT after ftping and then send then to the pc.
used: ascii, cd mylibrary, ls, lcd C:\temp, mget source.*

I want to be able to use mget on all the source and download the group with an .TXT file type so that I do not have to rename each file or bring down each one individually. I have to work from home sometimes and having the homegrown source code on hand as a reference is helpful.
 
For example I have on public iSeries pub1.rzkh.de in my library MIKROM1 a REXX-Source File named QREXSRC.
Now I want to get all members, i.e. these 3 REXX-sources
Code:
                           Work with Members Using PDM                 PUB1     
                                                                                
 File  . . . . . .   QREXSRC                                                    
   Library . . . .     MIKROM1              Position to  . . . . .              
                                                                                
 Type options, press Enter.                                                     
  2=Edit         3=Copy  4=Delete 5=Display       6=Print     7=Rename          
  8=Display description  9=Save  13=Change text  14=Compile  15=Create module...
                                                                                
 Opt  Member      Type        Text                                              
      HALLO       REXX                                                          
      MONTH       REXX                                                          
      MONTHOFDAT  REXX
to my local directory on PC named C:\work\as400_souces.

Then I can do following using FTP from my Windows:
Code:
C:\Users\mikl1071>[COLOR=blue]ftp pub1.rzkh.de[/color]
Connected to pub1.rzkh.de.
220-QTCP at PUB1.RZKH.DE.
220 Connection will close if idle more than 60 minutes.
User (pub1.rzkh.de:(none)): [COLOR=blue]mikrom[/color]
331 Enter password.
Password: [COLOR=blue]Here I enter my Password[/color]
230 MIKROM logged on.
ftp> [COLOR=blue]cd /QSYS.LIB/MIKROM1.LIB/QREXSRC.FILE[/color]
250 "/QSYS.LIB/MIKROM1.LIB/QREXSRC.FILE" is current directory.
ftp> [COLOR=blue]lcd C:\work\as400_sources[/color]
Local directory now C:\work\as400_sources.
ftp> [COLOR=blue]ls[/color]
200 PORT subcommand request successful.
125 List started.
HALLO.MBR
MONTH.MBR
MONTHOFDAT.MBR
250 List completed.
ftp: 38 bytes received in 0,03Seconds 1,23Kbytes/sec.
ftp> [COLOR=blue]ascii[/color]
200 Representation type is ASCII nonprint.
ftp> [COLOR=blue]mget *.MBR[/color]
200 Representation type is ASCII nonprint.
mget HALLO.MBR? [COLOR=blue]y[/color]
200 PORT subcommand request successful.
150 Retrieving member HALLO in file QREXSRC in library MIKROM1.
250 File transfer completed successfully.
ftp: 25 bytes received in 0,00Seconds 25000,00Kbytes/sec.
mget MONTH.MBR? [COLOR=blue]y[/color]
200 PORT subcommand request successful.
150 Retrieving member MONTH in file QREXSRC in library MIKROM1.
250 File transfer completed successfully.
ftp: 111 bytes received in 0,00Seconds 111000,00Kbytes/sec.
mget MONTHOFDAT.MBR? [COLOR=blue]y[/color]
200 PORT subcommand request successful.
150 Retrieving member MONTHOFDAT in file QREXSRC in library MIKROM1.
250 File transfer completed successfully.
ftp: 1040 bytes received in 0,03Seconds 32,50Kbytes/sec.
ftp> [COLOR=blue]quit[/color]
221 QUIT subcommand received.

Now I got the desired sources as *.MBR in local directory on my PC:
Code:
C:\Work\as400_sources>dir
 Volume in drive C is OS
 Volume Serial Number is 18C2-F7F3

 Directory of C:\Work\as400_sources

22. 05. 2012  22:12    <DIR>          .
22. 05. 2012  22:12    <DIR>          ..
22. 05. 2012  22:12                25 HALLO.MBR
22. 05. 2012  22:12               111 MONTH.MBR
22. 05. 2012  22:12             1 040 MONTHOFDAT.MBR
               3 File(s)          1 176 bytes
               2 Dir(s)  13 075 226 624 bytes free
But *.MBR are ASCII text files. I can rename them to *.REXX if I want.

Above I used blue for commands I typed.
For example for path of the REXX-source file on iSeries I used IFS-naming convention:
/QSYS.LIB/MIKROM1.LIB/QREXSRC.FILE

Any other questions?
 
On iSeries if your source nembers are of type *.TXT or *.REXX,...etc, you can access them as *.MBR using the qualified names:
Code:
/QSYS.LIB/your_lib.LIB/your_file.FILE/your_mbr.MBR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top