Page 1 of 1

Rename a dataset name in JCL?

Posted: Thu Oct 15, 2015 5:27 pm
by TetraTop
Is there a possibility to rename a dataset name in JCL itself? Can you please suggest a sample code.

Re: Rename a dataset name in JCL?

Posted: Thu Oct 15, 2015 5:41 pm
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.

Re: Rename a dataset name in JCL?

Posted: Tue Feb 09, 2016 2:24 pm
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)                          

Re: Rename a dataset name in JCL?

Posted: Tue Feb 09, 2016 2:32 pm
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.

Re: Rename a dataset name in JCL?

Posted: Mon Sep 12, 2016 2:48 pm
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?

Re: Rename a dataset name in JCL?

Posted: Mon Sep 12, 2016 5:43 pm
by nicc
Quite simple:
I have used the following JCL and control cards