|
Lim Hock-Chai, Assuming you are staying logged on to the same userid, you should be able to do in CL or REXX. I'll embed some simple REXX and associated parm file. The parm file is where you would put your commands for whatever you wish to do while in FTP. For multiple FTPs to or from the same site, just create more FTP parms for the second, third, etc., FTP. Now if you are wanting to FTP to/from different logons all in the same job, you'll have to close and recreate new overrides to point to a different parm file, add additional FTP commands in the REXX code, and so forth. Here is some sample code to get you started: ******************************************************************************** /* CRWUDWNLD0 REXX Exec developed by Dave Odom 2/6/04 */ /*********************************************************************/ /* This REXX Exec is the driver program that downloads the Western */ /* Union payment files which come from remote pay stations. */ /* This exec uses two external files to perform the FTP and capture */ /* the history of the transfer. Those files are WUFTPSTR and WUFTPEND */ /* This exec is invoked automatically using the AS/400's */ /* process as a scheduled job. */ /* */ /* ******** **** ***************************************************/ /* 02/06/04 DaveO Creation */ /*********************************************************************/ /*********************************************************************/ trace 'o' /* Initialize RC variable */ RC = 0 ADDRESS '*COMMAND', 'OVRDBF FILE(INPUT) TOFILE(HTEUSR/WUFTPCMDS) MBR(WUFTPSTR)' 'OVRDBF FILE(OUTPUT) TOFILE(HTEUSR/WUFTPCMDS) MBR(WUFTPEND)' 'FTP RMTSYS("IP address or site name in a DNS") port(*dft)'; 'DLTOVR FILE(INPUT)' 'DLTOVR FILE(OUTPUT)' SIGNAL ON ERROR EXIT RC *******End of REXX code at EXIT RC *********************************************** *************** Begin Parm file in Plain text file on iSeries ****************************** Userid Password CD OUT DIR GET filename.extension library/filename (REPLACE DIR quit ********************************************************************************* The OUTPUT override is for a log file I didn't embed here as you can create one or not. I'd suggest you do as it provides a log file of everything that went on in your FTP session. If you'd like to try this in REXX I can send you the code, parm file, etc., in an email and then I suggest you FTP from your PC to your iSeries to make sure it gets into the iSeries files correctly. You usually use three different iSeries file associations for this QCMD, QREXSRC and wherever you want to put the parm file. You could use the REXX code as an example for CL as well. I just like REXX better than CL and its more powerful as well. Take care, Dave
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.