Mainframe Utility: BINDCARD

Return to Mainframe Utilities Page

Module


/**********************************************************************
/* UTILITY: BINDCARD                                                  *
/* AUTHOR: DAVID LEIGH                                                *
/* FUNCTION: THIS UTILITY GENERATES BIND PLAN CARDS AND ENDEVOR SCL   *
/*           FROM REQUESTS ENTERED ON A PANEL BY PROGRAMMERS.  THESE  *
/*           BIND CARDS ARE THEN ENTERED INTO ENDEVOR BY THE DBA'S    *
/*           USING THE ENDEVOR SCL WHICH IS ALSO GENERATED.           *
/**********************************************************************
PROC 0 TEMPJCL('&SYSUID..TEMP.BINDCARD.JCL') +
       TEMPFILE(&SYSUID..TEMP.ENDEVOR) +
       ENVIRON(QUAL) +
       STAGE(D) +
       TYPE(BINDBTCH) +
       SYSTEM(STR) +
       SUBSYS(UNIPAC) +
       OWNER(BINDADM) +
       VALIDATE(BIND) +
       RETAIN(RETAIN) +
       NUMAPPL(15) +
       SENDDEST('D@UDAL D@UJEF D@ULJS') +
       HELP

/**********************************************************************
/* MISCELLANEOUS INITIALIZATION                                       *
/**********************************************************************
ISPEXEC CONTROL ERRORS RETURN
ISPEXEC VGET DBGSWTCH PROFILE                                                 02
IF &DBGSWTCH = ON THEN +                                                      02
    CONTROL MSG LIST CONLIST SYMLIST NOFLUSH PROMPT ASIS                00000702
ELSE +                                                                        02
    CONTROL NOMSG NOLIST NOFLUSH PROMPT ASIS                            00000902

IF &HELP = HELP THEN GOTO HELPSEC
                                                                              02
/**********************************************************************
/* GET THE USER'S FULL NAME                                           *
/**********************************************************************
SET SYSOUTTRAP = 1000
ACF
LIST *
END
SET SYSOUTTRAP = 0
SET SYSDVAL = &STR(&SYSNSUB(1,&SYSOUTLINE1))
READDVAL A B NAME1 NAME2 NAME3 NAME4 NAME5
SET FULLNAME = &STR(&NAME1 &NAME2 &NAME3 &NAME4 &NAME5)
                                                                              02
/**********************************************************************
/* ESTABLISH SOME PROCESSING VARIABLES                                *
/**********************************************************************
CALL 'SYS2.USC1.LINKLIB(USERINFO)' '&SYSUID   '
ISPEXEC VPUT NUMAPPL SHARED
SET EXITCC = 0
SET LP = &STR((
SET RP = &STR()

/**********************************************************************
/* DISPLAY THE PANEL                                                  *
/**********************************************************************
REDISPLAY: +
SET GENERATE =
ISPEXEC DISPLAY PANEL(BINDCARD)
IF &LASTCC > 7 THEN +
    DO
        IF &STR(&GENERATE) = Y THEN +
            DO
                SET ZEDSMSG =
                SET ZEDLMSG = &STR(*** SET GENERATE TO "N" BEFORE +
                                   QUITTING OR PRESS  TO +
                                   GENERATE ***)
                ISPEXEC SETMSG MSG(UTLZ001)
                GOTO REDISPLAY
            END
        GOTO FINISH

    END
ELSE +
    SELECT
/**********************************************************************/
/* PRESENT A LIST OF ELEMENTS OF THIS TYPE TO CHOOSE FROM             */
/**********************************************************************/
        WHEN (&STR(&APP0) = &STR(?)) DO
            ISPEXEC EDIT DATASET('&SYSUID..ISPF.ISPPROF(CTLIPROF)') +
                    MACRO(APPLCHKM)
            IF &LASTCC = 14 THEN +
                DO
                    SET ZEDSMSG =
                    SET ZEDLMSG = &STR(*** CANNOT CONTINUE UNTIL YOU +
                                       ARE OUT OF ENDEVOR ***)
                    ISPEXEC SETMSG MSG(UTLZ001)
                END
            ELSE +
                DO
                    ISPEXEC SELECT CMD(%BINDGET +
                                 &STR(&ENVIRON) +
                                 &STR(&STAGE) +
                                 &STR(&TYPE) +
                                 &STR(&SYSTEM) +
                                 &STR(&SUBSYS))
                    ISPEXEC VGET APP0 SHARED
                END
            GOTO REDISPLAY
        END
