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

Renaming a dynamic flat file using JCL


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

New User


Joined: 03 Jul 2014
Posts: 2
Location: USA

PostPosted: Thu Jul 03, 2014 9:57 am
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 03, 2014 10:20 am
Reply with quote

If you use a scheduler at your site, check its documentation to see what can be done.
Back to top
View user's profile Send private message
Sushruta Pradhan

New User


Joined: 03 Jul 2014
Posts: 2
Location: USA

PostPosted: Thu Jul 03, 2014 10:26 am
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 03, 2014 10:51 am
Reply with quote

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

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Thu Jul 03, 2014 8:54 pm
Reply with quote

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
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 How to split large record length file... DFSORT/ICETOOL 8
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top