Rename a dataset name in JCL?

JES2/3, JCL, utilities.

Topic author
TetraTop
New Member
Posts: 4
Joined: Tue Sep 08, 2015 11:34 am
Been thanked: 1 time

Rename a dataset name in JCL?

Postby 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.



Online
User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1275
Joined: Fri Jun 28, 2013 1:22 am
Location: East Dubuque Illinois
Has thanked: 2 times
Been thanked: 90 times

Re: Rename a dataset name in JCL?

Postby 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
Been thanked: 1 time

Re: Rename a dataset name in JCL?

Postby 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: 544
Joined: Wed Apr 23, 2014 8:45 pm
Been thanked: 11 times

Re: Rename a dataset name in JCL?

Postby 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
Been thanked: 1 time

Re: Rename a dataset name in JCL?

Postby TetraTop » Mon Sep 12, 2016 2:48 pm

nicc wrote:Source of the post
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: 544
Joined: Wed Apr 23, 2014 8:45 pm
Been thanked: 11 times

Re: Rename a dataset name in JCL?

Postby nicc » Mon Sep 12, 2016 5:43 pm

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


Regards
Nic

Online

enrico-sorichetti
Global Moderator
Global Moderator
Posts: 822
Joined: Wed Sep 11, 2013 3:57 pm
Been thanked: 69 times

Re: Rename a dataset name in JCL?

Postby 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-)

Online

enrico-sorichetti
Global Moderator
Global Moderator
Posts: 822
Joined: Wed Sep 11, 2013 3:57 pm
Been thanked: 69 times

Re: Rename a dataset name in JCL?

Postby 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-)


Return to “JCL - Job Control Language.”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 1 guest