Rename a dataset name in JCL?

JES2/3, JCL, utilities.
Previous topicNext topic

Topic Author
TetraTop
New Member
Posts: 4
Joined: Tue Sep 08, 2015 11:34 am

Rename a dataset name in JCL?

Post by TetraTop » Thu Oct 15, 2015 5:27 pm

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: 1331
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: Rename a dataset name in JCL?

Post by Robert Sample » Thu Oct 15, 2015 5:41 pm

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.




Topic Author
TetraTop
New Member
Posts: 4
Joined: Tue Sep 08, 2015 11:34 am

Re: Rename a dataset name in JCL?

Post by TetraTop » Tue Feb 09, 2016 2:24 pm

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: 580
Joined: Wed Apr 23, 2014 8:45 pm

Re: Rename a dataset name in JCL?

Post by nicc » Tue Feb 09, 2016 2:32 pm

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


Topic Author
TetraTop
New Member
Posts: 4
Joined: Tue Sep 08, 2015 11:34 am

Re: Rename a dataset name in JCL?

Post by TetraTop » Mon Sep 12, 2016 2:48 pm

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: 580
Joined: Wed Apr 23, 2014 8:45 pm

Re: Rename a dataset name in JCL?

Post by nicc » Mon Sep 12, 2016 5:43 pm

Quite simple:
I have used the following JCL and control cards


Regards
Nic


enrico-sorichetti
Global Moderator
Global Moderator
Posts: 875
Joined: Wed Sep 11, 2013 3:57 pm

Re: Rename a dataset name in JCL?

Post by enrico-sorichetti » Wed Oct 26, 2016 6:11 pm

the proper question would have been
what utility should I use to rename a dataset
and what would be the relative control cards


cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)


enrico-sorichetti
Global Moderator
Global Moderator
Posts: 875
Joined: Wed Sep 11, 2013 3:57 pm

Re: Rename a dataset name in JCL?

Post by enrico-sorichetti » Wed Oct 26, 2016 6:14 pm

we can use IDCAMS utility but it have some risk because file may come error for small issue also
pretty useless remark ...
anything can damage things if used in the improper ways

a screwdriver will certainly damage Your ears if You use it instead of a Q-tip

an ICKDSF execution will make You lo lose quite a few datasets if run with the wrong control card
( pointing to the wrong volume )


cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)

Previous topicNext topic

Return to “JCL - Job Control Language.”