View previous topic :: View next topic
|
Author |
Message |
Anu Narayanan
New User
Joined: 12 Sep 2005 Posts: 20 Location: USA
|
|
|
|
Hi,
I would like to know is there any way to prevent hard coding in FTP file step.
For Ex in FTP step to transfer a mainframe file to LAN, the command is as follows.
userid
pwd
CD fin-mgmt-ftp
CD #2006DOWNLOADS\08_AUGUST\INDIVIDUAL\08_SALES
PUT ' ZFDZ03.DIRMDL.DATA' DIRMDL_081206.PRN
QUIT
The LAN file name has a date field hard coded in it indicating the run date of the job. Instead of hard coding it in the FTP step(because i do not want to change them every month) is there a way to transfer it to the LAN in the same name ? I am using JCL and EASYTRIEVE language for the program generating the M/F file.
Assume the date 081206 is present in a file.
Also the FTP path folder changes for every month run(Month name changes). This also needs to be taken care.
Thank you in advance for your help. |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
This is only a suggestion.
If you have all the date information in your easytrieve program, could you write out an additional 80 position fixed blocked output file with the FTP control card information? The file could then be read into the INPUT DD of the FTP step. |
|
Back to top |
|
|
Anu Narayanan
New User
Joined: 12 Sep 2005 Posts: 20 Location: USA
|
|
|
|
Hi,
Thanks for your reply. I am not able to understand your view. Could you please detail me on that.
Instead of hard coding the date in LAN file name DIRMDL_081206.PRN, what i thought was to get the date from an input file and somehow use that in the LAN file name. This is what i mentioned when i specified "Assume the date 081206 is present in a file".
Thanks |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
You state:
Quote: |
I am using JCL and EASYTRIEVE language for the program generating the M/F file. Assume the date 081206 is present in a file.
|
In the following control cards, the 1st, 2nd, 3rd, and 6th cards have no variable information, so they are constant and should not change. The 4th and 5th cards do have variable information. In your easytrieve program, you are writing the M/F to some output DD statement. My suggestion was to have your easytrieve program define and create another output DD statement where you could read the file that contains the date (if you don't already have the date in working storage), extract it, and format it so it could be substituted with the hardcoded data of the 4th and 5th control cards. There would be 6 records written to the new OUTPUT DD statement with a dataset name of ZFDZ03.FTP.CONTROL.CARDS and that 80 byte dataset would be input to the FTP step as INPUT rather than INPUT DD *
Code: |
userid
pwd
CD fin-mgmt-ftp
CD #2006DOWNLOADS\08_AUGUST\INDIVIDUAL\08_SALES
PUT ' ZFDZ03.DIRMDL.DATA' DIRMDL_081206.PRN
QUIT
|
Code: |
//S13FTPW EXEC PGM=FTP
//YSPRINT DD SYSOUT=*
//OUTPUT DD SYSOUT=*
//INPUT DD DISP=SHR,DSN=ZFDZ03.FTP.CONTROL.CARDS
|
|
|
Back to top |
|
|
Anu Narayanan
New User
Joined: 12 Sep 2005 Posts: 20 Location: USA
|
|
|
|
Hi,
How to write the date from the file (or working storage variable) specifically in to the 4th or 5th card of the ZFDZ03.FTP.CONTROL.CARDS. how to view the FTP control cards ? |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
I am not an easytrieve programmer. I can only program in SAS, REXX and a little COBOL. With any programming language, you can write the logic to manipulate data and put it in whatever form you need. I can't tell you how to do it in easytrieve, but I know it can be done.
If you know the field in the file that contains the DATE, even IBM's DFSORT/ICETOOL product could probably generate the needed control cards. |
|
Back to top |
|
|
|