Dynamic name allocation to a file
Moderators: Frank Yaeger, DikDude, Moderator Group
Dynamic name allocation to a file
Got a wierd problem.
Have a dataset ABC, which has the date parameter in the last fields (eg. 2007-06-18).
This dataset is to be FTPed to a server, into the destination path, and is to be renamed as ABC_last-date-parameters.dat. (eg. ABC_20070618.dat).
The naming/specification of the server/username-passwd and path etc happens in the FTP step itself.
Can this requirement be satisfied?
Have a dataset ABC, which has the date parameter in the last fields (eg. 2007-06-18).
This dataset is to be FTPed to a server, into the destination path, and is to be renamed as ABC_last-date-parameters.dat. (eg. ABC_20070618.dat).
The naming/specification of the server/username-passwd and path etc happens in the FTP step itself.
Can this requirement be satisfied?
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
Tejas i can give you some pointers on this..
Yes there is a way to achieve what you have asked for
Its a 2 step process
Now this file has to be fed to a COBOL pgm as input with first 3 bytes as key
and rest as one more field.
Now when the key = PUT read the record else skip all the other lines/records.
Now when we hit the record consider the rest of the record apart from the
key as a string, in a COBOL pgm use INSPECT string replacing by you DATEQLFR
or if the DATEQLFR is curr date get the curr date using some cobol function
move into a working storage variable and finally INSPECT STRING AND REPLACE
"&%@^#!" with the date.
Now the output of step1 will be the same FTP card as above except for the
change in the .TXT file with the date now.
STEP2
********
Now feed the OUTPUT from the step1 as the ORIGINAL FTP CARD to a FTP
step.
We have done this and it works.
Well If you have any questions reg this let us know.
Thanks,
Veera.
Yes there is a way to achieve what you have asked for
Its a 2 step process
Code: Select all
STEP1
********
Assume below is the FTP CARD in a dataset/sysin member
100.100.55.154
username
pswd
TYPE A
CD /
CD TEST
PUT 'ABC.VEERA.EXTR.DATEQLFR' SAMPLE_&%@^#!.TXT
QUIT
and rest as one more field.
Now when the key = PUT read the record else skip all the other lines/records.
Now when we hit the record consider the rest of the record apart from the
key as a string, in a COBOL pgm use INSPECT string replacing by you DATEQLFR
or if the DATEQLFR is curr date get the curr date using some cobol function
move into a working storage variable and finally INSPECT STRING AND REPLACE
"&%@^#!" with the date.
Now the output of step1 will be the same FTP card as above except for the
change in the .TXT file with the date now.
Code: Select all
Sample Code for INSPECT
*******************************
MOVE WZ-999-CURRENT-DATE
TO FTP-MMDDYY
INSPECT FTPIN-REC
CONVERTING '&%@^#!' TO FTP-MMDDYY -> Have ur desired value in FTP-MMDDYY
WRITE FTPOUT-REC FROM FTPIN-REC
STEP2
********
Now feed the OUTPUT from the step1 as the ORIGINAL FTP CARD to a FTP
step.
We have done this and it works.
Well If you have any questions reg this let us know.
Thanks,
Veera.
check this thread
http://www.mainframegurukul.com/Mainfra ... php?t=3993
If you still have any issues, do let us know.
http://www.mainframegurukul.com/Mainfra ... php?t=3993
If you still have any issues, do let us know.
Natarajan
Chennai
Chennai
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page