Mainframe Utility: COMBOX

Return to Mainframe Utilities Page

Module


ISREDIT MACRO NOPROCESS (TYPE,POSITION)
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 &TYPE = HELP THEN GOTO HELPSEC
/**********************************************************************
/* EDIT MACRO : COMBOX                                                *
/* AUTHOR : DAVE LEIGH                                                *
/* FUNCTION : CREATE COMMENT BOXES IN VARIOUS FORMATS.                *
/**********************************************************************

ISREDIT PROCESS DEST
SET DESTCC = &LASTCC
SELECT (&DESTCC)
    WHEN (8) DO
        SET ZEDSMSG = &STR("A" OR "B" REQUIRED)
        SET ZEDLMSG = &STR(AN "A" OR "B" LINE COMMAND IS REQUIRED +
                           FOR THE COMBOX UTILITY)
        ISPEXEC SETMSG MSG(UTLZ001)
        EXIT CODE(12)
    END
    WHEN (16) DO
        SET ZEDSMSG = &STR(INVALID LINE COMMAND)
        SET ZEDLMSG = &STR(LINE CMDS CAN'T CONFLICT OR SPECIFY +
                           "BEFORE" THE 1ST OR "AFTER" THE LAST +
                           LINE)
        ISPEXEC SETMSG MSG(UTLZ001)
        EXIT CODE(12)
    END
    WHEN (20) DO
        SET ZEDSMSG = &STR(SEVERE ERROR)
        SET ZEDLMSG = &STR(PROCESSING THE LINE COMMAND PRODUCED A +
                           SEVERE EDIT MACRO ERROR)
        ISPEXEC SETMSG MSG(UTLZ001)
        EXIT CODE(12)
    END
    OTHERWISE
END

ISREDIT (SLN,SCL) = CURSOR
ISREDIT (LINENUM) = LINENUM .ZDEST
SET LINECC = &LASTCC
ISREDIT LINE_AFTER .ZDEST = ' '
ISREDIT LINE_AFTER .ZDEST = ' '
ISREDIT LINE_AFTER .ZDEST = ' '
ISREDIT FIND FIRST P'=' .ZDEST .ZDEST
ISREDIT (LN,CL) = CURSOR
IF &LN > 1 OR &LINECC = 0 THEN ISREDIT FIND NEXT P'=' 1
ISREDIT LABEL .ZCSR = .BEGIN
ISREDIT FIND NEXT P'=' 1
ISREDIT FIND NEXT P'=' 1
ISREDIT LABEL .ZCSR = .END

IF &STR(&TYPE) = POSITION OR   +
   &STR(&TYPE) = POS      THEN +
    DO
        SET POSITION = POSITION
        SET TYPE =
        IF &SCL = 0 THEN SET SCL = 1
    END

IF &STR(&TYPE) =     THEN ISREDIT (TYPE,NULL) = PROFILE

SELECT &STR(&TYPE)
       WHEN (COBOL ¦ COBOL2 ¦ COB ¦ COBOLII ¦ SRCLIB)    GOTO COBSEC
       WHEN (CLIST ¦ PANEL ¦ ISPPLIB ¦ PANELS ¦ ISPCLIB) GOTO CLISEC
       WHEN (REXX)                                       GOTO CLISEC
       WHEN (IDCAMS ¦ AMS)                               GOTO AMSSEC
       WHEN (JCL ¦ CNTL ¦ JCLLIB ¦ PROCLIB)              GOTO JCLSEC
       WHEN (ADS ¦ ADSO)                                 GOTO ADSSEC
       WHEN (SKEL ¦ SKELETON ¦ ISPSLIB ¦ SKELS)          GOTO SKLSEC
       WHEN (ALC ¦ SORT ¦ SYNCSORT ¦ BAL ¦ ASSEMBLER)    GOTO ALCSEC
       WHEN (DYL ¦ ANSWER ¦ ASM ¦ MAPS ¦ DATA)           GOTO ALCSEC
       WHEN (SPUFI ¦ SQL ¦ SPUFILIB ¦ SQLLIB ¦ MIGRLIB)  GOTO SQLSEC
       OTHERWISE DO
           SET ZEDLMSG = &STR(*** VALID TYPES : +
                                                ADS +
                                                ADSO +
                                                ALC +
                                                AMS +
                                                ANSWER +
                                                ASM +
                                                ASSEMBLER +
                                                BAL +
                                                CLIST +
                                                CNTL +
                                                COB +
                                                COBOL +
                                                COBOLII +
                                                COBOL2 +
                                                DATA +
                                                DYL +
                                                IDCAMS +
                                                ISPCLIB +
                                                ISPPLIB +
                                                ISPSLIB +
                                                JCL +
                                                JCLLIB +
                                                MAPS +
                                                MIGRLIB +
                                                PANEL +
                                                PANELS +
                                                PROCLIB +
                                                REXX +
                                                SKEL +
                                                SKELETON +
                                                SKELS +
                                                SORT +
                                                SPUFI +
                                                SPUFILIB +
                                                SQL +
                                                SQLLIB +
                                                SRCLIB +
                                                SYNCSORT +
                              ***)
           ISPEXEC SETMSG MSG(UTLZ001W
           ISREDIT DELETE .BEGIN .END
           EXIT CODE(12)
       END
END

ALCSEC: +
ISREDIT CHANGE ALL P'=' '*' 1 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 71 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 1 71 .BEGIN .BEGIN
ISREDIT CHANGE ALL P'=' '*' 1 71 .END .END
GOTO FINAL

COBSEC: +
ISREDIT (USERSTAT) = USER_STATE
ISREDIT UNNUM
ISREDIT CHANGE ALL P'=' '*' 7 8 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 71 72 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 7 72 .BEGIN .BEGIN
ISREDIT CHANGE ALL P'=' '*' 7 72 .END .END
ISREDIT USER_STATE = (USERSTAT)
ISREDIT RIGHT DATA
ISREDIT LEFT  DATA
GOTO FINAL

AMSSEC: +
SET SLASHTERISK = &STR(/*)
ISREDIT CHANGE ALL P'=' '&SLASHTERISK' 2 .BEGIN .END
ISREDIT CHANGE ALL P'==' '*/' 71 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 3 71 .BEGIN .BEGIN
ISREDIT CHANGE ALL P'=' '*' 3 71 .END .END
GOTO FINAL

