After logging on to an FTP server, you’ll probably find that the most commonly used commands are PUT to send a file to the server and GET to retrieve a file from the server.
If you’re sending or retrieving AS400 save files to move objects around, then you need to use the BIN command to tell the server not to translate the object from EBCDIC to ASCII.
On any FTP server the HELP command will give you a list of what commands are available. Some systems help is better than others, the AS400′s is very comprehensive.
On the 400, you can use FTP LOOPBACK to start an FTP session on the 400 using the 400 as the server. It’s great for testing and learning.
By default FTP on the 400 is interactive and uses “files” INPUT and OUTPUT to receive commands and echo responses. For interactive FTP the INPUT file is the keyboard and the OUTPUT file is the display.
To run FTP in batch you first configure a script in a source member (I use QFTPSRC as the source file) and override file INPUT to use the source member. To log the results you override file OUTPUT to another source member which will be created if it doesn’t exist.
For example, if member SCRIPT in file QGPL/QFTSPRC has the following:
put mylib/mysavefile mysavefile.savf
put qgpl/qftpsrc.script script.txt
then you would run it by:
OVRDBF INPUT TOFILE(QGPL/QFTPSRC) MBR(SCRIPT)
OVRDBF INPUT TOFILE(QGPL/QFTPSRC) MBR(SCRIPT_LOG)
The script will transfer a save file to a PC based FTP server and also the script itself.
Hope this helps you get started, it’s all pretty straight forward once you get into it.
All the best