Mainframe Utility: MOVEX

Return to Mainframe Utilities Page

Module


ISREDIT MACRO NOPROCESS (HELP)
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
/******************************************************************/
/* 'MOVEX' EDIT MACRO. MOVE 'EXCLUDED' LINES AFTER OR BEFORE OTHER*/
/* LINES.                                                         */
/* AUTHOR : DAVID LEIGH    DATE : 11-7-89                         */
/******************************************************************/

IF &STR(&HELP) = &STR(HELP) THEN GOTO HELPSEC

ISREDIT (CURRDSN) = DATASET
LISTDSI '&CURRDSN'
IF &SYSINDEX(&STR(PO),&STR(&SYSDSORG)) = 0 THEN +
    DO
        SET ZEDLMSG = &STR(THIS DATASET MUST BE A PDS TO EXECUTE THIS +
                           UTILITY)
        ISPEXEC SETMSG MSG(UTLZ001)
        EXIT
    END

ISREDIT PROCESS RANGE A B
IF &LASTCC = 4 THEN +
    DO
        SET ZEDLMSG = &STR(LINE COMMAND 'A' OR 'B' MUST BE SPECIFIED)
        ISPEXEC SETMSG MSG(UTLZ001)
        EXIT
    END
ISREDIT (LINECMD) = RANGE_CMD

DELETE '&CURRDSN($&SYSUID)'
FREE DDNAME(TEMPFREE)
ALLOC DDNAME(TEMPFREE) +
      DSN('&CURRDSN($&SYSUID)') +
      SHR KEEP
OPENFILE TEMPFREE OUTPUT

ISREDIT LABEL .ZCSR = .LABELA
ISREDIT CURSOR = 1 1
SET SAVECC = 0
ISREDIT FIND FIRST P'=' 1 X
SET SAVECC = &LASTCC

DO WHILE &SAVECC = 0
    ISREDIT (TEMPFREE) = LINE .ZCSR
    PUTFILE TEMPFREE
    ISREDIT DELETE .ZCSR
    ISREDIT FIND NEXT P'=' 1 X
    SET SAVECC = &LASTCC
END
CLOSFILE TEMPFREE
FREE DDNAME(TEMPFREE)

IF &LINECMD = A THEN ISREDIT COPY $&SYSUID AFTER .ZFRANGE
ELSE ISREDIT COPY $&SYSUID BEFORE .ZLRANGE
ISREDIT CURSOR = .LABELA
ISREDIT RESET

EXIT

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


Documentation


 This utility allows you to EXCLUDE several lines (seperate, contigous, or both)
 and have those lines moved before or after another line.  Simply EXCLUDE
 whatever lines you want to have moved, place an A or B on the line that you
 want the exlcuded lines moved AFTER or BEFORE, type MOVEX on the command line
 and press ENTER.
            


Leave a Reply

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