CLISEC: +
IF &STR(&POSITION) ¬= POSITION THEN SET SCL = 1
SET SLASHTERISK = &STR(/*)
ISREDIT CHANGE ALL P'=' '&SLASHTERISK' &SCL .BEGIN .END
ISREDIT CHANGE ALL P'==' '*/' 71 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' &EVAL(&SCL + 1) 71 .BEGIN .BEGIN
ISREDIT CHANGE ALL P'=' '*' &EVAL(&SCL + 1) 71 .END .END
GOTO FINAL

SKLSEC: +
SET RP = &STR())
SET COMASTERISK = &STR(&RP.CM *)
ISREDIT CHANGE ALL P'=' '&COMASTERISK' 1 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 71 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 5 71 .BEGIN .BEGIN
ISREDIT CHANGE ALL P'=' '*' 5 71 .END .END
GOTO FINAL

ADSSEC: +
SET EXCASTERISK = &STR(!*)
ISREDIT CHANGE ALL P'=' '&EXCASTERISK' 1 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 71 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 2 71 .BEGIN .BEGIN
ISREDIT CHANGE ALL P'=' '*' 2 71 .END .END
GOTO FINAL

JCLSEC: +
SET SLASHTERISK = &STR(//*)
ISREDIT CHANGE ALL P'=' '&SLASHTERISK' 1 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 71 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 3 71 .BEGIN .BEGIN
ISREDIT CHANGE ALL P'=' '*' 3 71 .END .END
GOTO FINAL

SQLSEC: +
SET DASHTERISK = &STR(--*)
ISREDIT CHANGE ALL P'=' '&DASHTERISK' 1 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 71 .BEGIN .END
ISREDIT CHANGE ALL P'=' '*' 3 71 .BEGIN .BEGIN
ISREDIT CHANGE ALL P'=' '*' 3 71 .END .END

FINAL: +
ISREDIT (LN,CL) = CURSOR
SET LN = &LN - 1
ISREDIT CURSOR = &LN 0
ISREDIT RESET LABEL .BEGIN .END
EXIT

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


Documentation

 This utility allows you to specify specify an "a" or "b" line command and then
 COMBOX languagetype on the command line, and a comment "flower box" of the
 appropriate type will be inserted in the code at the place of the "a" or "b"
 line command.  The valid language types are: CLIST, JCL, ALC, COBOL, SKELETON
 (ISPF skeletons).
 
 Syntax : combox jcl
 
 This example would draw a box after a "a" line command like:
 //***********************************************************************
 //*                                                                     *
 //***********************************************************************            


Leave a Reply

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