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

FTP from iSeries folder to NT folder 1

Status
Not open for further replies.

Pekka

Technical User
Mar 19, 2002
107
FI
Allright, this is not a rpg issue but as far as I know rpg programmers usually know a lot about the other topics in iSeries job controlling and commands etc. etc. So I dare to ask you experts does somebody know how to ftp file from AS/400 folder to NT folder? I have a clue that it's possible but haven't find any solution to that.
 
FTP on the AS/400 (in general):


Working with the FTP Client:




"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci
 
I do it every night. I have a program that backs up our libraries to savefiles and then I ftp the savefiles down to a network share so I can backup them up to a network storage device.

This is what I've done:

I created a batch file with the following entry:

ftp -s:ftp.txt 192.168.1.2

note: 192.168.1.2 is the AS400/Iseries' IP address
-s: switch tells it look at a text file for the
commands to run. The text file in this example
is named ftp.txt

I then created the ftp.txt file in notepad that contains the following:

as400usernamehere
sa400userpasswordhere
binary
get savefiles/qs36f
get savefiles/msclib
get savefiles/whol
get savefiles/lansadev
get savefiles/acntlb
get savefiles/acntng
quit

The batch file and text file should be in the same directory. What ever folder you run the batch file from is where the files will be downloaded to. I'm sure there are ways to direct it to another folder I just don't know since I don't use it.

I then used Windows Scheduler NT or 2000 to run the batch file every night at 11:00 PM. AT 11:00PM the server runs my ftp batch program and copies our save files down.

I'm sure the links that were provided will give you more information....but hope this might help.
 
Forgot to mention:

In the text file the lines
get savefiles/qs36f
get savefiles/msclib
etc.

SAVEFILES is the library name
qs36f and msclib are the file names

FYI
 
Thank's for uour responses, I solved my problem as follow. My program produces excel files to iSeries ifs folder as a pc document. Then I tranfer them to Ms NT folders so they can be used by our users. Here is my simple ftp. The problem was that I missed the command namefmt 1, which will tell that we are handling a pc file instead of file/(member).
First start ftp to Nt ftp folder, then
USER PASSWORD
NAMEFMT 1
BIN
PUT /QDLS/MyFolder/myFile.xls
QUIT
****************** End of data
 
Stupid question...but to move files back and forward from an AS400 do you have to use save files? Can FTP download an ASCII file version of a source member of physical file from an AS400 to a PC?
 
Skittle:

Transferring a source file to the PC using the ASCII keyword in FTP is possible, but remember that the sequence number and date are the first two fields in the file. So the data starts in position 13.

If you transfer an ASCII file with FTP to a flat file on the AS/400, and you don't have the date ans dequence number, you can use the Copy Source File (CPYSRCF) command after you move FTP the file to a flat file on the AS/400, and this will put the sequence numbers back (but will reset the date to all zeros), and copy the flat file into a source member.


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top