Mainframe Utility: RENAMEME

Return to Mainframe Utilities Page

Module


/********************************************************************/
/*    RENAMEME                                                      */
/*                                                                  */
/* PURPOSE:  THIS EDIT MACRO WILL ALLOW A MEMBER IN A PDS TO BE     */
/*           RENAMED WHILE EDITING.  THE MEMBER WILL BE COPIED      */
/*           INTO THE NEW MEMBER AND THE ORIGINAL MEMBER WILL BE    */
/*           DELETED.  WHEN EXECUTING THIS MACRO THE NEW NAME FOR   */
/*           THE PDS MEMBER MUST BE SUPPLIED.  THIS MACRO WILL CALL */
/*           ANOTHER MACRO (RENAMCPY) WHICH DOES THE COPY AND EDIT  */
/*           OF THE NEW PDS MEMBER.                                 */
/*                                                                  */
/*      CREATED BY JEFF JONES 10/31/89 - SEATTLE SE CENTER          */
/*                                                                  */
/*           C H A N G E        L O G                               */
/*      PROJECT     DATE        ID             COMMENTS             */
/*                                                                  */
/********************************************************************/
ISREDIT MACRO (NEWNAM)
/**** SET MESSAGE DISPLAY ON/OFF BASED ON THE DEBUG SWITCH ***/
ISPEXEC VGET (DBGSWTCH) PROFILE
IF &DBGSWTCH = &STR(ON) THEN CONTROL MSG LIST CONLIST SYMLIST NOFLUSH
ELSE CONTROL NOSYMLIST NOCONLIST NOMSG NOLIST NOFLUSH

ISREDIT (EDITDSN) = DATASET
ISREDIT (EDITMBR) = MEMBER
SET &EDITDSN = &NRSTR(&EDITDSN)
SET &EDITMBR = &NRSTR(&EDITMBR)

SET &WKFILE = &NRSTR(&EDITDSN(&EDITMBR))

SET &NEWMEM = &NEWNAM

SET &MBRLEN = &LENGTH(&STR(&NEWMEM))
IF &MBRLEN = 0 THEN +
    DO
      SET ZEDSMSG = &STR(NO MEMBER NAME ENTERED)
      ISPEXEC SETMSG MSG(UTLZ000)
      GOTO SKIPEDIT
    END
IF &NEWMEM = &STR(HELP) THEN +
  GOTO HELPSEC

SET &DSNMBR = &STR('&EDITDSN(&NEWMEM)')

IF &SYSDSN(&DSNMBR) = OK THEN DO
   SET ZEDSMSG = &STR("&NEWMEM" ALREADY EXISTS)
   SET ZEDLMSG = &STR(CANNOT CREATE "&NEWMEM". IT ALREADY EXISTS.)
   ISPEXEC SETMSG MSG(UTLZ000)
   EXIT
END

ISPEXEC VPUT (EDITMBR) PROFILE
ISPEXEC EDIT DATASET(&DSNMBR) MACRO(RENAMCPY)
ISPEXEC VGET (RETNCD) PROFILE
IF &RETNCD ¬= &STR(Y) THEN +
 GOTO SKIPEDIT

DELETE '&WKFILE'
ISREDIT CANCEL
EXIT
SKIPEDIT: +
EXIT
HELPSEC: +
WRITE
WRITE        *** HELP FOR EDIT MACRO 'RENAMEME' ***
WRITE
WRITE THE RENAMEME MACRO WILL ENABLE A USER WHO IS EDITING A
WRITE MEMBER IN A PDS LIBRARY TO RENAME THE MEMBER BY TYPING
WRITE A COMMAND ON THE COMMAND LINE.  THE COMMAND IS
WRITE "RENAMEME" AND SHOULD ALWAYS BE FOLLOWED BY A NEW
WRITE NAME. FOR EXAMPLE:
WRITE
WRITE    COMMAND ===> RENAMEME OLDCPDR01
WRITE
WRITE THE MACRO WILL CREATE A NEW MEMBER IN THE PDS AND WILL
WRITE SAVE AND EDIT IT.  AFTER THE EDIT SESSION IS ENDED,
WRITE THE ORIGINAL PDS MEMBER WILL BE DELETED.
WRITE
WRITE AN ERROR MESSAGE WILL BE DISPLAYED IF THERE IS NO
WRITE NEW NAME ENTERED.  IF THE NEW PDS MEMBER EXISTS
WRITE ALREADY, ANOTHER ERROR MESSAGE WILL BE DISPLAYED.
WRITE
WRITE IF THE NEW NAME IS WRONG, EXIT AND EDIT THE WRONG
WRITE PDS MEMBER AND JUST RENAME IT AGAIN.
WRITE
WRITE       *** END OF HELP *** NO PROCESSING PERFORMED ***


EXIT
            


Documentation


 This utility allow you to rename the PDS member that you are currently
 editing without having to go to ISPF option 3.1.  Just type RENAMEME
 newname on the command line and press ENTER.  The member will then be
 copied into the new member and the old member will be deleted.  You will
 be taken into an edit of the new member.  This will also do a SAVE of
 the new member.
            


Leave a Reply

Your email address will not be published. Required fields are marked *