Mainframe Utility: DDCONCAT

Return to Mainframe Utilities Page

Module


/**********************************************************************
/* UTILITY: DDCONCAT                                                  *
/* AUTHOR: DAVID LEIGH                                                *
/* DATE: 11-26-90                                                     *
/* FUNCTION: RE-ALLOCATE THE SYSPROC AND ISPF DD'S AT TSO LOGON TO    *
/*           ADD TO THE CONCATENATION BEFORE OR AFTER THE CURRENT     *
/*           ALLOCATIONS                                              *
/**********************************************************************
PROC 0 BSYSPROC() ASYSPROC() +
       BSYSEXEC() ASYSEXEC() +
       BSYSHELP() ASYSHELP() +
       BISPPLIB() AISPPLIB() +
       BISPTLIB() AISPTLIB() +
       BISPSLIB() AISPSLIB() +
       BISPMLIB() AISPMLIB() +
       BISPLLIB() AISPLLIB() DEBUG HELP
IF &DEBUG = DEBUG THEN +
    CONTROL MSG LIST CONLIST SYMLIST NOFLUSH ASIS
ELSE +
    CONTROL NOMSG NOLIST NOFLUSH ASIS
IF &HELP = HELP THEN GOTO HELPSEC

/**********************************************************************
/* GATHER SYSTEM ALLOCATION INFORMATION FROM LISTALC STATUS           *
/**********************************************************************
SET SYSOUTTRAP = 500
LISTA ST
SET SYSOUTTRAP = 0

/**********************************************************************
/* SAVE IN OTHER VARS SINCE SOME TSO COMMANDS WIPE OUT SYSOUTLINE INFO*
/**********************************************************************
SET X = &SYSOUTLINE
DO &I = 1 TO &SYSOUTLINE
    SET LINE&I = &&SYSOUTLINE&I
END

/**********************************************************************
/* LOOP THROUGH THE VARIABLES AND PROCESS EACH DD AS IT COMES UP.     *
/**********************************************************************
SET I = &I - 1
DO &J = 1 TO &I
    SET LINE = &&LINE&J
    SET TEMPDD = &STR(&LINE)
    IF &SUBSTR(1:2,&STR(&TEMPDD)) >    THEN +
        DO
            IF &STR(&ALLDSN) >    THEN SET ALLDSN = &STR(&ALLDSN '&DSN')
                                  ELSE SET ALLDSN = &STR('&DSN')
            SET X = &SYSINDEX(&STR( ),&STR(&TEMPDD)) - 1
            IF &X < 1 THEN SET X = &LENGTH(&STR(&TEMPDD))
            IF &X > 0 THEN SET DSN = &SUBSTR(1:&X,&STR(&TEMPDD))
        END
    IF &SUBSTR(1:2,&STR(&TEMPDD)) =    AND +
       &SUBSTR(3:3,&STR(&TEMPDD)) >    THEN +
        DO
            SELECT
/**********************************************************************
/* SYSPROC REALLOCATION                                               *
/**********************************************************************
                WHEN (&CURRDD = SYSPROC AND +
                     (&STR(&BSYSPROC) >          OR +
                      &STR(&ASYSPROC) >         )) DO
                        FREE DDNAME(SYSPROC)
                        ALLOC DD(SYSPROC) +
                              DSN(&BSYSPROC +
                                  &ALLDSN +
                                  &ASYSPROC) SHR
                        WRITE *** SYSPROC ALLOCATION CC = &LASTCC ***
                    END
/**********************************************************************
/* SYSEXEC REALLOCATION                                               *
/**********************************************************************
                WHEN (&CURRDD = SYSEXEC AND +
                     (&STR(&BSYSEXEC) >          OR +
                      &STR(&ASYSEXEC) >         )) DO
                        FREE DDNAME(SYSEXEC)
                        ALLOC DD(SYSEXEC) +
                              DSN(&BSYSEXEC +
                                  &ALLDSN +
                                  &ASYSEXEC) SHR
                        WRITE *** SYSEXEC ALLOCATION CC = &LASTCC ***
                    END
/**********************************************************************
/* SYSHELP REALLOCATION                                               *
/**********************************************************************
                WHEN (&CURRDD = SYSHELP AND +
                     (&STR(&BSYSHELP) >          OR +
                      &STR(&ASYSHELP) >         )) DO
                        FREE DDNAME(SYSHELP)
                        ALLOC DD(SYSHELP) +
                              DSN(&BSYSHELP +
                                  &ALLDSN +
                                  &ASYSHELP) SHR
                        WRITE *** SYSHELP ALLOCATION CC = &LASTCC ***
                    END
/**********************************************************************
/* ISPPLIB REALLOCATION                                               *
/**********************************************************************
                WHEN (&CURRDD = ISPPLIB AND +
                     (&STR(&BISPPLIB) >          OR +
                      &STR(&AISPPLIB) >         )) DO
                        FREE DDNAME(&CURRDD)
                        ALLOC DD(&CURRDD) +
                              DSN(&BISPPLIB +
                                  &ALLDSN +
                                  &AISPPLIB) SHR
                        WRITE *** &CURRDD ALLOCATION CC = &LASTCC ***
                    END
/**********************************************************************
/* ISPTLIB REALLOCATION                                               *
/**********************************************************************
                WHEN (&CURRDD = ISPTLIB AND +
                     (&STR(&BISPTLIB) >          OR +
                      &STR(&AISPTLIB) >         )) DO
                        FREE DDNAME(&CURRDD)
                        ALLOC DD(&CURRDD) +
                              DSN(&BISPTLIB +
                                  &ALLDSN +
                                  &AISPTLIB) SHR
                        WRITE *** &CURRDD ALLOCATION CC = &LASTCC ***
                    END
/**********************************************************************
/* ISPMLIB REALLOCATION                                               *
/**********************************************************************
                WHEN (&CURRDD = ISPMLIB AND +
                     (&STR(&BISPMLIB) >          OR +
                      &STR(&AISPMLIB) >         )) DO
                        FREE DDNAME(&CURRDD)
                        ALLOC DD(&CURRDD) +
                              DSN(&BISPMLIB +
                                  &ALLDSN +
                                  &AISPMLIB) SHR
                        WRITE *** &CURRDD ALLOCATION CC = &LASTCC ***
                    END
/**********************************************************************
/* ISPSLIB REALLOCATION                                               *
/**********************************************************************
                WHEN (&CURRDD = ISPSLIB AND +
                     (&STR(&BISPSLIB) >          OR +
                      &STR(&AISPSLIB) >         )) DO
                        FREE DDNAME(&CURRDD)
                        ALLOC DD(&CURRDD) +
                              DSN(&BISPSLIB +
                                  &ALLDSN +
                                  &AISPSLIB) SHR
                        WRITE *** &CURRDD ALLOCATION CC = &LASTCC ***
                    END
/**********************************************************************
/* ISPLLIB REALLOCATION                                               *
/**********************************************************************
                WHEN (&CURRDD = ISPLLIB AND +
                     (&STR(&BISPLLIB) >          OR +
                      &STR(&AISPLLIB) >         )) DO
                        FREE DDNAME(&CURRDD)
                        ALLOC DD(&CURRDD) +
                              DSN(&BISPLLIB +
                                  &ALLDSN +
                                  &AISPLLIB) SHR
                        WRITE *** &CURRDD ALLOCATION CC = &LASTCC ***
                    END
            END
            SET CURRDD = &SUBSTR(3:10,&STR(&TEMPDD)
            SET X = &SYSINDEX(&STR( ),&STR(&CURRDD)) - 1
            IF &X < 1 THEN SET X = &LENGTH(&STR(&CURRDD))
            IF &STR(&CURRDD) >    THEN +
                DO
                    SET CURRDD = &SUBSTR(1:&X,&STR(&CURRDD))
                    SET ALLDSN =
                END
        END
END

EXIT

HELPSEC: +
SET PLUS = &STR(+ )
CLRSCRN
WRITE *** HELP FOR "DDCONCAT" UTILITY ***
WRITE
WRITE DDCONCAT is a CLIST which allows the user to dynamically change the
WRITE concatenation sequence of any of the following DDs during logon or while
WRITE out of ISPF.
WRITE
WRITE SYSHELP
WRITE SYSEXEC
WRITE SYSPROC
WRITE ISPPLIB
WRITE ISPMLIB
WRITE ISPSLIB
WRITE ISPTLIB
WRITE ISPLLIB
WRITE
WRITE It allows you to put one or more libraries before and/or after
WRITE each one of these standard dd's.
WRITE
WRITE Note: you are responsible for whether any specific library can, in
WRITE fact, be successfully concatenated to a given dd based on MVS
WRITE restrictions on dataset concatenations and installation-specific
WRITE restrictions.  For example, Fidelity CLIST files are all defined
WRITE VB 255.  An FB 80 library ahead of this concatenation will cause
WRITE any CLISTs executed in concatenation after the FB 80 library to
WRITE ABEND.  Also, some installation-specific ISPF commands can only be
WRITE implemented by placing them in the first ISPTLIB library.  If you
WRITE place a different ISPTLIB library first, you may, in fact, nullify
WRITE your ability to use these commands.
WRITE
WRITE DDCONCAT has 2 keyword parameters for each ISPF ddname and for
WRITE SYSPROC.  The names of these keywords are the ddname prefixed by
WRITE an "A" or a "B".  For example, the CLIST dd "SYSPROC" has the
WRITE keywords "ASYSPROC" and "BSYSPROC" associated with it; the panel
WRITE dd "ISPPLIB" has "AISPPLIB" and "BISPPLIB", etc.  The "A" means
WRITE "after" and the "B" means "before".
WRITE
WRITE Consequently, you put the library names which you want to place
WRITE before the current xxxxxxx concatenation in the Bxxxxxxx keyword.
WRITE To place CLIST library "ABC.DEF.CLIST" ahead of the concatenation
WRITE in SYSPROC, you would invoke DDCONCAT as follows:
WRITE
WRITE %DDCONCAT BSYSPROC('''ABC.DEF.CLIST''')
WRITE
WRITE You may specify any or all of the keywords which DDCONCAT has in a
WRITE single call to DDCONCAT (indeed, you SHOULD do this for
WRITE efficiency's sake).
WRITE
WRITE DDCONCAT uses standard TSO dataset name qualification.  This means
WRITE that if you specify a dataset name in single quotes, it will be
WRITE used as specified.  If you do not specify the single quotes, your
WRITE user id will be prefixed in front of the dataset name.  In the
WRITE above example, if you had specified BSYSPROC(ABC.DEF.CLIST), the
WRITE actual dataset to be used would have been &SYSUID..ABC.DEF.CLIST.
WRITE If you want to specify more than one dataset in a given keyword
WRITE parameter, the entire keyword value must be in single quotes as
WRITE well.
WRITE
WRITE Note that the use of single quotes in CLIST processing of a
WRITE KEYWORD parameter (such as BSYSPROC, or AISPPLIB in this example)
WRITE is not intuitively obvious.  CLISTs interpret single quotes a
WRITE little strangely when passed as part of parameters.  In the above
WRITE example, to maintain the single quotes around ABC.DEF.CLIST, three
WRITE single quotes on each side were needed.  The outer-most single
WRITE quote encompasses the entire parameter, and the next two are then
WRITE interpreted as one single quote.  Note how they are used in the
WRITE next example.
WRITE
WRITE For instance, if you wanted to place &SYSUID..GHI.JKL.ISPPLIB and
WRITE MNO.PQR.ISPPLIB after the ISPPLIB concatenation, you would specify
WRITE the command as follows:
WRITE
WRITE %DDCONCAT AISPPLIB('GHI.JKL.ISPPLIB ''MNO.PQR.ISPPLIB''')
WRITE
WRITE So, if you wanted to place all of your personal CLIST and ISPF
WRITE libraries in the proper concatenations while logging on, you could
WRITE call DDCONCAT in the following manner:
WRITE
WRITE %DDCONCAT BSYSPROC(PDS.CLIST) BISPPLIB(PDS.ISPPLIB) &STR(&PLUS)
WRITE           BISPTLIB(PDS.ISPTLIB) BISPMLIB(PDS.ISPMLIB) &STR(&PLUS)
WRITE           BISPSLIB(PDS.ISPSLIB) BISPLLIB(PDS.ISPLLIB)
WRITE
WRITE *** END OF HELP *** NO PROCESSING PERFORMED ***
EXIT
            


Documentation


 DDCONCAT is a CLIST which allows the user to dynamically change the
 concatenation sequence of any of the following DDs during logon or while out of
 ISPF (i.e. they must be done at the "READY" prompt of native TSO).

 SYSHELP
 SYSEXEC
 SYSPROC
 ISPPLIB
 ISPMLIB
 ISPSLIB
 ISPTLIB
 ISPLLIB

 It allows you to put one or more libraries before and/or after each one of
 these standard dd's.

 Note: you are responsible for whether any specific library can, in fact, be
 successfully concatenated to a given dd based on MVS restrictions on dataset
 concatenations and installation-specific restrictions.  For example, Fidelity
 CLIST files are all defined VB 255.  An FB 80 library ahead of this
 concatenation will cause any CLISTs executed in concatenation after the FB 80
 library to ABEND.  Also, some installation-specific ISPF commands can only be
 implemented by placing them in the first ISPTLIB library.  If you place a
 different ISPTLIB library first, you may, in fact, nullify your ability to use
 these commands.

 DDCONCAT has 2 keyword parameters for each ISPF ddname and for SYSPROC.  The
 names of these keywords are the ddname prefixed by an "A" or a "B".  For
 example, the CLIST dd "SYSPROC" has the keywords "ASYSPROC" and "BSYSPROC"
 associated with it; the panel dd "ISPPLIB" has "AISPPLIB" and "BISPPLIB", etc.
 The "A" means "after" and the "B" means "before".

 Consequently, you put the library names which you want to place before the
 current xxxxxxx concatenation in the Bxxxxxxx keyword.  To place CLIST library
 "ABC.DEF.CLIST" ahead of the concatenation in SYSPROC, you would invoke
 DDCONCAT as follows:

 %DDCONCAT BSYSPROC('''ABC.DEF.CLIST''')

 You may specify any or all of the keywords which DDCONCAT has in a single call
 to DDCONCAT (indeed, you SHOULD do this for efficiency's sake).

 DDCONCAT uses standard TSO dataset name qualification.  This means that if you
 specify a dataset name in single quotes, it will be used as specified.  If you
 do not specify the single quotes, your user id will be prefixed in front of the
 dataset name.  In the above example, if you had specified
 BSYSPROC(ABC.DEF.CLIST), the actual dataset to be used would have been
 &SYSUID..ABC.DEF.CLIST.  If you want to specify more than one dataset in a
 given keyword parameter, the entire keyword value must be in single quotes as
 well.

 Note that the use of single quotes in CLIST processing of a KEYWORD parameter
 (such as BSYSPROC, or AISPPLIB in this example) is not intuitively obvious.
 CLISTs interpret single quotes a little strangely when passed as part of
 parameters.  In the above example, to maintain the single quotes around
 ABC.DEF.CLIST, three single quotes on each side were needed.  The outer-most
 single quote encompasses the entire parameter, and the next two are then
 interpreted as one single quote.  Note how they are used in the next example.

 For instance, if you wanted to place &SYSUID..GHI.JKL.ISPPLIB and
 MNO.PQR.ISPPLIB after the ISPPLIB concatenation, you would specify the command
 as follows:

 %DDCONCAT AISPPLIB('GHI.JKL.ISPPLIB ''MNO.PQR.ISPPLIB''')

 So, if you wanted to place all of your personal CLIST and ISPF libraries in the
 proper concatenations while logging on, you could call DDCONCAT in the
 following manner:

 %DDCONCAT BSYSPROC(PDS.CLIST) BISPPLIB(PDS.ISPPLIB) &STR(&PLUS)
           BISPTLIB(PDS.ISPTLIB) BISPMLIB(PDS.ISPMLIB) &STR(&PLUS)
           BISPSLIB(PDS.ISPSLIB) BISPLLIB(PDS.ISPLLIB)
            


Leave a Reply

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