Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Renaming a dynamic flat file using JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Renaming a dynamic flat file using JCL
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: 7905
Location: Bellevue, IA

PostPosted: Thu Jul 03, 2014 10:20 am    Post subject:
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    Post subject: Reply to: Renaming a dynamic flat file using JCL
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: 7905
Location: Bellevue, IA

PostPosted: Thu Jul 03, 2014 10:51 am    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Thu Jul 03, 2014 8:54 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us