Mainframe Utility: DSNSTAMP

Return to Mainframe Utilities Page

Module


ISREDIT MACRO (OPT1)
ISPEXEC CONTROL ERRORS RETURN
/**** 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 NOMSG NOLIST NOFLUSH NOPROMPT
IF &OPT1 = HELP THEN GOTO HELPSEC
/**********************************************************************
/* EDIT MACRO : DSNSTAMP                                              *
/* AUTHOR : DAVE LEIGH                                                *
/* FUNCTION : REPLACE TEXT AT THE CURSOR LOCATION WITH THE NAME OF    *
/*            THE DATASET BEING EDITED.                               *
/**********************************************************************

ISREDIT (DSN) = DATASET
ISREDIT (MBR) = MEMBER
ISREDIT (LN,CL) = CURSOR

IF &STR(&MBR) >    THEN +
    SET DSN = &STR(&DSN(&MBR))

DO &I = 1 TO &LENGTH(&STR(&DSN))
    SET EQUALS = &STR(&EQUALS=)
END

ISREDIT CHANGE P'&EQUALS' '&DSN' .ZCSR .ZCSR

IF &LASTCC > 0 THEN +
    DO
        SET ZEDLMSG = &STR(*** NOT ENOUGH ROOM TO STAMP "&DSN" ***)
        ISPEXEC SETMSG MSG(UTLZ001)
        EXIT
    END

ISREDIT CURSOR = &LN &CL

EXIT

HELPSEC: +
ISPEXEC SELECT PGM(ISPTUTOR) PARM(HELPSHEL)
SET ZEDLMSG = &STR(*** HELP DISPLAYED FOR DSNSTAMP UTILITY +
                   *** NO PROCESSING PERFORMED ***)
ISPEXEC SETMSG MSG(UTLZ000)
EXIT
            


Documentation


 DSNSTAMP is an edit macro which allows the user to "stamp" the name of the
 dataset being edited over any existing text.

 To execute DSNSTAMP, type "dsnstamp" on the command line, place your cursor
 where you want the dataset name to begin and press ENTER.
            


Leave a Reply

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