Discussion:
rename datasets
Add Reply
Ron Thomas
2017-05-10 20:38:04 UTC
Reply
Permalink
Raw Message
Hi . We have around 700 datasets where we need to rename the names , is there a utility by which we can run the same in batch ? I believe i can use IDCAMS , but is there a better way to it with less effort ?


Regards
Ron T

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Allan Staller
2017-05-10 20:45:24 UTC
Reply
Permalink
Raw Message
Try dfdss:
Pseudo-command below:

CPY DATASET INCLUDE(xxxxx.**) RENUNC (xxxxx.**, xxxxx.**.new) replace recatalog(*) delete (pseudo-command)

Might need some extra temp space during the copy and there are some limitations on the structure of the from and to names when using wild cards.
Check the Fine Manual for details

HTH,

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Ron Thomas
Sent: Wednesday, May 10, 2017 3:39 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: rename datasets

Hi . We have around 700 datasets where we need to rename the names , is there a utility by which we can run the same in batch ? I believe i can use IDCAMS , but is there a better way to it with less effort ?


Regards
Ron T

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN


::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and other defects.

----------------------------------------------------------------------------------------------------------------------------------------------------


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
John McKown
2017-05-10 20:46:02 UTC
Reply
Permalink
Raw Message
Post by Ron Thomas
Hi . We have around 700 datasets where we need to rename the names , is
there a utility by which we can run the same in batch ? I believe i can
use IDCAMS , but is there a better way to it with less effort ?
​That's a bit vague. Do you have some sort of "pattern" or algorithm you're
using to convert the old DSN ​to a new DSN? I don't know of any standard
IBM utility which would do a "wildcard" rename. I often use a language such
as REXX or AWK to generate IDCAMS control cards, then run a batch job with
them. I do the "wild card" either by doing an IDCAMS LISTCAT (such as LISTC
LVL('SYS1.LIH1') and then process that output in my REXX program).
Post by Ron Thomas
Regards
Ron T
--
Advertising is a valuable economic factor because it is the cheapest way of
selling goods, particularly if the goods are worthless. -- Sinclair Lewis


Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2017-05-10 20:47:37 UTC
Reply
Permalink
Raw Message
Post by Ron Thomas
Hi . We have around 700 datasets where we need to rename the names , is there a utility by which we can run the same in batch ? I believe i can use IDCAMS , but is there a better way to it with less effort ?
If the renaming is regular, use a script to generate the IDCAMS SYSIN.

If the renaming is sporadic but you have a list of old-name new-name
pairs, use a script to convert that to IDCAMS SYSIN.

If you haven't this information in any form, you're SoL.

If there is overlap of the new-names with the old-names, rename each
data set twice, first old-name -> neutral name, then neutral-name -> new name.

Have at least two people review the IDCAMS SYSIN before you submit the job.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Ron Thomas
2017-05-10 20:50:28 UTC
Reply
Permalink
Raw Message
we are looking at renaming all of the datasets like the below.

Old dataset - > SLXR5V.SAPDB.*
New dataset - > SLXR5V.SAPDB.X.*

