Mainframe Utility: PGMFLOW

Return to Mainframe Utilities Page

Module


ISREDIT MACRO (HELP)
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
IF &STR(&HELP) = HELP THEN GOTO HELPSEC
/**********************************************************************
/* UTILITY: PGMFLOW                                                   *
/* AUTHOR: DAVID LEIGH                                                *
/* FUNCTION: INVOKE THE "TREE" PROGRAM BY DON FAVILLE FOR THE COBOL   *
/*           PROGRAM BEING EDITED.                                    *
/**********************************************************************

/**********************************************************************
/* KEEP THE USER INFORMED                                             *
/**********************************************************************
SET ZEDLMSG = &STR(*** ALLOCATING FILES FOR THE PROGRAM FLOW UTILITY +
                   ***)
ISPEXEC CONTROL DISPLAY LOCK
ISPEXEC DISPLAY MSG(UTLZ000)

/**********************************************************************
/* ESTABLISH SOME INITIAL VARIABLES                                   *
/**********************************************************************
SET PGMNAME = PGMFLOW                                                   00010003
ISREDIT (MEMBER) = MEMBER                                               00030003
ISREDIT (DATASET) = DATASET                                             00040002
SET PRINT_FILE = &STR(&SYSUID..TEMP.&MEMBER..PGMFLOW)
SET VSAM_FILE = &STR(&SYSUID..TEMP.&MEMBER..VSAM)
                                                                        00050001
/**********************************************************************
/* FREE, DELETE, AND ALLOCATE VARIOUS FILES                           *
/**********************************************************************
FREE DD(WORKFILE SYSDBOUT SYSUDUMP SYSOUT IGZSRTCD SYSOUD PRINTFL +
        STRUCT SORTWK01 SORTWK02 SORTWK03 SORTWK04 SYSABOUT COBOLFL +
        PRINTFL)

DELETE '&PRINT_FILE'
DELETE '&VSAM_FILE' CLUSTER                                             00053303

DEFINE CLUSTER (NAME('&VSAM_FILE') +                                    00053403
                RECORDSIZE(70 70) +                                     00053501
                SHAREOPTIONS(2) +                                       00053601
                KEYS(32 0) +                                            00053701
                UNIQUE +                                                00053801
                SPEED) +                                                00053901
          DATA (NAME('&VSAM_FILE..D') +                                 00054003
                VOLUME(WRK001) +                                        00054103
                TRACKS(1 1) +                                           00054201
                CONTROLINTERVALSIZE(8192)) +                            00054301
         INDEX (NAME('&VSAM_FILE..I')  +                                00054403
                TRACKS(1 1) +                                           00054501
                VOLUME(WRK001))                                         00054603

ALLOC DD(SYSDBOUT) DUMMY
ALLOC DD(SYSUDUMP) DUMMY
ALLOC DD(SYSOUT) DUMMY
ALLOC DD(IGZSRTCD) DUMMY
ALLOC DD(SYSOUD) DUMMY
ALLOC DD(COBOLFL) DSN('&DATASET(&MEMBER)') +
                  SHR KEEP
ALLOC DD(STRUCT) DSN('&VSAM_FILE') +
                 SHR KEEP
ALLOC DD(PRINTFL) DSN('&PRINT_FILE') +
                  NEW CATALOG +
                  UNIT(SYSDA) VOLUME(WRK001) +
                  SPACE(5,5) TRACKS RELEASE +
                  RECFM(F B M) LRECL(133) BLKSIZE(23408) DSORG(PS)
ALLOC DD(WORKFILE) NEW +
                   UNIT(SYSDA) VOLUME(WRK001) +
                   SPACE(5,5) TRACKS RELEASE +
                   RECFM(F B) LRECL(88) BLKSIZE(23408) DSORG(PS)
ALLOC DD(SORTWK01) UNIT(SYSDA) SPACE(5,1) TRACKS
ALLOC DD(SORTWK02) UNIT(SYSDA) SPACE(5,1) TRACKS
ALLOC DD(SORTWK03) UNIT(SYSDA) SPACE(5,1) TRACKS
ALLOC DD(SORTWK04) UNIT(SYSDA) SPACE(5,1) TRACKS

/**********************************************************************
/* INVOKE THE PROGRAM                                                 *
/**********************************************************************
SET ZEDLMSG = &STR(*** EXECUTING THE PROGRAM FLOW UTILIY *** +
                   THIS MAY TAKE A MINUTE OR TWO ***)
ISPEXEC CONTROL DISPLAY LOCK
ISPEXEC DISPLAY MSG(UTLZ000)
ISPEXEC SELECT PGM(&PGMNAME)
SET PGMCC = &LASTCC
                                                                        00055201
/**********************************************************************
/* CLEANUP                                                            *
/**********************************************************************
DELETE '&VSAM_FILE' CLUSTER                                             00053303
FREE DD(WORKFILE SYSDBOUT SYSUDUMP SYSOUT IGZSRTCD SYSOUD PRINTFL +
        STRUCT SORTWK01 SORTWK02 SORTWK03 SORTWK04 SYSABOUT COBOLFL +
        PRINTFL)

/**********************************************************************
/* EDIT THE RESULTS DATASET                                           *
/**********************************************************************
ISPEXEC EDIT DATASET('&PRINT_FILE')

EXIT

HELPSEC: +                                                              02480000
ISPEXEC SELECT PGM(ISPTUTOR) PARM(HELPSHEL)                             02490000
SET ZEDLMSG = &STR(*** HELP DISPLAYED FOR PGMFLOW UTILITY +             02490000
                   *** NO PROCESSING PERFORMED ***)                     02490000
ISPEXEC SETMSG MSG(UTLZ000)                                             02490000
EXIT
            


Documentation


 The PGMFLOW utility invokes the "TREE" program which Don Faville wrote for the
 COBOL program currently being edited.  The user is then taken into an edit of
 the results.

 For instance, you have just checked out a copy of a COBOL program and you want
 a quick overview of the logic while you are editing the program.  You simply
 type in PGMFLOW and press .  "TREE" is then invoked interactively
 against the program you are editing.  When it is finished, PGMFLOW takes you
 into an edit of the report file produced by the TREE program.  You could then
 do anything you want with the file like invoke PRINTIT to print the file
 immediately, etc.
            


Leave a Reply

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