|
Here is a summary for batch ftp on the AS/400. 1. Create a source file with (at least) two members. The first will be for the script, the second for the log. In this example I will use file CBMOREHEAD/FTP with members SCRIPT and LOG. 2. In the SCRIPT member place your FTP script. The first line will need to contain the user name and password you wish to log on to the FTP server with. These should be separated by spaces. E.g.: myuser mypassword cd mydir get myfile quit 3. In your CL program override files INPUT and OUTPUT to the SCRIPT and LOG members. E.g.: OVRDBF FILE(INPUT) TOFILE(FTP) MBR(SCRIPT) OVRDBF FILE(OUTPUT) TOFILE(FTP) MBR(LOG) 4. I also clear the log member each time: CLRPFM CBMOREHEAD/FTP LOG 5. In your CL program either FTP SYSTEMNAME (if you have a DNS server or have a host table entry for the system name) or FTP n.n.n.n, where n.n.n.n is the IP address of the FTP server. This will cause the AS/400 to log into the FTP server with the user and password in member SCRIPT and then execute the FTP commands in member SCRIPT. A log of the results of this FTP session are placed in member LOG. 6. I then write a program to read member LOG and take action based on whatever errors it finds. +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.