|
Once you get the FTP Server running on your PC the example is straight out of the manual: 4.3.15.1 Batch FTP: A Simple Example The following is a simple example of a batch file transfer involving the successful transfer of one file from a remote system and the unsuccessful transfer of one file from a remote system. The components are as follows: A CL program An input file of FTP commands An output file of FTP messages The CL Program ************************************************************ ITSOLIB2/QCLSRC BATCHFTP: ---------------------- PGM OVRDBF FILE(INPUT) TOFILE(ITSOLIB2/QCLSRC) MBR(FTPCMDS) OVRDBF FILE(OUTPUT) TOFILE(ITSOLIB2/QCLSRC) MBR(OUT) FTP RMTSYS(SYSxxx) ENDPGM ************************************************************ The BATCHFTP program overrides the INPUT parameter to the source physical file ITSOLIB1/QCLSRC MBR(FTPCMDS). The output is sent to MBR(OUT). The Input Commands File ************************************************************ RLDICK/QCLSRC FTPCMDS: --------------------- ITSO ITSO CD ITSOLIB1 SYSCMD CHGCURLIB ITSOLIB2 GET QCLSRC.BATCHFTP QCLSRC.BATCHFTP (REPLACE QUIT ************************************************************ The FTP subcommands required are shown in the FTPCMDS file. The Output Messages File ************************************************************ FTP Output Redirected to a File FTP Input from Overridden File Connecting to host name SYSxxx at address x.xxx.xx.xxx using port 21. 220-QTCP at SYSxxx.sysnam123.ibm.com. 220 Connection will close if idle more than 5 minutes. 215 OS/400 is the remote operating system. The TCP/IP version is "V3R1M0" Enter login ID (itso): > ITSO ITSO 331 Enter password. 230 ITSO logged on. 250 Now using naming format "0". 257 "QGPL" is current library. Enter an FTP subcommand. > CD ITSOLIB1 Enter an FTP subcommand. 250 Current library changed to ITSOLIB1. > SYSCMD CHGCURLIB ITSOLIB2 Enter an FTP subcommand. > GET QCLSRC.BATCHFTP QCLSRC.BATCHFTP (REPLACE 200 PORT subcommand request successful. 150 Retrieving member BATCHFTP in file QCLSRC in library ITSOLIB1. 250 File transfer completed successfully. 147 bytes transferred in 0.487 seconds. Transfer rate 0.302 KB/sec. Enter an FTP subcommand. > QUIT 221 QUIT subcommand received. ************************************************************ The output file is shown. It is a straightforward matter to write a program to process this file and display an error message on QSYSOPR if there are any error messages. FTP error messages have numbers that start with a 4 or 5. ************************************************************ *********** ************************************************* Freeware FTP server can be foun many places. I like http://www.tucows.com for TCP/IP related files. Bryan Dietz 3X Corp. boothm@ibm.net on 01/07/98 07:52:36 PM Please respond to MIDRANGE-L@midrange.com To: MIDRANGE-L@midrange.com cc: (bcc: Bryan Dietz/Columbus/3X Corp) Subject: re: FTP from CL to a PC Is anyone successfully sending an AS/400 file to a PC within a CL program? Is there a write-up somewhere on how to do it? (I want to FTP the only member in file QTEMP/ABC to 123.45.67.1 c:\home\abc.txt as a comma-delimited file. tia. ---------------------------------------------------- Booth Martin --------------------------------------------------- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to "MIDRANGE-L@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 +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to "MIDRANGE-L@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-2025 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.