× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Mike,

We FTP quite a few files out from our AS400 to 3rd parties , the destination
file name changing to a date stamped file.
We achieve this in the following manner.

A file contains the actual FTP script (file name LOYCMDS in this example)

'user ID'   'password'                                      
BINARY                                                          
NAMEFMT 1                                                       
PUT /QDLS/LOYALTY/20040620/CONTENTS.TXT SNPHH_200604@xxxxxxxxxx 
CLOSE                                                           

As you can see the PUT uses a directory (which is todays date) and a file
name which is date and time stamped.

My CL program reads as follows

CALL       PGM(LOYALTY)            /* Update FTP SCRIPT */      
OVRDBF     FILE(INPUT) TOFILE(AUTOPROD/LOYCMDS)             
OVRDBF     FILE(OUTPUT) TOFILE(&LOGFILE) MBR(&LOGFILE)      
FTP        RMTSYS(*INTNETADR) INTNETADR('xxx.xxx.xxx.xxx')    

/* CHECK FTP LOG AND SEND MESSAGE TO CONSOLE */                       
CALL       PGM(FTPCHKCL) 

The called Loyalty program reads my FTP script file in , and simply reads
line 4 of the file and replaces the directory name with todays date and
replaces the destination filename with todays date and time. This FTP script
file is then used by the FTP command as an input file.
Obviously these can be anyth9ing you choose.

In the CL program I also output the FTP commands to my own logfile where I
then check to make sure that the FTP was successful via the FTPCHKCL
program. A message is sent to the console if it is not successful.
(I simply look for the words 'transfer complete' in the FTP log file)
 
I hope this helps.

Regards

Steven Gray
Senior Analyst
ARVAL PHH




_____________________________________________________________________
This e-mail has been scanned for viruses by MCI's Internet Managed Scanning 
Services - powered by MessageLabs. For further information visit 
http://www.mci.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.