 |
 |
| iSeries 400 Tips: |
|
 |
 |

ISERIES PROGRAMMER TIPS
Dynamically transfer files via FTP
Tim Granatir, Search400.com expert 08.27.2003
Rating: -4.33- (out of 5)




|
Here is a general-purpose program that dynamically creates an AS/400 FTP script, runs the FTP and then checks for errors. This program can be called from a job stream to dynamically transfer a file. Although this program is fully functional as is, I prefer to think of it more as a starting point for more specific types of processes.
If you are using to this to transfer save files from one AS/400 system to another, you'll want to make sure that the binary is added to your FTP script file. Also, when transferring save files, I prefer to add NAMEFMT 1 to my FTP script file so that I don't have to pre-create the save file on the system that will be receiving the save file. If you use NAMEFMT 1, you will have to specify file names in a directory type format such as /qsys.lib/mylib.lib/mysavf.savf
[TABLE]In the manuals, it says that FTP errors should begin with a 4 or a 5 and the program FTP20C will catch those and report those types of errors. In reality, I've found a couple nuances to this approach. The first one is that if you have an incorrect system name to start the FTP, that error does not begin with a 4 or a 5. The second thing I've found, and I've only seen this when working with systems when one of
To continue reading for free, register below or login
To read more you must become a member of Search400.com
');
// -->

them was not an AS/400, is that some errors that I would consider warnings show up in the error file. The FTP still completes normally, but an error is logged. Your options at that point are to change your FTP script to not generate the warning or monitor for it in your error-checking program (FTP20C).
Some information about the program
FTP10C is the program that creates the FTP script, does the FTP transfer and calls the error-monitoring program. I prefer to create the FTP script file (FILFTP) in qtemp so that multiple users can run this program at the same time without interfering with one another.
A description of the parms:
---------------------------
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
==================================
 |

|
|
 |
|
 |
 |
 |
 |
| TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of . |
|
| |
All Rights Reserved, , TechTarget |
|
|
|
|
|