/**********************************************************************/
/* NOTHING TO DO NOW                                                  */
/**********************************************************************/
        WHEN (&GENERATE = N AND &ACTION = ADD) GOTO REDISPLAY
/**********************************************************************/
/* GET A LIST OF CALLED APPLICATIONS FOR THIS APPLICATION             */
/**********************************************************************/
        WHEN (&GENERATE = N AND &ACTION ¬= ADD) DO
/*GOTO FIX_NDVRC1
            ISPEXEC EDIT DATASET('&SYSUID..ISPF.ISPPROF(CTLIPROF)') +
                    MACRO(APPLCHKM)
            IF &LASTCC = 14 THEN +
                DO
                    SET ZEDSMSG =
                    SET ZEDLMSG = &STR(*** CANNOT CONTINUE UNTIL YOU +
                                       ARE OUT OF ENDEVOR ***)
                    ISPEXEC SETMSG MSG(UTLZ001)
                    GOTO REDISPLAY
                END
            SET ZEDSMSG =
            SET ZEDLMSG = &STR(*** PREPARING TO CALL +
            ENDEVOR TO FIND "&APP0" ***)
            ISPEXEC CONTROL DISPLAY LOCK
            ISPEXEC DISPLAY MSG(UTLZ000)
            FREE DDNAME(SYSPRINT C1MSGS1 C1PRINT PRINTDD BSTIPT01)
            ALLOC DD(SYSPRINT) DUMMY
            IF &DBGSWTCH = ON THEN +                                      02
                ALLOC DD(C1MSGS1)  DA(*)
            ELSE +
                ALLOC DD(C1MSGS1)  DUMMY
            ALLOC DD(C1PRINT)  DUMMY
            DELETE '&TEMPFILE'
            ALLOC DD(PRINTDD) +
                  DSN('&TEMPFILE') +
                  NEW CATALOG +
                  UNIT(SYSDA) VOLUME(WRK$$$) +
                  SPACE(1,1) CYLINDERS RELEASE +
                  RECFM(F B) LRECL(133) BLKSIZE(23408) DSORG(PS)
            ALLOC DD(BSTIPT01) +
                  NEW CATALOG +
                  UNIT(SYSDA) +
                  SPACE(1,1) TRACKS RELEASE +
                  RECFM(F B) LRECL(80) BLKSIZE(23440) DSORG(PS)

            OPENFILE BSTIPT01  OUTPUT
            SET BSTIPT01  = &STR(PRINT ELEMENT '&APP0' )
            PUTFILE BSTIPT01
            SET BSTIPT01  = &STR(FROM    ENVIRONMENT '&ENVIRON' )
            PUTFILE BSTIPT01
            SET BSTIPT01  = &STR(        STAGE       '&STAGE' )
            PUTFILE BSTIPT01
            SET BSTIPT01  = &STR(        SYSTEM      '&SYSTEM' )
            PUTFILE BSTIPT01
            SET BSTIPT01  = &STR(        SUBSYSTEM   '&SUBSYS' )
            PUTFILE BSTIPT01
            SET BSTIPT01  = &STR(        TYPE        '&TYPE')
            PUTFILE BSTIPT01
            SET BSTIPT01  = &STR(  TO    FILE        'PRINTDD' )
            PUTFILE BSTIPT01
            SET BSTIPT01  = &STR(OPTIONS SEARCH )
            PUTFILE BSTIPT01
            SET BSTIPT01  = &STR(. )
            PUTFILE BSTIPT01
            CLOSFILE BSTIPT01

            SET ZEDSMSG =
            SET ZEDLMSG = &STR(*** EXTRACTING "&APP0" +
                               FROM ENDEVOR ***)
            ISPEXEC CONTROL DISPLAY LOCK
            ISPEXEC DISPLAY MSG(UTLZ000)
            ISPEXEC SELECT PGM(NDVRC1) PARM(C1BM3000)
            SET NDVRCC = &LASTCC
            FREE DDNAME(SYSPRINT C1MSGS1 C1PRINT PRINTDD BSTIPT01)
            ISPEXEC EDIT DATASET('&TEMPFILE') MACRO(BINDCRDM)
            ISPEXEC VGET VARS SHARED
            ISPEXEC VGET (&STR(&VARS)) SHARED
            IF &EDITCC < 8 THEN +
                DO
                    SET ZEDSMSG =
                    SET ZEDLMSG = &STR(*** VALUES FOR "&APP0" +
                                       WERE SUCCESSFULLY EXTRACTED +
                                       FROM ENDEVOR ***)
                    ISPEXEC SETMSG MSG(UTLZ000)
                END
            ELSE +
                DO
                    SET ZEDSMSG =
                    SET ZEDLMSG = &STR(*** NO BIND CARDS FOR "&APP0" +
                                       FOUND IN ENDEVOR ***)
                    ISPEXEC SETMSG MSG(UTLZ001)
                END
            GOTO REDISPLAY
        END
    END

/**********************************************************************
/* LOAD A TEMPORARY TABLE WITH ALL THE APPLICATIONS                   *
/**********************************************************************
SET ZEDSMSG =
SET ZEDLMSG = &STR(*** GENERATING JCL TO UPDATE ENDEVOR ***)
ISPEXEC CONTROL DISPLAY LOCK
ISPEXEC DISPLAY MSG(UTLZ000)

ISPEXEC TBCREATE TEMPTABL NOWRITE REPLACE KEYS(APPLICAT)

IF &STR(&DB2) = Y THEN +
    DO
        SET APPLICAT = &STR(&APP0)
        ISPEXEC TBADD TEMPTABL
    END

/**********************************************************************/
/* LOAD UP THE TABLE WITH THE PACKAGE LIST.                           */
/*                                                                    */
/* 12/8/97 - GET RID OF OLD REFERENCES TO EP02A, EP03A AND SC50A      */
/**********************************************************************/
DO &I = 1 TO &NUMAPPL
    SET APPLICAT = &STR(&SYSNSUB(2,&&APP&I))
    IF &STR(&APPLICAT)  >             AND +
       &STR(&APPLICAT) ¬= &STR(EP02A) AND +
       &STR(&APPLICAT) ¬= &STR(EP03A) AND +
       &STR(&APPLICAT) ¬= &STR(SC50A) THEN
      ISPEXEC TBADD TEMPTABL
