Rename a dataset name in JCL?

JES2/3, JCL, utilities.
Post Reply
TetraTop
New Member
Posts: 4
Joined: Tue Sep 08, 2015 11:34 am

Rename a dataset name in JCL?

Post by TetraTop »

Is there a possibility to rename a dataset name in JCL itself? Can you please suggest a sample code.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1891
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Rename a dataset name in JCL?

Post by Robert Sample »

JCL executes programs and allocates resources for those programs. Hence, using pure JCL you cannot rename a data set (nor can you sort it nor ...). You could use the IDCAMS utility to rename a data set, but that is not pure JCL.
TetraTop
New Member
Posts: 4
Joined: Tue Sep 08, 2015 11:34 am

Re: Rename a dataset name in JCL?

Post by TetraTop »

HI,

I have used the following JCL

Code: Select all

//STEP1    EXEC PGM=IDCAMS 
//SYSPRINT DD SYSOUT=*                                        
//SYSIN    DD *                                              
 ALTER my.file -                                      
        NEWNAME(my.new.file)                          
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Rename a dataset name in JCL?

Post by nicc »

I have used the following JCL
You have obviously not read AND understood Robert's reply. What follows your //SYSIN DD * is not JCL but IDCAMS control cards.
Regards
Nic
TetraTop
New Member
Posts: 4
Joined: Tue Sep 08, 2015 11:34 am

Re: Rename a dataset name in JCL?

Post by TetraTop »

nicc wrote:
I have used the following JCL
You have obviously not read AND understood Robert's reply. What follows your //SYSIN DD * is not JCL but IDCAMS control cards.
I understood that. But then if I don't ask the question right way, how should I ask such a question?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Rename a dataset name in JCL?

Post by nicc »

Quite simple:
I have used the following JCL and control cards
Regards
Nic
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”