IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Preventing hard coding of File Name in FTP step


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Anu Narayanan

New User


Joined: 12 Sep 2005
Posts: 20
Location: USA

PostPosted: Thu Sep 14, 2006 10:08 pm
Reply with quote

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
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Sep 14, 2006 10:36 pm
Reply with quote

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
View user's profile Send private message
Anu Narayanan

New User


Joined: 12 Sep 2005
Posts: 20
Location: USA

PostPosted: Thu Sep 14, 2006 10:43 pm
Reply with quote

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
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Sep 14, 2006 11:09 pm
Reply with quote

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
View user's profile Send private message
Anu Narayanan

New User


Joined: 12 Sep 2005
Posts: 20
Location: USA

PostPosted: Fri Sep 15, 2006 12:08 am
Reply with quote

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
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Fri Sep 15, 2006 12:49 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top