END

/**********************************************************************
/* THE FOLLOWING SECTION ADDS STANDARD APPLICATIONS WHICH MUST BE     *
/* PRESENT IN EVERY PLAN.  SINCE THE TABLE IS KEYED, IF THEY EXIST,   *
/* THEY WON'T BE ADDED TWICE, BUT IF THEY DON'T EXIST ALREADY, THEY   *
/* WILL BE ADDED.                                                     *
/**********************************************************************
SET APPLICAT = &STR(EPB0002)  /* ERROR PROCESSING APPLICATION */
ISPEXEC TBADD TEMPTABL

ISPEXEC TBTOP TEMPTABL
ISPEXEC TBQUERY TEMPTABL ROWNUM(ENDROW)

/**********************************************************************
/* USE FILE TAILORING TO CREATE THE JOB                               *
/**********************************************************************
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 BINDCARD
SET SAVECC = &LASTCC
ISPEXEC FTCLOSE
FREE DDNAME(ISPFILE)

IF &SAVECC > 0 THEN +
    DO
        SET ZEDSMSG = &STR(JCL CREATION ERROR)
        SET ZEDLMSG = &STR(ENDEVOR UPDATE JCL CREATION FAILED +
                           WITH RC:  &SAVECC)
        ISPEXEC SETMSG MSG(UTLZ001)
        IF &JCLREVEW = Y THEN ISPEXEC EDIT DATASET('&TEMPJCL')
    END
ELSE +
    DO
        IF &STR(&DEFAULTS) = N THEN +
            DO
                SEND '&STR("&FULLNAME" CREATED BATCH BIND PLAN +
                           REQUEST "&APP0" ON &SYSSDATE AT &SYSTIME)' +
                           USER(&SENDDEST) LOGON
                SEND '&STR(!!!!! NON-DEFAULT VALUE(S) USED !!!!!)' +
                           USER(&SENDDEST) LOGON
            END
        IF &JCLREVEW = Y THEN +
            DO
                SET ZEDSMSG =
                SET ZEDLMSG = &STR(*** YOU MUST SUBMIT THIS JOB +
                                   YOURSELF ***)
                ISPEXEC SETMSG MSG(UTLZ001)
                ISPEXEC EDIT DATASET('&TEMPJCL')
            END
        ELSE +
            DO
                SUBMIT '&TEMPJCL'
                SET ZEDSMSG = &STR(ENDEVOR JOB SUBMITTED)
                SET ZEDLMSG = &STR(ENDEVOR UPDATE JOB WAS CREATED +
                                   AND SUBMITTED)
                ISPEXEC SETMSG MSG(UTLZ000)
            END
    END

GOTO REDISPLAY

/**********************************************************************
/* CLEANUP AND GET OUT                                                *
/**********************************************************************
FINISH: +
EXIT

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


Documentation


 BINDCARD creates batch DB2 "bind plan" cards.  It "wraps" the cards in JCL for
 loading into ENDEVOR (it also generates the necessary ENDEVOR SCL to accomplish
 this).  The JCL is then submitted for backround processing with ENDEVOR.  It
 can take existing bind plan cards from ENDEVOR and update them with changes, or
 add a completely new set of bind plan cards into ENDEVOR.

 Syntax:

 COMMAND ===> tso bindcard

 When you invoke BINDCARD, you are presented with a screen.  On this screen, you
 may enter the name of the main program which "drives" this batch process.  You
 must enter this field.  The name of this application will be the name used to
 store the DB2 bind cards in ENDEVOR.

 You need to then indicate whether the main driving application uses DB2 or not.
 If so, it will be included in the package list associated with this plan, if
 not, the main application name will simply be used as the name of the plan.

 If this main application calls any other "non-common"/"client-specific"
 applications AND they use DB2, they should be listed (in any order) in one of
 the "Called" fields on the screen (currently there is room for 15 called
 applications).  Additionally, if a called module (DB2 or not) calls a program
 that does DB2, the DB2 module should be included in one of the "Called" fields.
 So, anywhere in the "calling hierarchy" that DB2 is used, that program name
 needs to be specified.  If an application is a called application for this
 driver program, but it does NOT use DB2, it should not be listed on this
 screen.

 Consequently, if the driver application does not use DB2 and none of its called
 applications use DB2, there is no need to request a DB2 batch plan bind for
 this application.  It is strictly for applications which use DB2 in SOME
 fashion.

 When you have finished entering the applications, you may choose to override
 the default DB2 plan parameter values.  In 99% of the cases, these defaults
 should NOT be overridden.  Any override needs should probably be discussed with
 the DBA team.

 Finally, you will need to enter an ENDEVOR CCID (Change Control Identifier) and
 an ENDEVOR comment.  These pieces of information are required in order to
 successfully load the bind cards into ENDEVOR.  They are not required on this
 panel until you actually change the GENERATE JCL flag from "N" to "Y".  Check
 with the ENDEVOR administrator to determine what CCID to use (typically this
 will be your PR number).  Use meaningful text to describe the nature of the
 change in the comment field.  The limit of the length of the comment field is a
 function of ENDEVOR limits

 If you are updating existing bind plan cards which are stored in ENDEVOR and
 you wish to start with the parameters of the existing bind plan cards, BINDCARD
 will extract the information from ENDEVOR and populate the screen for you.
 BINDCARD is triggered to perform this operation if it finds a "N" in the
 GENERATE JCL field.  If you press  when this field is set this way,
 BINDCARD will get the information for the BIND card element named the same as
 your "main" application.  It then parses this information and populates the
 screen with it.  You are then free to modify it in any way you wish.
1
 Alternatively, you may just replace whatever exists for an existing set of bind
 plan cards by setting the GENERATE JCL flag to "Y", entering your data and
 pressing .  In this case, BINDCARD will not attempt to extract the
 values of the bind plan cards to populate the screen.  It will just create the
 JCL from what you entered on the screen.

 BINDCARD will generate a step in the JCL to RETREIVE the element from ENDEVOR.
 This retreived version is thrown away, however, and what was on the screen is
 used to do the UPDATE back into ENDEVOR.  The RETRIEVE is only used to obtain
 SIGNOUT on the element.

 After you've generated, the GENERATE field returns the the value of "N", and
 you are ready to enter more data if necessary and generate another plan.  Your
 CCID and ENDEVOR comment are remembered during your ISPF session, so you can
 generate several plans under the same CCID if necessary.
            


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.