[TABLE]
FTP is a necessity when transferring files to and from the iSeries. This week site expert Tim Granatir provides a collection of miscellaneous FTP tips that address such subjects as the batch FTP process, logging FTP results to a file and getting to the Integrated File System. Check them out and see if there's anything you can add to your bag of tricks.
1. Example of transferring a file to an iSeries without having to create the save file on the target iSeries
You always need to use binary when transferring save files but the real key here is the use of the NAMEFMT 1 command. When you use NAMEFMT 1, you will need to specify your file names in the same way that you would if you were using the IFS.
2. Batch FTP process from the iSeries
This is similar to the DOS batch file approach but just slightly different.
Here is the example code for the CL program on the iSeries:
Here is the example for the Input file:
If you override the file INPUT before the FTP command, FTP will use the file you specified for your FTP commands. The file containing your FTP commands can either be a source file or a physical file.
3. Logging FTP results to a file
If you override the file OUTPUT before doing your FTP command, your FTP commands and results will be logged to the file you specified.
4. Running system commands on a remote iSeries
Using the SYSCMD function in FTP allows you to run system commands on the
To continue reading for free, register below or login
To read more you must become a member of Search400.com
');
// -->

remote system.
Example:
From a non-iSeries -- quote rcmd sndmsg msg(hello) tousr(myuser)
From iSeries to iSeries -- syscmd sndmsg msg(hello) tousr(myuser)
5. Increasing the amount of time before a connection automatically closes
Quote time 1000 -- Increases idle time to 1000 seconds
By default, FTP automatically disconnects after five minutes of inactivity. This will increase that amount of time.
6. Getting to the Integrated File System
After you make your FTP connection to the 400, go to the root directory and add your directories as needed. Example:
When you switch to the root directly, make sure you use a forward slash instead of a back slash. Also, when you change to the root directory, OS/400 changes the NAMEFMT to 1 for you.
7. FTP DOS extensions
I have used some of these extensions but not all of them. This is a useful reference if you need to do any DOS batch files with FTP.
---------------------------
About the author: Tim is vice president of Technical Services at Interlink Technologies in Maumee, Ohio, where he serves as chief architect for their warehouse management system. He has worked in the banking, insurance, healthcare and distribution industries in various positions, including programmer/analyst, systems analyst and DP manager. Tim has worked on IBM midrange platforms since 1983.
==================================
MORE INFORMATION
==================================