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


> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On
> Behalf Of Ron Thomas
> Sent: Thursday, May 11, 2017 6: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

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to