Mainframe Utility: JCLCHECK

Return to Mainframe Utilities Page

Module


/**********************************************************************
/* UTILITY:  JCLCHECK                                                 *
/* AUTHOR:  DAVID LEIGH                                               *
/* FUNCTION:  THIS ISPF DIALOG PROVIDES A FACILITY TO INVOKE CONRAD'S *
/*            JCLCHECK PROC FOR A LARGE NUMBER OF MEMBERS.            *
/**********************************************************************
PROC 0 HELP
CONTROL NOMSG NOLIST NOFLUSH NOPROMPT
/**********************************************************************
/* CONTROL CLIST/EDIT MODE PROCESSING                                 *
/**********************************************************************
ERROR DO
          SET MODE = CLIST
          RETURN
      END
ISREDIT MACRO (OPT1 OPT2)
ERROR OFF

/*** CHECK THE DEBUG SWITCH ***/
ISPEXEC VGET DBGSWTCH PROFILE
IF &DBGSWTCH = ON THEN +
    CONTROL MSG LIST CONLIST SYMLIST NOFLUSH NOPROMPT ASIS
ELSE +
    CONTROL NOMSG NOLIST NOFLUSH NOPROMPT ASIS

IF &MODE ¬= CLIST THEN +
    DO
        ISREDIT (LN,CL) = CURSOR
        ISREDIT (JCLMBR) = MEMBER
        ISREDIT (JCLLIB) = DATASET
    END

