Mainframe Utility: TESTGDG

Return to Mainframe Utilities Page

Module


/* REXX ***************************************************************/
/* UTILITY: TESTGDG                                                   */
/* AUTHOR: DAVID LEIGH                                                */
/* FUNCTION: CREATE A QUICK AND DIRTY CLIST TO CALL THE BLDG UTILITY  */
/*           TO BUILD GDG INDEXES FOR DATASETS FOUND WITHIN A JOB     */
/*           STREAM THAT ARE GDGS.                                    */
/**********************************************************************/
DUMMY = OUTTRAP('NULL.')
ADDRESS ISPEXEC
'CONTROL ERRORS RETURN'
ADDRESS ISREDIT
'MACRO (OPT)'

/*IF OPT = HELP THEN SIGNAL HELPSEC*/

'(DSN) = DATASET'
'(MBR) = MEMBER'

IF RC = 0 THEN
    ZEDLMSG = '*** CREATING A GDG BUILD CLIST FROM : 'DSN'('MBR') ***'
ELSE
    ZEDLMSG = '*** CREATING A GDG BUILD CLIST FROM : 'DSN' ***'

ADDRESS ISPEXEC
'CONTROL DISPLAY LOCK'
'DISPLAY MSG(UTLZ000W)'

ADDRESS TSO
USER = SYSVAR(SYSUID)
TEMPCLST = USER ¦¦ '.TEMP.BUILD.GDG.CLIST'
"DELETE '"TEMPCLST"'"

"ALLOCATE DDNAME(JCLOUT) " ,
         "DSNAME('"TEMPCLST"') " ,
         "NEW CATALOG " ,
         "UNIT(SYSDA) VOLUME(WRK$$$) " ,
         "SPACE(5,5) TRACKS RELEASE " ,
         "RECFM(F B) LRECL(80) BLKSIZE(23440) DSORG(PS)"

"NEWSTACK"

ADDRESS ISREDIT

'(SLN,SCL) = CURSOR'

"FIND FIRST ' DSN='"

DO WHILE RC = 0
    '(LN,CL) = CURSOR'
    CL = CL + 5
    "FIND NEXT ',' .ZCSR .ZCSR"
    IF RC > 0 THEN
        "FIND NEXT ' ' .ZCSR .ZCSR"
    "(LN2,CL2) = CURSOR"
    "(DSSTRING) = LINE .ZCSR"
    DSSTRING = SUBSTR(DSSTRING,CL,CL2-CL)
    IF INDEX(DSSTRING,'()') > 0  ¦ ,
       INDEX(DSSTRING,'(0') > 0  ¦ ,
       INDEX(DSSTRING,'(1') > 0  ¦ ,
       INDEX(DSSTRING,'(2') > 0  ¦ ,
       INDEX(DSSTRING,'(3') > 0  ¦ ,
       INDEX(DSSTRING,'(4') > 0  ¦ ,
       INDEX(DSSTRING,'(5') > 0  ¦ ,
       INDEX(DSSTRING,'(6') > 0  ¦ ,
       INDEX(DSSTRING,'(7') > 0  ¦ ,
       INDEX(DSSTRING,'(8') > 0  ¦ ,
       INDEX(DSSTRING,'(9') > 0  ¦ ,
       INDEX(DSSTRING,'(+') > 0  ¦ ,
       INDEX(DSSTRING,'(-') > 0  ¦ ,
       INDEX(DSSTRING,'(&') > 0  THEN
        DO
            B = INDEX(DSSTRING,'(') - 1
            DSSTRING = SUBSTR(DSSTRING,1,B)
            DSSTRING = '%BLDG DSN('DSSTRING') ENT(3)'
            QUEUE DSSTRING
        END
    "FIND NEXT ' DSN='"
END

QNUM = QUEUED()

ADDRESS TSO
"EXECIO" QNUM "DISKW JCLOUT (FINIS"

"DELSTACK"
"FREE DD(JCLOUT)"

ADDRESS ISPEXEC "EDIT DATASET('"TEMPCLST"') MACRO(TESTGDGM)"

ADDRESS ISREDIT "CURSOR =" SLN SCL
EXIT

HELPSEC:
SAY "*** HELP FOR EDIT MACRO 'TESTGDG' ***"
SAY
SAY "THIS EDIT MACRO WILL EXTRACT ALL LINES FROM THE CURRENT DATASET"
SAY "YOU ARE EDITING WHICH CONTAIN THE STRING 'DSN=TDOWS.TMG'. IT IS"
SAY "LOOKING FOR ALL TEST DATASETS WHICH ARE GDG'S.   IT WILL THEN"
SAY "CREATE MEMBER $$$$BLDG IN YOUR &SYSUID..PDS.CLIST LIBRARY. THIS"
SAY "MEMBER WILL CONTAIN LINES OF DATA WHICH RESEMBLE THE FOLLOWING :"
SAY
SAY "%BLDG DSN(TDOWS.TMGAT.RBX1.DAILY1) ENT(3)"
SAY
SAY "WHEN THE $$$$BLDG CLIST IS EXECUTED, IT WILL CALL THE BLDG CLIST"
SAY "AND TRY TO CREATE A GDG INDEX FOR 'TDOWS.TMGAT.RBX1.DAILY1' WITH"
SAY "2 ENTRIES.   THE BLDG CLIST WILL RETURN MESSAGES WHICH INDICATE"
SAY "WHETHER IT WAS SUCCESSFUL OR NOT.   THIS WILL HAPPEN FOR EACH"
SAY "LINE WHICH CALLS 'BLDG' IN THE CLIST $$$$BLDG."
SAY
SAY "YOU CAN DELETE LINES CONTAINING DATASET NAMES FOR WHICH YOU DO NOT"
SAY "WANT TO CREATE GDG INDEXES.   IF A GDG INDEX ALREADY EXISTS FOR A"
SAY "GIVEN DATASET, YOU WILL RECEIVE A MESSAGE TELLING YOU THAT, SO YOU"
SAY "DO NOT NEED TO DELETE LINES CONTAINING DATASET NAMES FOR WHICH A"
SAY "GDG INDEX ALREADY EXISTS."
SAY
SAY "WHEN YOU ARE FINISHED EDITING THE FILE, TYPE 'END;TSO $$$$BLDG'"
SAY "AT THE COMMAND LINE TO EXECUTE THE CLIST AND CREATE THE GDG'S."
SAY "WHEN THE CLIST IS COMPLETE (BE SURE TO CHECK THE MESSAGES FROM THE"
SAY "BLDG CLIST THAT SHOW UP ON YOUR SCREEN) YOU WILL BE RETURNED TO"
SAY "THE DATASET YOU ARE EDITING."
SAY
SAY "*** END OF HELP *** NO PROCESSING PERFORMED ***"

EXIT
            


Documentation


 TESTGDG is an edit macro which you can invoke while in JCL.  It will scan your
 JCL and look for datasets which are GDG datasets and will construct a temporary
 CLIST which will, in turn, interactively create GDG indexes for these datasets.
 This can be helpful if you have just created some test JCL from some production
 JCL and wish to use GDGs like production does, but with test name.  This allows
 you to quickly create the GDG indexes necessary to run your job.
            


Leave a Reply

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