View previous topic :: View next topic
|
Author |
Message |
Sushruta Pradhan
New User
Joined: 03 Jul 2014 Posts: 2 Location: USA
|
|
|
|
Hi,
I have a flat file which is generated evry month and the file name is suffixed with month and year . Like File1.May2014. I want to rename the file in my job. The file name is changing everymonth.
I dont want to copy the file using any of the utility as it involves CPU cost. The file size are around 5 GB and the Name is dynamic evry month.
Can you please let me know how can I achive this.
Current File Name
FILE1.May2014
TO BE File name after renaming.
FILE2.R201405
If I will use IDCAM or other utility then how can I pass the dynamic values like ( May2014 or 201405) to the SYSIN DD * from JCL .
Thanks |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
If you use a scheduler at your site, check its documentation to see what can be done. |
|
Back to top |
|
|
Sushruta Pradhan
New User
Joined: 03 Jul 2014 Posts: 2 Location: USA
|
|
|
|
I am usig CTLM and identified on how to use the variable. My question is how to Rename a file and how to pass values to SYSIN DD* in the IDCAM. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Your FIRST choice should be to use the Control-M facilities -- schedulers can handle changing data set names, usually without too much of a problem.
If you decide, for whatever reason, that your scheduler won't do what you want, then you have two choices: (1) do the rename manually each month, or (2) write a program in the language of your choice to get each month's file name (via LISTCAT, LISTDSI, or whatever) and create the JCL to rename it. You then copy this JCL to the internal reader to submit the job.
You do NOT "pass values to SYSIN DD *" in your job -- JCL is fixed once it has been read into the system and converted / interpreted, so there is really no way to do dynamic parameter tailoring in a single job. Hence the need for a second job submitted through the internal reader. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
Code: |
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
ALTER old.file.name -
NEWNAME(new.file.name)
// |
Beware of the ALTER command because the entry stays in the catalog aliased by "old" HLQ. The "new" HLQ may point to a different catalog so this file would NOT be found.
So as Robert explained that is the standard and safe way to get solutions to your problem. |
|
Back to top |
|
|
|