The VTOC TSO command displays information from the Volume Table of Contents of selected DASD. It allows an incredible permutation of various selection criteria, yielding a very powerful command for your toolbox.
It is located in File #112 of the older version #129 CBT tape. It was written by R. L. Miller of Fireman's Fund Insurance in San Rafael, CA. There is a later version of VTOC on the more current versions of CBT, but they require modification in order to install/use on MVS 3.8j, and this version is quite acceptable on our older version of MVS.
January, 2025 Update: Rob Prins sent me his updated version of the VTOC command from CBT File #112. His changes add the UNIT name and RACF and UPDATE indicators. The original version was also not always displayiung all datasets, which he has corrected.
The JCL to assemble and link the VTOC command contains a single jobstream that:
and then deletes the PDS created in the first step. If you do not have SYS2.CMDLIB and SYS2.HELP defined on your system, you can edit the jobstream, replacing these names with SYS1.CMDLIB and SYS1.HELP before submitting it.
The installation jobstream - vtoc$.jcl - is contained in the archive ../downloads/archives/vtoc.tar.gz [MD5: ef5aa7f732b9fd193ca196f75d815794]. Download the archive and extract the jobstream (WinZip on Windows/?? or tar on Linux). Submit the jobstream and you are done. The output from the job run on my system may be viewed at: vtoc.pdf.
The help text provided for VTOC is quite thorough, so I have simply reproduced it here (with some formatting changes to make it more readable). There was one option that took me a while to figure out - specifying multiple volumes - so I have added an example of that below.
Syntax - VTOC 'VOLUME-LIST' LEVEL('DSNAME-START') EXLEVEL('DSNAME-START') CONTAINING('DSNAME-STRING') ENDING('DSNAME-END') BREAK('BREAK-CHARS') CAT ENQ TRK/CYL/KB/MB NOSORT/SORT('SORT-FIELDS') NOPRINT/PRINT('PRINT-OP' ('PRINT-ITEM-LIST')) LIMIT('KEYWORD' 'OPER' 'VALUE') AND1/OR1('KEYWORD' 'OPER' 'VALUE') AND2/OR2('KEYWORD' 'OPER' 'VALUE') AND3/OR3('KEYWORD' 'OPER' 'VALUE') CHARS('CHARS-PER-LINE') LINES('LINES-PER-PAGE') NOHEADING/HEADING('TEXT') DSNLEN('LENGTH') Required - 'VOLUME-LIST' Defaults - list all datasets on the volume(s) selected. SORT, PRINT, TRK Operands -
'VOLUME-LIST'A volume serial number or a list of volume serial numbers. If the first one to five characters of a volume serial number are entered, all volumes that are mounted on the machine which start with those characters will be listed. If 'ALL' is specified, all non-virtual volumes which are online and ready will be processed. If 'ALV' is specified, all virtual volumes which are online and ready will be processed, if they are mounted PRIVATE/RESERVED or PRIVATE/RESIDENT. LEVEL('DSNAME-START')Specifies the high level qualifiers to be searched. This will not be prefixed by your USERID or prefix. Only datasets starting with these prefixes will be listed. EXLEVEL('DSNAME-START')Specifies the high level qualifiers to be omitted. This will not be prefixed by your USERID or prefix. Datasets starting with these prefixes will not be listed. CONTAINING('DSNAME-STRING')Specifies a character string contained in the dataset name. At least one of the strings must be in the DSName for the dataset to be listed. These strings must conform to DSName standards. They cannot begin with a period or a number. ENDING('DSNAME-END')Specifies the ending characters of the DSName. The final nonblank characters of the DSName must be one of these strings to allow the dataset to be listed. These strings must conform to DSName standards. CATA locate is done for each DSName on the volumes listed and status is indicated. Note - this option uses a considerable amount of processing time. C - catalogued on this volume
N - not catalogued
W - catalogued on another volume
E - catalog processing error ENQA test is performed for an ENQ with a major name of SYSDSN and a minor name of the dataset name to find out if the dataset is in use. If the dataset is VSAM the cluster name is located and used for the ENQ test. Note - This option uses a lot of processing time.
N - NOT ENQUEUED
S - ALLOCATED WITH DISP=SHR
E - EXCLUSIVELY ALLOCATED
? - CATALOG PROCESSING ERROR
* - ENQUEUE PROCESSING ERROR TRKSpace is to be reported in TRACK units. CYLSpace is to be reported in CYLINDER units. KBSpace is to be reported in KILOBYTE units. MBSpace is to be reported in MEGABYTE units. NOSORTThe datasets are not sorted. They are output as they are found. SORT('SORT-FIELDS')Datasets are sorted into alphabetical order, based upon the sort fields specified. DSNAME, VOLUME, ALLOC, USED, UNUSED, PCT, EX, DSO, RFM, LRECL, BLKSZ, CDATE, EXPDT, REFDT are valid sort fields.
'A/D' are required after each sort field to indicate ascending/descending sequence.
BREAK('BREAK-CHARS')The listing will contain a new header (on a new page if the VTOCOUT DD card option is used), whenever the specified number of characters differs from the preceding dataset. This option functions only with the SORT option. CHARS('CHARS-PER-LINE')Specifies the number of characters on each line of output. The default is 150 for print and the LINESIZE of the terminal for TSO sessions. You can get more information by specifying a larger number of characters per line or you can limit the printing by setting a smaller number of characters per line of output. LINES('LINES-PER-PAGE')Specifies the number of lines before a new title line is produced. It defaults to 60 for print and to the screen size for TSO sessions. NOHEADINGDo not produce a heading. The heading will only be output if the VTOCOUT DD statement is present. HEADING('TEXT')If a DD statement with a DDName of VTOCOUT is present, this text will be used to begin every page. Carriage control should be included (ASA). The default header consists of VTOC COMMAND VERSION 02 and the command that was entered. NOTOTALSDo not produce a totals line. The totals line will be omitted even if the VTOCOUT DD statement is present. The default is to produce one final total line. DSNLEN('LENGTH')Specifies the length of the DSName to print. The rest of the DSName is truncated. The CHARS parameter will also cause the DSName to be truncated, if the name and the preceding information exceeds the print line. NOPRINTSpecifies that individual items are not to be listed. The command can be used to calculate totals from the selected datasets. PRINT('PRINT-OP' ('PRINT-ITEM-LIST'))Specifies the items to print. The 'PRINT-OP' is the operation to be done. They include the following: NEW - The 'PRINT-ITEM-LIST' is a complete list of what to print.
REP - The first 'PRINT-ITEM' will be replaced with the rest of the items on the list.
ADD - The rest of the 'PRINT-ITEM-LIST' will be added after the first item on the list.
DEL - The items on the 'PRINT-ITEM-LIST' will not be printed.
The 'PRINT-ITEM-LIST' names are the same keywords used in LIM, AND, and OR functions and are also the titles as printed. These keywordsd can be: ALLOC, UNUSED, USED, PCT, EX, DSO, RFM, BLKSZ, LRECL, CDATE, EXPDT, REFDT, SECT, PASS, ROUND, CCHH, VOLUME, UNIT, DSNAME, ACTION,
TYPE, RACF OR UPD.The ADD, DEL, and REP print operations refer to the default print list. The default list is ALLOC, UNUSED, PCT, EX, DSO, RFM, BLKSZ, LRECL, REFDT, CDATE, VOLUME, DSNAME, EXPDT, SECQ, SECT, ROUND, PASS, ACTION, and TYPE.
As noted under CHARS above, only the items that will fit on the print line will be listed.
NOTE: If CCHH is chosen it defaults to the CCHH range of the first extent; however, if LIM/AND/OR selection is performed, the CCHH range of the extent which satisfies the selection will be used instead.
LIMIT('KEYWORD' 'OPER' 'VALUE')Specifies which datasets are to be listed. Only datasets that satisfy the relation are listed.
'KEYWORD' can be: ALLOC, UNUSED, USED, PCT, EX, DSO, RFM, BLKSZ, LRECL, CDATE, EXPDT, REFDT, SECT, PASS, ROUND, CCHH, VOLUME, UNIT, DSNAME, ACTION, TYPE, RACF OR UPD.
'OPER' can be: EQ, NE, LE, LT, GE OR GT.
'VALUE' can be a comparison value such as: FB, PS, R or a number like 51. 'KEYWORD'Is the name of a dataset field. The list of currently provided fields follows. The keywords and their values are the same as in teh VTOC output. ALLOC - dataset allocation, number of KILOBYTES, TRACKS, CYLINDERS, or MEGABYTES allocated. Default is in TRACKS.
UNUSED - amount of unused space in the dataset. Same units as in ALLOC.
USED - amount of space used in the dataset. Same units as in ALLOC.
PCT - percentage of space used in the dataset.
EX - number of extents in the dataset.
DSO - dataset organization - PS=sequential, PO=partitioned, VS=VSAM, IS=ISAM, DA=Direct Access, U=Unmoveable
RFM - record format - F=fixed, V=variable, U=undefined, B=blocked, T=track overflow, S=spanned or standard, A=ASA carriage control, M=Machine carriage control
BLKSZ - blocksize for physical blocks of data
LRECL - logical record length in bytes
CDATE - create date in the form YYDDD, sometimes called Julian
EXPDT - expiration date in the same form
REFDT - last use date in the same form; this date is when the dataset was last opened
SECT - type of allocation - A=absolute track, B=blocks, T=tracks, C=cylinders
PASS - protection indicators - N=none, R=read and write protection, W=write protection
ROUND - space rounded up to cylinders - R=round, N=no round
CCHH - cylinder and head address, in 4 or 8 hexadecimal digits. If 4 digits are used, only the cylinder is used for comparison, otherwise, the CYL and TRACK are compared.
VOLUME - volume serial or disk name
UNIT - unit or device typeDSNAME - name of the dataset
ACTION - some error indications
TYPE - reserved for exit usage
RACF - RACF indicator - N=not indicated, Y=indicated
UPD - updated since last backup - N=not updated, Y=updated
'OPER'Is an operator. The list of operators follows: EQ - is equal to
NE - is not equal to
LE - is less than or equal to
LT - is less than
GE - is greater than or equal to
GT - is greater than 'VALUE'Gives the value of the item for comparison, such as FB, PS, R, or a number. AND1('KEYWORD' 'OPER' 'VALUE')Specifies which datasets are to be listed. Both the limit and this condition must be true to allow the listing. KEYWORD, OPER, VALUE as described above. OR1('KEYWORD' 'OPER' 'VALUE')Specifies which datasets are to be listed. Either the limit or this condition must be true to allow the listing. KEYWORD, OPER, VALUE as described above. AND2('KEYWORD' 'OPER' 'VALUE')Specifies which datasets are to be listed. Both the previous result and this condition must e true to allow the listing. KEYWORD, OPER, VALUE as described above. OR2('KEYWORD' 'OPER' 'VALUE')Specifies which datasets are to be listed. Either the previous result or this condition must be true to allow the listing. KEYWORD, OPER, VALUE as described above. AND3('KEYWORD' 'OPER' 'VALUE')Specifies which datasets are to be listed. Both the previous result and this condition must e true to allow the listing. KEYWORD, OPER, VALUE as described above. OR3('KEYWORD' 'OPER' 'VALUE')Specifies which datasets are to be listed. Either the previous result or this condition must be true to allow the listing. KEYWORD, OPER, VALUE as described above.
Examples -
List all datasets on volume VTOC <VOL>List all datasets on all volumes VTOC ALLList all datasets that start with XXX on any MVSXXX volume VTOC MVS LEV(XXX)List all datasets containing LIST not beginning with SYS1 VTOC VOL CONT(LIST) EXLEV(SYS1)List all recently created datasets VTOC VOL LIM(CDATE GT 94001)List datasets with unused space VTOC VOL LIM(PCT LT 50) - OR1(UNUSED GT 30)List datasets with multiple extents VTOC VOL LIM(EX GT 1)List all of user's datasets on TSO0001 VTOC TSO001 LEVEL(TMTCEXX)List all datasets over 100 tracks VTOC VOL LIM(ALLOC GT 100)List datasets in VTOC sequence VTOC STR902 NOSORTList datasets under the fixed heads VTOC VOL LIM(CC EQ 0001) - OR1(CC EQ 0002)List old PDS's with free space VTOC VOL LIM(CDATE LT 92001) AND1(DSO EQ PO) AND2(UNUSED GT 30)List used space instead of unused, in tracks VTOC VOL PRINT(REP (UNUSED USED)) TRKList CLIST datasets VTOC VOL END(CLIST)List all of the information about user's datasets at a 3270 VTOC VOL CHAR(150)Check if datasets are catalogued on this volume VTOC VOL CAT PRINT(NEW (ALLOC PCT CAT DSNAME))List any dataset on a bad track VTOC STR902 LIM(CCHH EQ 003C0003) PRINT(REP (REFDT CCHH))List any dataset on a bad cylinder VTOC STR902 LIM(CCHH EQ 003C) PRINT(REP (REFDT CCHH))List all datasets on 335XXX volumes sorted by ALLOC in descending sequence, VOLUME and DSNAME in ascending sequence VTOC 335 SORT(ALLOC,D,VOLUME,A,DSNAME,A)List all datasets beginning with SYS2 on volumes MVSRES and SMP001 VTOC (MVSRES SMP001) LEVEL(SYS2)
I hope that you have found my instructions useful. If you have questions that I can answer to help expand upon my explanations and examples shown here, please don't hesitate to send them to me:
This page was last updated on January 07, 2025 .