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
[email protected]
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:[email protected]] On Behalf 
Of Ron Thomas
Sent: Thursday, May 11, 2017 9:37 AM
To: [email protected]
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 
[email protected] 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 [email protected] with the message: INFO IBM-MAIN

Reply via email to