Mainframe Utility: $LISTCAT

Return to Mainframe Utilities Page

Module


PROC 1 DATASET_TO_LIST                                                  --------
/*** CHECK THE DEBUG SWITCH ***/
ISPEXEC VGET DBGSWTCH PROFILE
IF &DBGSWTCH = ON THEN +
    CONTROL MSG LIST CONLIST SYMLIST NOFLUSH NOPROMPT ASIS
ELSE +
    CONTROL NOMSG NOLIST NOFLUSH NOPROMPT ASIS
IF &STR(&DATASET_TO_LIST) = HELP THEN GOTO HELPSEC
/**********************************************************************
/* UTILITY: $LISTCAT                                                  *
/* AUTHOR: DAVID LEIGH                                                *
/* FUNCTION: INVOKE THE "LISTCAT" COMMAND AND DUMP THE OUTPUT TO A    *
/*           DATASET.                                                 *
/**********************************************************************

/**********************************************************************
/* PARSE THE DATASET NAME                                             *
/**********************************************************************
IF &SYSINDEX(&STR('),&STR(&DATASET_TO_LIST)) = 1 THEN +
    SET DATASET_TO_LIST = &SUBSTR(2:+
                          &LENGTH(&STR(&DATASET_TO_LIST))-1,+
                          &STR(&DATASET_TO_LIST))
ELSE +
    SET DATASET_TO_LIST = &STR(&SYSUID..&DATASET_TO_LIST)

/**********************************************************************
/* SET UP THE OUTPUT DATASET                                          *
/**********************************************************************
SET OUTDSN = &STR(&SYSUID..TEMP.LISTCAT)
DELETE '&OUTDSN'
FREE DDNAME(OUTDD)
ALLOC DD(OUTDD) DSN('&OUTDSN') +
                NEW CATALOG +
                UNIT(SYSDA) VOLUME(WRK$$$) +
                SPACE(5,5) TRACKS RELEASE +
                DSORG(PS) RECFM(V B A) LRECL(125) BLKSIZE(23375)

/**********************************************************************
/* INVOKE THE LISTCAT AND DUMP THE RESULTS TO THE FILE                *
/**********************************************************************
LISTCAT LEVEL('&DATASET_TO_LIST') ALL OUTFILE(OUTDD)

/**********************************************************************
/* EDIT THE OUTPUT                                                    *
/**********************************************************************
FREE DDNAME(OUTDD)
ISPEXEC EDIT DATASET('&OUTDSN')

EXIT

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


Documentation


 The $LISTCAT utility takes input of a dataset name, issues a LISTCAT against
 it, places the results in an ouput file, and takes the user into an edit on
 that output file.

 $LISTCAT is designed specifically for the ISPF/PDF DSLIST screen (option 3.4).
 You type "$LISTCAT" next to a dataset name on the 3.4 screen and press .
 $LISTCAT then performs the LISTCAT on the dataset and takes you into the
 results file.
            


Leave a Reply

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