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 > -----Original Message----- > From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On > Behalf Of Lizette Koehler > Sent: Thursday, May 11, 2017 6:53 AM > To: IBM-MAIN@LISTSERV.UA.EDU > 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 > > > > -----Original Message----- > > From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] > > On Behalf Of Ron Thomas > > Sent: Thursday, May 11, 2017 6:37 AM > > To: IBM-MAIN@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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, send email to > lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN