FTP from Client site

20 pts.
Tags:
Application development
AS/400
I am trying to receive data from a client site into an externally described file on my ISerie. Data will be received daily and the file name is date stamped, (for example:filea103106, filea110106)my problem is that since it needs to be copied into MYLIB/MYFILE, I cannot use the MGET filea* to copy it in that specific library/file. I have to specify the file name every time. Is there a way to rename the file to a specific name once its received on my ISerie??

Answer Wiki

Thanks. We'll let you know when a new response is added.

Since you know what the name will be every time:
If you are pulling the data from the AS/400 in the CL you can pull the data with the FTP script and then rename the file after exiting FTP.
If you’re pushing the data from the client, in the FTP script try using SYScmd to call a program on the AS/400 that will rename the file.

=========================================================

If you’re executing FTP interactively, you can type any name you want obviously. If it’s a batch process, then your FTP commands are being read from a script/file. And as with every file, you can update, add or delete any record in it by any file maintenance procedure you want to use.

Where’s the problem? Usually a simple SQL UPDATE statement with a WHERE clause to recognize the MGET record is all that’s needed. Or generate a custom FTP script from template sections by using a Qshell script. Or simply write the FTP subcommands in a basic RPG or COBOL program. Or even a REXX procedure.

Tom

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • MDratwa
    I have to get data files from a multiple client sites and I use this same type of procedure on each one. I use the mget filename*.txt (or any extension). I download the data files into a "trash" directory on the IFS. When the FTP session ends, I use "DIR" on that "trash" directory using the outfile option. I have a file ("FILEA") which contains records of processed file names and date of processing. I will compare the "DIR" outfile file names to the "FILEA" and bypass any file names found. I copy the new data file into a physical file (or whatever processing needs to be done). After processing the data, I will add a record into "FILEA". I will use the "FILEA" current date to generate a rename FTP script. I run the second FTP script renaming the processed files as filename.txt to filename.txt.old.
    785 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following