Mainframe Utility: INFODSN

Return to Mainframe Utilities Page

Module


/**********************************************************************/
/* UTILITY NAME : INFODSN                                             */
/* DATE WRITTEN : 8-15-89                                             */
/* AUTHOR       : DAVE LEIGH                                          */
/* DESCRIPTION  : SHOW A SCREEN MUCH LIKE ISPF OPTION 3.2 WITH INFO   */
/*              : ABOUT A DATASET                                     */
/*========================== MODIFICATIONS ===========================*/
/* WHO         |WHEN     |WHY                                         */
/* ---         |----     |---                                         */
/*             |         |                                            */
/**********************************************************************/
PROC 0 HELP
CONTROL NOMSG NOLIST NOFLUSH NOPROMPT           /* STANDARD INITIAL */
ERROR DO                                        /* PROCESSING :     */
          SET MODE = CLIST                      /* 1. INVOCATION    */
          RETURN                                /*    MODE ?        */
      END                                       /*                  */
ISREDIT MACRO (HELP)                            /*                  */
ERROR OFF                                       /*                  */
ISPEXEC CONTROL ERRORS RETURN                   /*    LOGGING       */
ISPEXEC VGET (DBGSWTCH) PROFILE                 /* 3. DEBUG MESSAGES*/
IF &DBGSWTCH = &STR(ON) THEN                    /*    BASED ON      */ +
     CONTROL MSG LIST CONLIST SYMLIST NOFLUSH   /*    "DBGSWTCH"    */
ELSE  CONTROL NOMSG NOLIST NOFLUSH NOPROMPT     /*    VARIABLE.     */
IF &HELP = HELP THEN GOTO HELPSEC               /* 4. DISPLAY HELP  */

IF &MODE ¬= CLIST THEN +
    DO
        ISREDIT (DSN) = DATASET
        ISREDIT (MBR) = MEMBER
        IF &STR(&MBR) >    THEN SET DSN = &STR(&DSN(&MBR))
        ISPEXEC VPUT DSN SHARED
    END

