Mainframe Utility: $TINFO

Return to Mainframe Utilities Page

Module


PROC 1 TDSN BATCH                                                       --------
/*** 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(&TDSN) = HELP THEN GOTO HELPSEC
/**********************************************************************
/* UTILITY: $TINFO                                                    *
/* AUTHOR: DAVID LEIGH                                                *
/* FUNCTION: CALL "TMSBINQ" TO FIND OUT TMS INFO ON A TAPE DATASET    *
/*           WITHOUT HAVING TO GO INTO TMS.                           *
/**********************************************************************

IF &SYSINDEX(&STR('),&STR(&TDSN)) = 1 THEN +
    SET TDSN = &SUBSTR(2:&LENGTH(&STR(&TDSN))-1,&STR(&TDSN))
ELSE +
    SET TDSN = &STR(&SYSUID..&TDSN)

SET ZEDLMSG = &STR(*** GATHERING TMS INFORMATION ON "&TDSN" ***)
ISPEXEC CONTROL DISPLAY LOCK
ISPEXEC DISPLAY MSG(UTLZ000W)

SET SYSRPTDSN = &STR(&SYSUID..TEMP.TMS.REPORT)

DELETE '&SYSRPTDSN'

FREE DDNAME(TMSRPT SYSIN)

ALLOC DD(TMSRPT) DSN('&SYSRPTDSN') +
                 NEW CATALOG +
                 UNIT(SYSDA) VOLUME(WRK$$$) +
                 SPACE(5,5) TRACKS RELEASE +
                 DSORG(PS) RECFM(F B) LRECL(133) BLKSIZE(23408)

ALLOC DD(SYSIN) +
      NEW +
      UNIT(SYSDA) VOLUME(WRK$$$) +
      SPACE(1,1) TRACKS RELEASE +
      RECFM(F B) LRECL(80) BLKSIZE(23440) DSORG(PS)

OPENFILE SYSIN  OUTPUT
SET SYSIN  = &STR(DSN=&TDSN,LONG)
PUTFILE SYSIN
CLOSFILE SYSIN

ISPEXEC SELECT PGM(TMSBINQ)

SET ZEDLMSG = &STR(*** FORMATTING TMS INFORMATION FOR "&TDSN" ***)
ISPEXEC CONTROL DISPLAY LOCK
ISPEXEC DISPLAY MSG(UTLZ000W)

FREE DDNAME(SYSIN SYSPRINT)

/**********************************************************************
/* SHOW THE OUTPUT IN AN EDITED FILE.                                 *
/**********************************************************************
FREE DDNAME(TMSRPT)
ISPEXEC VPUT (TDSN BATCH) SHARED
ISPEXEC EDIT DATASET('&SYSRPTDSN') MACRO(TINFOMAC)
EXIT
/**********************************************************************
/* DON'T REMOVE THE NEXT CODE SINCE IT WAS SO TIME-CONSUMING TO CREATE*
/**********************************************************************
ERROR DO
    SET ERRCC = &LASTCC
    SELECT (&ERRCC)
        WHEN (400) DO
            SET EOF = YES
            RETURN
        END
        OTHERWISE DO
            ERROR OFF
            WRITE *** ERROR CC: &ERRCC OCCURRED READING A FILE ***
            CLOSFILE TMSRPT
            FREE DD(TMSRPT)
            EXIT CODE(&ERRCC)
        END
    END
END

SET SWITCH = OFF
SET EOF = NO
OPENFILE TMSRPT
GETFILE TMSRPT

DO WHILE &EOF = NO
    IF &SYSINDEX(&STR(VOLSEQ=001),&STR(&TMSRPT)) = 9 THEN +
        DO
            SET VOLSEQ   = &SUBSTR(016:018,&STR(&TMSRPT))
            SET ACCT     = &SUBSTR(088:128,&STR(&TMSRPT))
            GETFILE TMSRPT
            SET CUNIT    = &SUBSTR(073:075,&STR(&TMSRPT))
            SET LJOB     = &SUBSTR(083:090,&STR(&TMSRPT))
            SET LDATE    = &SUBSTR(099:103,&STR(&TMSRPT))
            SET LUNIT    = &SUBSTR(112:114,&STR(&TMSRPT))
            GETFILE TMSRPT
            SET FIRSTVOL = &SUBSTR(016:021,&STR(&TMSRPT))
            SET NEXTVOL  = &SUBSTR(032:037,&STR(&TMSRPT))
            SET PREVVOL  = &SUBSTR(048:053,&STR(&TMSRPT))
            SET NUMDSNB  = &SUBSTR(074:077,&STR(&TMSRPT))
            SET FRSTDSNB = &SUBSTR(088:092,&STR(&TMSRPT))
            SET FLAG2    = &SUBSTR(101:102,&STR(&TMSRPT))
            SET BATCHID  = &SUBSTR(113:115,&STR(&TMSRPT))
            GETFILE TMSRPT
            SET LABEL    = &SUBSTR(015:016,&STR(&TMSRPT))
            SET DEN      = &SUBSTR(023:024,&STR(&TMSRPT))
            SET TRTCH    = &SUBSTR(033:034,&STR(&TMSRPT))
            GETFILE TMSRPT
            SET OUTCODE  = &SUBSTR(017:020,&STR(&TMSRPT))
            SET OUTDATE  = &SUBSTR(031:035,&STR(&TMSRPT))
            SET SLOT     = &SUBSTR(043:048,&STR(&TMSRPT))
            SET CLNCNT   = &SUBSTR(057:059,&STR(&TMSRPT))
            SET DATECLN  = &SUBSTR(070:074,&STR(&TMSRPT))
            SET USECLN   = &SUBSTR(084:088,&STR(&TMSRPT))
            SET BTHDATE  = &SUBSTR(099:103,&STR(&TMSRPT))
            SET COUNT    = &SUBSTR(112:116,&STR(&TMSRPT))
            GETFILE TMSRPT
            SET FLAG3    = &SUBSTR(015:016,&STR(&TMSRPT))
        END
    IF &SYSINDEX(&STR(DSN=&TDSN),&STR(&TMSRPT)) = 50 THEN +
        DO
            SET VOLSER   = &SUBSTR(016:021,&STR(&TMSRPT))
            SET FILESEQ  = &SUBSTR(032:034,&STR(&TMSRPT))
            SET EXPDT    = &SUBSTR(043:047,&STR(&TMSRPT))
            SET NEXTDSNB = &SUBSTR(109:114,&STR(&TMSRPT))
            GETFILE TMSRPT
            SET CJOB     = &SUBSTR(014:020,&STR(&TMSRPT))
            SET STPNAME  = &SUBSTR(032:039,&STR(&TMSRPT))
            SET CRTDT    = &SUBSTR(048:052,&STR(&TMSRPT))
            SET CTIME    = &SUBSTR(061:064,&STR(&TMSRPT))
            SET FLAG1    = &SUBSTR(073:074,&STR(&TMSRPT))
            SET F1STVOL  = &SUBSTR(085:090,&STR(&TMSRPT))
            GETFILE TMSRPT
            SET RECFM    = &SUBSTR(015:016,&STR(&TMSRPT))
            SET LRECL    = &SUBSTR(025:029,&STR(&TMSRPT))
            SET BLKSIZE  = &SUBSTR(040:044,&STR(&TMSRPT))
            SET BLKCNT   = &SUBSTR(054:059,&STR(&TMSRPT))
            SET READERR  = &SUBSTR(070:072,&STR(&TMSRPT))
            SET WRITERR  = &SUBSTR(083:085,&STR(&TMSRPT))
            SET EOF = YES
        END
    GETFILE TMSRPT
END

ERROR OFF
CLOSFILE TMSRPT
FREE DD(TMSRPT)

WRITE VOLSEQ      &VOLSEQ
WRITE ACCT        &ACCT
WRITE CUNIT       &CUNIT
WRITE LJOB        &LJOB
WRITE LDATE       &LDATE
WRITE LUNIT       &LUNIT
WRITE FIRSTVOL    &FIRSTVOL
WRITE NEXTVOL     &NEXTVOL
WRITE PREVVOL     &PREVVOL
WRITE NUMDSNB     &NUMDSNB
WRITE FRSTDSNB    &FRSTDSNB
WRITE FLAG2       &FLAG2
WRITE BATCHID     &BATCHID
WRITE LABEL       &LABEL
WRITE DEN         &DEN
WRITE TRTCH       &TRTCH
WRITE OUTCODE     &OUTCODE
WRITE OUTDATE     &OUTDATE
WRITE SLOT        &SLOT
WRITE CLNCNT      &CLNCNT
WRITE DATECLN     &DATECLN
WRITE USECLN      &USECLN
WRITE BTHDATE     &BTHDATE
WRITE COUNT       &COUNT
WRITE FLAG3       &FLAG3
WRITE VOLSER      &VOLSER
WRITE FILESEQ     &FILESEQ
WRITE EXPDT       &EXPDT
WRITE NEXTDSNB    &NEXTDSNB
WRITE CJOB        &CJOB
WRITE STPNAME     &STPNAME
WRITE CRTDT       &CRTDT
WRITE CTIME       &CTIME
WRITE FLAG1       &FLAG1
WRITE F1STVOL     &F1STVOL
WRITE RECFM       &RECFM
WRITE LRECL       &LRECL
WRITE BLKSIZE     &BLKSIZE
WRITE BLKCNT      &BLKCNT
WRITE READERR     &READERR
WRITE WRITERR     &WRITERR

EXIT

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


Documentation


 The $TINFO utility is designed to work with the ISPF DSLIST (a.k.a "=3.4")
 screen in that you can place $tinfo next to a dataset name on the 3.4 screen,
 press , and it will process.  $TINFO's function is to query the TMS
 (Tape Management Software) system and return information such as create date,
 create job, offsite status, etc. for a tape dataset.

 For instance, if you are going to submit a job to process against one of the
 "DAILY" tapes, you can use $TINFO to determine if the tape is onsite or offsite
 before you submit a job.  You might also want to know the create date of one of
 these tapes to make sure you process against the correct one.
            


Leave a Reply

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