Thanks
Ron T

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
John McKown
2017-05-10 20:58:26 UTC
Reply
Permalink
Raw Message
Post by Ron Thomas
we are looking at renaming all of the datasets like the below.
Old dataset - > SLXR5V.SAPDB.*
New dataset - > SLXR5V.SAPDB.X.*
​Ah. Not too bad. Something like the following REXX might work (untested
since it's close to my go-home time)

/* REXX */
XX=OUTTRAP('DATA.','*')
LISTC LVL('SLXR5V.SAPDB​')
XX=OUTTRAP("OFF")
DO I=1 TO DATA.0
LINE=DATA.I
IF 'NONVSAM' <> WORD(LINE,1) THEN ITERATE /* ONLY WORKS FOR NON-VSAM */
DSN=WORD(LINE,3) /* GET THE DSN */
SUFFIX=SUBSTR(DSN,12) /* STRIP OFF THE FRONT */
NEWDSN='SLXR5V.SAPDB.X'||SUFFIX
"ALTER '"DSN"' NEWNAME('"NEWDSN"')"
END

​My example is only for non-VSAM, but you can use something similar by
checking the first word for "CLUSTER", "INDEX", or "DATA".​
Post by Ron Thomas
Thanks
Ron T
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
Advertising is a valuable economic factor because it is the cheapest way of
selling goods, particularly if the goods are worthless. -- Sinclair Lewis


Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Steve Smith
2017-05-10 22:12:01 UTC
Reply
Permalink
Raw Message
IDCAMS is happy to do generic renames such as that.

Until you specified that only certain ones should be. Never mind.

sas
Post by John McKown
Post by Ron Thomas
we are looking at renaming all of the datasets like the below.
Old dataset - > SLXR5V.SAPDB.*
New dataset - > SLXR5V.SAPDB.X.*
​Ah. Not too bad. Something like the following REXX might work (untested
since it's close to my go-home time)
/* REXX */
XX=OUTTRAP('DATA.','*')
LISTC LVL('SLXR5V.SAPDB​')
XX=OUTTRAP("OFF")
DO I=1 TO DATA.0
LINE=DATA.I
IF 'NONVSAM' <> WORD(LINE,1) THEN ITERATE /* ONLY WORKS FOR NON-VSAM */
DSN=WORD(LINE,3) /* GET THE DSN */
SUFFIX=SUBSTR(DSN,12) /* STRIP OFF THE FRONT */
NEWDSN='SLXR5V.SAPDB.X'||SUFFIX
"ALTER '"DSN"' NEWNAME('"NEWDSN"')"
END
​My example is only for non-VSAM, but you can use something similar by
checking the first word for "CLUSTER", "INDEX", or "DATA".​
Post by Ron Thomas
Thanks
Ron T
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
Advertising is a valuable economic factor because it is the cheapest way of
selling goods, particularly if the goods are worthless. -- Sinclair Lewis
Maranatha! <><
John McKown
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
sas

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Peter Hunkeler
2017-05-12 06:26:01 UTC
Reply
Permalink
Raw Message
Post by Ron Thomas
we are looking at renaming all of the datasets like the below.
Old dataset - > SLXR5V.SAPDB.*
New dataset - > SLXR5V.SAPDB.X.*
Something that nobody had mentionesd so far: A rename will *not* move that data set to some other storage group. I.e. while a rename will drive ACS routines, and the data set may get different Management and Storage classes assigned, the data set will *not* be physically moved. So data sets may be left with conflicting attributes, e.g. a management class requesting some backup or performance attribute that the current DASD (storage group) does not provide.




I doubt this matters in your case. But generally speaking, keep the above in mind when doing renames.


--
Peter Hunkeler



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Ron Thomas
2017-05-10 20:54:12 UTC
Reply
Permalink
Raw Message
Also, all of the files that need to renamed is there in a file . We want only those in the file to be renamed .

Thanks
Ron T

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Elardus Engelbrecht
2017-05-11 05:28:24 UTC
Reply
Permalink
Raw Message
Post by Ron Thomas
we are looking at renaming all of the datasets like the below.
Old dataset - > SLXR5V.SAPDB.*
New dataset - > SLXR5V.SAPDB.X.*
Are they Non-VSAM? Do you have other means to check that they're still in use or not? Do you have means to check that the new names are not already in place?

John McKown REXX will help you there. If they'r VSAM, you need to add extra steps to ensure the rest of the cluster are also renamed.

Of course you need a sure way to check everything before you run it.

What we're usually doing - RENAME HLQ.??? to X.HLQ.??? (add unused HLQ before, and thus move it out of the way) or something like that.

Groete / Greetings
Elardus Engelbrecht

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Ron Thomas
2017-05-11 13:35:47 UTC
Reply
Permalink
Raw Message
Thanks John . I am new to Rexx , but just wanted to know how in the below code, we make sure that only what is in my input file is read and renamed and not all the datasets under the SLXR5V.SAPDB.* ?

/* REXX */
XX=OUTTRAP('DATA.','*')
LISTC LVL('SLXR5V.SAPDB​')
XX=OUTTRAP("OFF")
DO I=1 TO DATA.0
LINE=DATA.I
IF 'NONVSAM' <> WORD(LINE,1) THEN ITERATE /* ONLY WORKS FOR NON-VSAM */
DSN=WORD(LINE,3) /* GET THE DSN */
SUFFIX=SUBSTR(DSN,12) /* STRIP OFF THE FRONT */
NEWDSN='SLXR5V.SAPDB.X'||SUFFIX
"ALTER '"DSN"' NEWNAME('"NEWDSN"')"
END

Thanks
Ron T

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
John McKown
2017-05-11 13:51:37 UTC
Reply
Permalink
Raw Message
Post by Ron Thomas
Thanks John . I am new to Rexx , but just wanted to know how in the below
code, we make sure that only what is in my input file is read and renamed
and not all the datasets under the SLXR5V.SAPDB.* ?
​Good catch. My code will rename all NONVSAM in the catalog. If you already
have a list of DSNs in a data set, then see the changes below​.
Post by Ron Thomas
/* REXX */​
​ /* INSTEAD OF THE LISTC, READ A DD NAME */​
/* REPLACE ddname WITH THE READ DD NAME */
"EXECIO * DISKR ddname (FINIS STEM DATA."
/* READ ENTIRE DSN INTO THE DATA. STEM */
Post by Ron Thomas
DO I=1 TO DATA.0
LINE=DATA.I
​ /* JUST PROCESS THE DSN - FIRST WORD IN INPUT LINE */
DSN=WORD(LINE,1)​
Post by Ron Thomas
SUFFIX=SUBSTR(DSN,12) /* STRIP OFF THE FRONT */
NEWDSN='SLXR5V.SAPDB.X'||SUFFIX
"ALTER '"DSN"' NEWNAME('"NEWDSN"')"
END
Thanks
Ron T
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
Advertising is a valuable economic factor because it is the cheapest way of
selling goods, particularly if the goods are worthless. -- Sinclair Lewis


Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Lizette Koehler
2017-05-11 13:52:22 UTC
Reply
Permalink
Raw Message
You probably need to code an EXECIO to read the input file, then adjust the code.

Remove the LISTC and just do the DO LOOP part

I am sure when John sees this, he may post a version that meets your needs

READ from INPUT File

ALTER Names

Though, depending on dataset types (DASD vs. DISK vs. Migrated) this may or may not do all dataset names.



Lizette
Post by Allan Staller
-----Original Message-----
Behalf Of Ron Thomas
Sent: Thursday, May 11, 2017 6:37 AM
Subject: Re: rename datasets
Thanks John . I am new to Rexx , but just wanted to know how in the below
code, we make sure that only what is in my input file is read and renamed
and not all the datasets under the SLXR5V.SAPDB.* ?
/* REXX */
XX=OUTTRAP('DATA.','*')
LISTC LVL('SLXR5V.SAPDB​')
XX=OUTTRAP("OFF")
DO I=1 TO DATA.0
LINE=DATA.I
IF 'NONVSAM' <> WORD(LINE,1) THEN ITERATE /* ONLY WORKS FOR NON-VSAM */
DSN=WORD(LINE,3) /* GET THE DSN */
SUFFIX=SUBSTR(DSN,12) /* STRIP OFF THE FRONT */
NEWDSN='SLXR5V.SAPDB.X'||SUFFIX
"ALTER '"DSN"' NEWNAME('"NEWDSN"')"
END
Thanks
Ron T
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Lizette Koehler
2017-05-11 14:00:54 UTC
Reply
Permalink
Raw Message
DASD vs. DISK vs. Migrated Should be

DASD vs. TAPE vs. MIGRATED

I do not think you can rename if the file is TAPE or Migrated. For Migrated you might need recalls

Note: Depending on the number of datasets, you may wish to have SAY statements added
SAY input-dsn IS BEING RENAMED TO new-dsn
SAY Rename had a return code of RC

And you may wish to run in batch.

Lizette
Post by Allan Staller
-----Original Message-----
Behalf Of Lizette Koehler
Sent: Thursday, May 11, 2017 6:53 AM
Subject: Re: rename datasets
You probably need to code an EXECIO to read the input file, then adjust the code.
Remove the LISTC and just do the DO LOOP part
I am sure when John sees this, he may post a version that meets your needs
READ from INPUT File
ALTER Names
Though, depending on dataset types (DASD vs. DISK vs. Migrated) this may or
may not do all dataset names.
Lizette
Post by Allan Staller
-----Original Message-----
On Behalf Of Ron Thomas
Sent: Thursday, May 11, 2017 6:37 AM
Subject: Re: rename datasets
Thanks John . I am new to Rexx , but just wanted to know how in the
below code, we make sure that only what is in my input file is read
and renamed and not all the datasets under the SLXR5V.SAPDB.* ?
/* REXX */
XX=OUTTRAP('DATA.','*')
LISTC LVL('SLXR5V.SAPDB​')
XX=OUTTRAP("OFF")
DO I=1 TO DATA.0
LINE=DATA.I
IF 'NONVSAM' <> WORD(LINE,1) THEN ITERATE /* ONLY WORKS FOR NON-VSAM */
DSN=WORD(LINE,3) /* GET THE DSN */
SUFFIX=SUBSTR(DSN,12) /* STRIP OFF THE FRONT */
NEWDSN='SLXR5V.SAPDB.X'||SUFFIX
"ALTER '"DSN"' NEWNAME('"NEWDSN"')"
END
Thanks
Ron T
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Jousma, David
2017-05-11 13:59:51 UTC
Reply
Permalink
Raw Message
Since you have all the dataset names in a file already, it wouldn’t be too hard to do a little file tailoring, to code up a DFDSS job to do a copy with rename that deletes the old one afterwards similar to what Allan suggested. The beauty of that is that you then don’t care if it’s a flat file or VSAM.

From Allan's post:

Try dfdss:
Pseudo-command below:

CPY DATASET INCLUDE(xxxxx.**) RENUNC (xxxxx.**, xxxxx.**.new) replace recatalog(*) delete (pseudo-command)

Might need some extra temp space during the copy and there are some limitations on the structure of the from and to names when using wild cards.
Check the Fine Manual for details


The only flaw in Allan's approach with the masking is that you cannot add qualifiers on a masked RENAMEU.

_________________________________________________________________
Dave Jousma
Manager Mainframe Engineering, Assistant Vice President
***@53.com
1830 East Paris, Grand Rapids, MI  49546 MD RSCB2H
p 616.653.8429
f 616.653.2717

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Ron Thomas
Sent: Thursday, May 11, 2017 9:37 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: rename datasets

Thanks John . I am new to Rexx , but just wanted to know how in the below code, we make sure that only what is in my input file is read and renamed and not all the datasets under the SLXR5V.SAPDB.* ?

/* REXX */
XX=OUTTRAP('DATA.','*')
LISTC LVL('SLXR5V.SAPDB​')
XX=OUTTRAP("OFF")
DO I=1 TO DATA.0
LINE=DATA.I
IF 'NONVSAM' <> WORD(LINE,1) THEN ITERATE /* ONLY WORKS FOR NON-VSAM */
DSN=WORD(LINE,3) /* GET THE DSN */
SUFFIX=SUBSTR(DSN,12) /* STRIP OFF THE FRONT */
NEWDSN='SLXR5V.SAPDB.X'||SUFFIX
"ALTER '"DSN"' NEWNAME('"NEWDSN"')"
END

Thanks
Ron T

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN


This e-mail transmission contains information that is confidential and may be privileged. It is intended only for the addressee(s) named above. If you receive this e-mail in error, please do not read, copy or disseminate it in any manner. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of this information is prohibited. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please erase it from your computer system. Your assistance in correcting this error is appreciated.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Scott Barry
2017-05-11 13:39:51 UTC
Reply
Permalink
Raw Message
Post by Ron Thomas
Also, all of the files that need to renamed is there in a file . We want only those in the file to be renamed .
Thanks
Ron T
Any datasets on tape or all DASD (any with more than 17 character tape dataset name?) TMC consideration possibly depending on the tape management subsystem (i.e., CA-1 has a utility but last 17 characters are recorded in the TMC)? Otherwise depending on security/authority, IDCAMS ALTER should likely satisfy.

Scott Barry
SBBWorks, Inc. http://sbbworks.com/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Ron Thomas
2017-05-11 14:22:44 UTC
Reply
Permalink
Raw Message
Thanks a lot john . it worked .

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2017-05-11 16:34:43 UTC
Reply
Permalink
Raw Message
Post by Scott Barry
Any datasets on tape or all DASD (any with more than 17 character tape dataset name?) TMC consideration possibly depending on the tape management subsystem (i.e., CA-1 has a utility but last 17 characters are recorded in the TMC)? Otherwise depending on security/authority, IDCAMS ALTER should likely satisfy.
So renaming a tape data set might involve updating the HDR1 label?

Let's not go there. Or not attempt a rename to alter those last 17 characters.

I'd expect TMC to record the entire 44 characters so it could deal with
DSNs identical in the last 17 but with different prefixes.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Lizette Koehler
2017-05-12 07:05:34 UTC
Reply
Permalink
Raw Message
The TMC has two fields.

Full tape dataset name

And a second field that contains the last 17 characters.

Lizette
Post by Allan Staller
-----Original Message-----
Behalf Of Paul Gilmartin
Sent: Thursday, May 11, 2017 9:36 AM
Subject: Re: rename datasets
Post by Scott Barry
Any datasets on tape or all DASD (any with more than 17 character tape
dataset name?) TMC consideration possibly depending on the tape management
subsystem (i.e., CA-1 has a utility but last 17 characters are recorded in
the TMC)? Otherwise depending on security/authority, IDCAMS ALTER should
likely satisfy.
So renaming a tape data set might involve updating the HDR1 label?
Let's not go there. Or not attempt a rename to alter those last 17 characters.
I'd expect TMC to record the entire 44 characters so it could deal with DSNs
identical in the last 17 but with different prefixes.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Loading...