Mainframe Utility: VIEWJCL

Module


/**********************************************************************
/* UTILITY: VIEWJCL                                                   *
/* AUTHOR: DAVID LEIGH                                                *
/* FUNCTION: USE BYTES 4 THROUGH 8 OF THE MEMBER NAME PLUS THE USER'S *
/*           3 BYTE DATABASE PREFIX INPUT (DEFAULT USC) AND BRING UP  *
/*           A MEMBER LIST OF EXECUTE JCL MEMBERS.                    *
/**********************************************************************
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

SELECT (&STR(&OPT1))
    WHEN (HELP) GOTO HELPSEC
    WHEN (AEL) SET LIB = &STR(AEL60.PRD.CNTL)
    WHEN (AGS) SET LIB = &STR(AGS70.PRD.CNTL)
    WHEN (AHE) SET LIB = &STR(AHE54.PRD.CNTL)
    WHEN (AMS) SET LIB = &STR(AMS59.PRD.CNTL)
    WHEN (CSL) SET LIB = &STR(CSL52.PRD.CNTL)
    WHEN (DEM) SET LIB = &STR(DEM40.PRD.CNTL)
    WHEN (DEM) SET LIB = &STR(DEM41.PRD.CNTL)
    WHEN (DEM) SET LIB = &STR(DEM42.PRD.CNTL)
    WHEN (FAB) SET LIB = &STR(FAB57.PRD.CNTL)
    WHEN (GSS) SET LIB = &STR(GSS00.PRD.CNTL)
    WHEN (LIN) SET LIB = &STR(LIN51.PRD.CNTL)
    WHEN (MEL) SET LIB = &STR(MEL56.PRD.CNTL)
    WHEN (NHE) SET LIB = &STR(NHE53.PRD.CNTL)
    WHEN (NSL) SET LIB = &STR(NSL71.PRD.CNTL)
    WHEN (UHE) SET LIB = &STR(UHE72.PRD.CNTL)
    WHEN (USC) SET LIB = &STR(USC10.PRD.CNTL)
    WHEN (VSL) SET LIB = &STR(VSL55.PRD.CNTL)
    WHEN (WSL) SET LIB = &STR(WSL50.PRD.CNTL)
    WHEN (   ) DO
        SET OPT1 = USC
        SET LIB = &STR(USC10.PRD.CNTL)
    END
    OTHERWISE DO
        SET ZEDLMSG = &STR(*** "&OPT1" IS NOT A VALID DATABASE +
                           PREFIX ***)
        ISPEXEC SETMSG MSG(UTLZ001W)
        EXIT CODE(12)
    END
END

/**********************************************************************
/* USE "PDS" TO BRING UP THE DESIRED MEMBER LIST                      *
/**********************************************************************
ISREDIT (MEMBER) = MEMBER
SET OPT1 = &STR(&OPT1&SUBSTR(4:&LENGTH(&STR(&MEMBER)),&STR(&MEMBER)))
PDS '&LIB' MEMLIST &STR(&OPT1.*)

EXIT

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


Documentation


 VIEWJCL is an edit macro which, when executed from a COBOL program, wil00010000
 display a member list of production "execute" JCL for this program.    00020000
 That JCL may then be edited, browsed, etc.                             00030000
                                                                        00040000
 VIEWJCL extracts bytes 4 through 8 of the COBOL member name and then   00050000
 prefixes those bytes with a database prefix such as USC (the default if00060000
 none is specified) or LIN or WSL.  Then VIEWJCL goes to that database's00070000
 production JCL library and brings up a member list of all the members  00080000
 which begin with that character string.                                00090000
                                                                        00100000
 For example, if you are editing program SLS5035, you can type VIEWJCL o00110000
 the command line, press ENTER, and you will be displayed a member list 00120000
 in the USC10.PRD.CNTL library consisting of the members USC5035 and    00130000
 USC5035N.  If you had typed VIEWJCL LIN, you would get a member list in00140000
 the LIN51.PRD.CNTL library consisting of the members LIN5035 and       00150000
 LIN5035N.                                                              00160000
                                                                        00170000
 When you "END" out of looking at the JCL, you'll be back in your       00180000
 program.                                                               00190000
            


Leave a Reply

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