/**********************************************************************
/* FIND OUT THE CURRENT VALID PRINT CONFIGURATIONS                    *
/**********************************************************************
SET ALLCONF = &STR( )
ISPEXEC TBOPEN PRINTIT NOWRITE
IF &LASTCC = 0 THEN +
    DO
        ISPEXEC TBSKIP PRINTIT
        DO WHILE &LASTCC = 0
            SET ALLCONF = &STR(&ALLCONF&PTCONNAM )
            ISPEXEC TBSKIP PRINTIT
        END
        ISPEXEC TBEND PRINTIT
    END

/**********************************************************************
/* DISPLAY OR REDISPLAY THE PANEL                                     *
/**********************************************************************
REDISPLAY: +
ISPEXEC DISPLAY PANEL(JCLCHECK)
SET PANELCC = &LASTCC
IF &PANELCC = 8 THEN EXIT
IF &PANELCC > 8 THEN +
    DO
        SET ZEDLMSG = &STR(*** PROBABLE SERIOUS PROBLEM WITH ISPF +
                           PANEL "JCLCHECK".  DISPLAY CC: &PANELCC +
                            ***)
        ISPEXEC SETMSG MSG(UTLZ001)
        EXIT CODE(&PANELCC)
    END

/**********************************************************************
/* HANDLE MEMBER GROUP HELP FIRST                                     *
/**********************************************************************
IF &STR(&JCLMBR) = &STR(?) THEN +
    DO
        SET JCLMBR =
        ISPEXEC SELECT PGM(ISPTUTOR) PARM(UTILH107)
        GOTO REDISPLAY
    END

/**********************************************************************
/* DEAL WITH PRINT CONFIGURATIONS                                     *
/**********************************************************************
IF &STR(&JCLPCONF) >     AND +
   &SYSINDEX(&STR( &JCLPCONF ),&STR(&ALLCONF)) = 0 THEN +
    DO
        IF &STR(&JCLPCONF) ¬= &STR(?) THEN +
            DO
                SET ZEDLMSG = &STR(*** "&JCLPCONF" IS NOT A VALID +
                                   PRINT CONFIGURATION ***)
                ISPEXEC SETMSG MSG(UTLZ001)
            END
        SET JCLPCONF =
        ISPEXEC TBOPEN PRINTIT NOWRITE
        ISPEXEC TBDISPL PRINTIT PANEL(JCLCHEK2)
        IF &LASTCC < 8 THEN +
            IF &ZTDSELS ¬= &STR(0000) THEN +
                SET JCLPCONF = &STR(&PTCONNAM)
        SET JCLSEL =
        ISPEXEC TBEND PRINTIT
        GOTO REDISPLAY
    END

/**********************************************************************
/* GENERATE THE JCL AND LET THE USER KNOW THAT'S WHAT YOU'RE DOING.   *
/**********************************************************************
SET ZEDLMSG = &STR(*** CREATING THE JCLCHECK JCL ***)
ISPEXEC CONTROL DISPLAY LOCK
ISPEXEC DISPLAY MSG(UTLZ000W)
CALL 'SYS2.USC1.LINKLIB(USERINFO)' '&SYSUID '
SET JSCOUNT = 51
SET JOBNBR = 0

ISPEXEC TBCREATE TEMPSTEP NOWRITE REPLACE KEYS() NAMES(JOBNBR STEPNAME)

IF &SYSDSN('&STR(&JCLLIB(&JCLMBR))') = &STR(OK) THEN +
    DO
        SET STEPNAME = &STR(&JCLMBR)
        SET JSCOUNT = 1
        SET JOBNBR  = 1
        ISPEXEC TBADD TEMPSTEP
        GOTO CREATE
    END

SET SYSOUTTRAP = 5000
PDS '&JCLLIB' MEMBERS &STR(&JCLMBR)
SET LNS = &SYSOUTLINE - 1
SET SYSOUTTRAP = 0

DO &I = 1 TO &LNS
    SET SYSDVAL = &STR(&SYSNSUB(2,&&SYSOUTLINE&I))
    IF &I = 1 THEN +
        READDVAL MEMBERS ARE MEM1 MEM2 MEM3 MEM4 MEM5 +
                 MEM6 MEM7 MEM8 MEM9 MEM10 +
                 MEM11 MEM12 MEM13 MEM14 MEM15
    ELSE +
        READDVAL MEM1 MEM2 MEM3 MEM4 MEM5 +
                 MEM6 MEM7 MEM8 MEM9 MEM10 +
                 MEM11 MEM12 MEM13 MEM14 MEM15
    DO &X = 1 TO 15
        SET STEPNAME = &STR(&SYSNSUB(2,&&MEM&X)
        IF &STR(&STEPNAME) >    THEN +
            DO
                SET JSCOUNT = &JSCOUNT + 1
                IF &JSCOUNT > 50 THEN +
                    DO
                        SET JSCOUNT = 1
                        SET JOBNBR = &JOBNBR + 1
                    END
                ISPEXEC TBADD TEMPSTEP
            END
    END
END

CREATE: +
SET ALLJOBS = &JOBNBR
IF &JOBNBR < 1 THEN +
    DO
        SET ZEDLMSG = &STR(*** NO MEMBERS FOUND MATCHING "&JCLMBR" ***)
        ISPEXEC SETMSG MSG(UTLZ001W)
        GOTO REDISPLAY
    END

IF &JCLREVEW = &STR(Y) THEN +
    DO
        SET TEMPJCL = &STR(&SYSUID..TEMP.JCLCHECK.JCL)
        DELETE '&TEMPJCL'
        FREE DDNAME(ISPFILE)
        ALLOCATE DDNAME(ISPFILE) DSN('&TEMPJCL') +
                 NEW CATALOG +
                 UNIT(SYSDA) VOLUME(WRK$$$) +
                 SPACE(1,1) TRACKS RELEASE +
                 RECFM(F B) LRECL(80) BLKSIZE(23440) DSORG(PS)
        ISPEXEC FTOPEN
        ISPEXEC FTINCL JCLCHECK
        SET SAVECC = &LASTCC
        ISPEXEC FTCLOSE
        FREE DDNAME(ISPFILE)
        IF &SAVECC > 0 THEN +
            DO
                ISPEXEC VGET ZERRLM
                SET ZEDSMSG = &STR(JCL CREATION ERROR)
                SET ZEDLMSG = &STR(&ZERRLM)
                ISPEXEC SETMSG MSG(UTLZ001)
            END
        ELSE +
            DO
                SET ZEDLMSG = &STR(*** NOTE:  YOU MUST SUBMIT THIS +
                                   JCL YOURSELF ***)
                ISPEXEC SETMSG MSG(UTLZ000W)
                ISPEXEC EDIT DATASET('&TEMPJCL')
            END
    END
ELSE +
    DO
        ISPEXEC FTOPEN TEMP
        ISPEXEC FTINCL JCLCHECK
        SET SAVECC = &LASTCC
        ISPEXEC FTCLOSE
        IF &SAVECC > 0 THEN +
            DO
                ISPEXEC VGET ZERRLM
                SET ZEDSMSG = &STR(JCL CREATION ERROR)
                SET ZEDLMSG = &STR(&ZERRLM)
                ISPEXEC SETMSG MSG(UTLZ001)
            END
        ELSE +
            DO
                ISPEXEC VGET ZTEMPF
                SUBMIT '&ZTEMPF'
                SET ZEDSMSG = &STR(JOB SUBMITTED)
                SET ZEDLMSG = &STR(*** THE CREATED JCL WAS SUBMITTED +
                                   ***)
                ISPEXEC SETMSG MSG(UTLZ000)
            END
    END

IF &MODE ¬= CLIST THEN ISREDIT CURSOR = &LN &CL
ELSE GOTO REDISPLAY

EXIT
/**********************************************************************
/* DISPLAY ANY "HELP" WHICH IS AVAILABLE FOR THIS UTILITY             *
/**********************************************************************
HELPSEC: +
ISPEXEC SELECT PGM(ISPTUTOR) PARM(HELPSHEL)
SET ZEDLMSG = &STR(*** HELP DISPLAYED FOR JCLCHECK UTILITY +
                   *** NO PROCESSING PERFORMED ***)
ISPEXEC SETMSG MSG(UTLZ000)
EXIT
            


Documentation


 The ISPF dialog JCLCHECK will automatically create JCL which invokes Conrad
 Brehm's JCLCHECK facility to QA JCL going into production.  It uses the PDS
 utility's member grouping facility to allow for processing many members at one
 time.

 You can invoke JCLCHEK as an EDIT MACRO by typing JCLCHECK and pressing ENTER
 when you are editing a JCL member.  You can also invoke JCLCHECK as a normal
 CLIST by typing TSO JCLCHECK on any ISPF command line.  In both situations you
 are presented with a panel where you can enter the appropriate information.
 The created JCL can be submitted automatically, or you can opt to edit the JCL
 after it's created and you can submit it manually yourself.
            


Leave a Reply

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