ISPEXEC VGET (DSN) SHARED
SET MBR =
SET LPAREN = &STR((
SET RPAREN = &STR())
SET A = &SYSINDEX(&STR(&LPAREN),&STR(&DSN))
SET C = &A - 1
SET A = &A + 1
SET D = &A + 1
SET B = &LENGTH(&STR(&DSN))
SET B = &B - 1
IF &B < 1 THEN GOTO RESUME1

IF &A > 1 AND +
   &B > 0 AND +
   (&SUBSTR(&A:&A,&STR(&DSN)) = &STR(+) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(-) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(0) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(1) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(2) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(3) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(4) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(5) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(6) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(7) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(8) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(9)) THEN +
    DO
        SET GM = &SUBSTR(&A:&B,&STR(&DSN))
        IF &SUBSTR(1:1,&STR(&GM)) = &STR(-) THEN +
            SET GM = &SUBSTR(2,&STR(&GM))
        IF &LENGTH(&STR(&GM)) > 1 THEN +
            DO
                IF &SUBSTR(1:1,&STR(&GM)) = &STR(+) THEN +
                    DO
                        SET ZEDLMSG = &STR(NON-EXISTANT GENERATIONS )+
                                      &STR(ARE NOT ALLOWED)
                        ISPEXEC SETMSG MSG(UTLZ001)

                        EXIT
                    END
                IF &SUBSTR(1:2,&STR(&GM)) = &STR(+1) THEN +
                    SET GM = NEXTGEN
                IF &SUBSTR(1:2,&STR(&GM)) = &STR(+0) THEN +
                    SET GM = &STR(0)
            END
        SET XDSN = &SUBSTR(1:&C,&STR(&DSN))
        SET ZEDLMSG = &STR(* RESOLVING DATASET)+
                      &STR( RELATIVE GDG GENERATION )+
                      &STR(NUMBER *)
        ISPEXEC SETMSG MSG(UTLZ000)
        ISPEXEC CONTROL DISPLAY LOCK
        ISPEXEC DISPLAY PANEL(INFODSN)
        %GDGGEN DSN(&XDSN)
        SET GM = MINUS&GM
        ISPEXEC VGET (&GM GEN LIMIT) SHARED
        IF &STR(&&GM) >    THEN +
            SET GEN = &&&GM
        ELSE +
            IF &LIMIT > 0 THEN +
                SET GEN = G0001V00
            ELSE +
                DO
                    SET ZEDLMSG = &STR("&DSN" IS NOT A GDG DATASET)
                    ISPEXEC SETMSG MSG(UTLZ001)
                    EXIT
                END
        SET DSN = &STR(&XDSN..&GEN)
    END

RESUME1: +
IF &DSN =    THEN GOTO PREMAP
LISTDSI '&DSN' DIRECTORY
SET SAVECC = &LASTCC
SET XSYS1  = &SYSVOLUME
SET XSYS2  = &STR(&SYSCREATE)
SET XSYS3  = &SYSUNIT
SET XSYS4  = &STR(&SYSREFDATE)
SET XSYS5  = &SYSTRKSCYL
SET XSYS6  = &SYSUPDATED
SET XSYS7  = &SYSDSORG
SET XSYS8  = &SYSUNITS
SET XSYS9  = &SYSRECFM
SET XSYS10 = &SYSALLOC
SET XSYS11 = &SYSLRECL
SET XSYS12 = &SYSUSED
SET XSYS13 = &SYSBLKSIZE
SET XSYS14 = &SYSPRIMARY
SET XSYS15 = &SYSKEYLEN
SET XSYS16 = &SYSSECONDS
SET XSYS17 = &SYSPASSWORD
SET XSYS18 = &SYSEXTENTS
SET XSYS19 = &SYSRACFA
SET XSYS20 = &SYSEXDATE
SET XSYS21 = &SYSBLKSTRK
SET XSYS22 = &SYSADIRBLK
SET XSYS23 = &SYSUDIRBLK
SET XSYS24 = &SYSMEMBERS
IF &SAVECC = 4 THEN +
    DO
        SET XSYS21 =
        SET XSYS22 =
        SET XSYS23 =
        SET XSYS24 =
    END
ELSE  +
    IF &SAVECC = 16 THEN +
        DO
            SET ZEDLMSG = &STR(&SYSDSN('&DSN))
            ISPEXEC SETMSG MSG(UTLZ001)
            SET XSYS1       =
            SET XSYS3       =
            SET XSYS7       =
            SET XSYS9       =
            SET XSYS11      =
            SET XSYS13      =
            SET XSYS15      =
            SET XSYS10      =
            SET XSYS12      =
            SET XSYS14      =
            SET XSYS16      =
            SET XSYS8       =
            SET XSYS18      =
            SET XSYS2       =
            SET XSYS4       =
            SET XSYS20      =
            SET XSYS17      =
            SET XSYS19      =
            SET XSYS6       =
            SET XSYS5       =
            SET XSYS21      =
            SET XSYS22      =
            SET XSYS23      =
            SET XSYS24      =
        END
    ELSE +
        IF &SYSINDEX(&STR(PO),&STR(&XSYS7)) > 0 AND +
           &SYSINDEX(&STR(&LPAREN),&STR(&DSN)) > 0 THEN +
            DO
                SET A = &SYSINDEX(&STR(&LPAREN),&STR(&DSN))
                SET B = &SYSINDEX(&STR(&RPAREN),&STR(&DSN))
                SET A = &A + 1
                SET B = &B - 1
                SET MBR = &SUBSTR(&A:&B,&STR(&DSN))
                SET A = &A - 2
                SET XDSN = &SUBSTR(1:&A,&STR(&DSN))
                ISPEXEC LMINIT DATAID(DID) DATASET('&XDSN')
                ISPEXEC LMOPEN DATAID(&DID)
                ISPEXEC LMMFIND DATAID(&DID) +
                                MEMBER(&MBR) STATS(YES)
                IF &LASTCC > 0 THEN +
                    DO
                        SET ZEDLMSG = &STR(PROBLEM WITH MEMBER +
                                           "&MBR")
                        ISPEXEC SETMSG MSG(UTLZ001)
                    END
            END
        ELSE SET MBR =

PREMAP: +
ISPEXEC VPUT (XSYS1 XSYS3 XSYS7 XSYS9 XSYS11 XSYS13 XSYS15 XSYS10 +
              XSYS12 XSYS14 XSYS16 XSYS8 XSYS18 XSYS2 XSYS4 XSYS20 +
              XSYS17 XSYS19 XSYS6 XSYS5 XSYS21 XSYS22 XSYS23 XSYS24 +
              LINE1 LINE2 LINE3 XVAREND XVAR1 XVAR2 XVAR3 MBR) SHARED

REDISP: +
ISPEXEC DISPLAY PANEL(INFODSN)

IF &LASTCC = 8 THEN GOTO FINISH

ISPEXEC VGET (DSN) SHARED
SET A = &SYSINDEX(&STR(&LPAREN),&STR(&DSN))
SET C = &A - 1
SET A = &A + 1
SET B = &LENGTH(&STR(&DSN))
SET B = &B - 1
IF &A > 1 AND +
   (&SUBSTR(&A:&A,&STR(&DSN)) = &STR(+) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(-) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(0) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(1) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(2) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(3) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(4) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(5) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(6) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(7) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(8) OR +
    &SUBSTR(&A:&A,&STR(&DSN)) = &STR(9)) THEN +
    DO
        SET GM = &SUBSTR(&A:&B,&STR(&DSN))
        IF &SUBSTR(1:1,&STR(&GM)) = &STR(-) THEN +
            SET GM = &SUBSTR(2,&STR(&GM))
        IF &LENGTH(&STR(&GM)) > 1 THEN +
            DO
                IF &SUBSTR(1:1,&STR(&GM)) = &STR(+) THEN +
                    DO
                        SET ZEDLMSG = &STR(NON-EXISTANT )+
                                      &STR(GENERATIONS )+
                                      &STR(ARE NOT ALLOWED)
                        ISPEXEC SETMSG MSG(UTLZ001)
                        GOTO REDISP
                    END
                IF &SUBSTR(1:2,&STR(&GM)) = &STR(+1) THEN +
                    SET GM = NEXTGEN
                IF &SUBSTR(1:2,&STR(&GM)) = &STR(+0) THEN +
                    SET GM = &STR(0)
            END
        SET DSN = &SUBSTR(1:&C,&STR(&DSN))
        SET ZEDLMSG = &STR(* RESOLVING DATASET)+
                      &STR( RELATIVE GDG GENERATION )+
                      &STR(NUMBER *)
        ISPEXEC SETMSG MSG(UTLZ000)
        ISPEXEC CONTROL DISPLAY LOCK
        ISPEXEC DISPLAY PANEL(INFODSN)
        %GDGGEN DSN(&DSN)
        SET GM = MINUS&GM
        ISPEXEC VGET (&GM GEN LIMIT) SHARED
        IF &STR(&&GM) >    THEN +
            SET GEN = &&&GM
        ELSE +
            IF &LIMIT > 0 THEN +
                SET GEN = G0001V00
            ELSE +
                DO
                    SET ZEDLMSG = &STR("&DSN" IS NOT A GDG +
                                       DATASET)
                    ISPEXEC SETMSG MSG(UTLZ001)
                    EXIT
                END
        SET DSN = &STR(&DSN..&GEN)
    END

LISTDSI '&DSN' DIRECTORY
SET SAVECC = &LASTCC
SET XSYS1  = &SYSVOLUME
SET XSYS2  = &STR(&SYSCREATE)
SET XSYS3  = &SYSUNIT
SET XSYS4  = &STR(&SYSREFDATE)
SET XSYS5  = &SYSTRKSCYL
SET XSYS6  = &SYSUPDATED
SET XSYS7  = &SYSDSORG
SET XSYS8  = &SYSUNITS
SET XSYS9  = &SYSRECFM
SET XSYS10 = &SYSALLOC
SET XSYS11 = &SYSLRECL
SET XSYS12 = &SYSUSED
SET XSYS13 = &SYSBLKSIZE
SET XSYS14 = &SYSPRIMARY
SET XSYS15 = &SYSKEYLEN
SET XSYS16 = &SYSSECONDS
SET XSYS17 = &SYSPASSWORD
SET XSYS18 = &SYSEXTENTS
SET XSYS19 = &SYSRACFA
SET XSYS20 = &SYSEXDATE
SET XSYS21 = &SYSBLKSTRK
SET XSYS22 = &SYSADIRBLK
SET XSYS23 = &SYSUDIRBLK
SET XSYS24 = &SYSMEMBERS
IF &SAVECC = 4 THEN +
    DO
        SET XSYS21 =
        SET XSYS22 =
        SET XSYS23 =
        SET XSYS24 =
    END
ELSE  +
    IF &SAVECC = 16 THEN +
        DO
            SET ZEDLMSG = &STR(&SYSDSN(&DSN))
            ISPEXEC SETMSG MSG(UTLZ001)
            SET XSYS1       =
            SET XSYS3       =
            SET XSYS7       =
            SET XSYS9       =
            SET XSYS11      =
            SET XSYS13      =
            SET XSYS15      =
            SET XSYS10      =
            SET XSYS12      =
            SET XSYS14      =
            SET XSYS16      =
            SET XSYS8       =
            SET XSYS18      =
            SET XSYS2       =
            SET XSYS4       =
            SET XSYS20      =
            SET XSYS17      =
            SET XSYS19      =
            SET XSYS6       =
            SET XSYS5       =
            SET XSYS21      =
            SET XSYS22      =
            SET XSYS23      =
            SET XSYS24      =
        END
    ELSE +
        IF &SYSINDEX(&STR(PO),&STR(&XSYS7)) > 0 AND +
           &SYSINDEX(&STR(&LPAREN),&STR(&DSN)) > 0 THEN +
            DO
                SET A = &SYSINDEX(&STR(&LPAREN),&STR(&DSN))
                SET B = &SYSINDEX(&STR(&RPAREN),&STR(&DSN))
                SET A = &A + 1
                SET B = &B - 1
                SET MBR = &SUBSTR(&A:&B,&STR(&DSN))
                SET A = &A - 2
                SET XDSN = &SUBSTR(1:&A,&STR(&DSN))
                ISPEXEC LMINIT DATAID(DID) DATASET('&XDSN')
                ISPEXEC LMOPEN DATAID(&DID)
                ISPEXEC LMMFIND DATAID(&DID) +
                                MEMBER(&MBR) STATS(YES)
                IF &LASTCC > 0 THEN +
                    DO
                        SET ZEDLMSG = &STR(PROBLEM WITH MEMBER +
                                           "&MBR")
                        ISPEXEC SETMSG MSG(UTLZ001)
                    END
            END
        ELSE SET MBR =

ISPEXEC VPUT (XSYS1 XSYS3 XSYS7 XSYS9 XSYS11 XSYS13 XSYS15 XSYS10 +
              XSYS12 XSYS14 XSYS16 XSYS8 XSYS18 XSYS2 XSYS4 XSYS20 +
              XSYS17 XSYS19 XSYS6 XSYS5 XSYS21 XSYS22 XSYS23 XSYS24 +
              LINE1 LINE2 LINE3 XVAREND XVAR1 XVAR2 XVAR3 MBR) SHARED

GOTO REDISP

FINISH: +
IF &DID >   THEN ISPEXEC LMFREE DATAID(&DID)
EXIT
HELPSEC: +
WRITE *** 
HELP FOR CLIST INFODSN ***
WRITE
WRITE *** END OF HELP *** NO PROCESSING PERFORMED ***

EXIT
            


Documentation


 This utility presents a panel of information about a dataset (similar in format
 to ISPF option 3.2.)  You invoke the utility by typing "tso infodsn" at any
 ISPF command line.  You then enter the desired dataset name in the proper field
 and press ENTER.  The information is then displayed.  You may overtype the 1st
 dataset name with a 2nd dataset name (3rd, 4th, 5th, etc.) and see information
 on it.  You may use any sequential file, sequential files with relative GDG
 numbers, and PDS library names with or with out member names.  This utility can
 also be invoked as an edit macro to bring up dataset information about a
 dataset being edited.
            


Leave a Reply

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