You can check on existing file allocations using the command ? TSO DDNAME. This can be done in the following ways:
Command |
Function |
---|---|
? TSO DDNAME |
Lists allocated files. Produces a listing on file SYSPRINT even if you issue the OFFLINE command. |
? TSO DDNAME ddname |
Lists file attributes. Produces a listing on file SYSPRINT even if you issue the OFFLINE command. |
-? TSO DDNAME ddname |
Places file attribute information into Dialogue Manager variables. Attributes are returned as values for Dialogue Manager variables. |
How to: |
The ? TSO DDNAME command lists all the currently allocated files by ddname, shows the number of occurrences for each and lists their corresponding data set names. It displays currently allocated files.
? TSO DDNAME
The following is sample output from a ? TSO DDNAME command.
DDNAME OCCURRENCES DSNAME STEPLIB 2 EDA.V3R2M01.EDALIB.LOAD INPDQ.PROC.PROCLIB MASTER 1 EDA.V3R2M01.EDAMFD.DATA FOCEXEC 1 EDA.V3R2M01.EDAMFD.DATA ERRORS 1 EDA.V3R2M01.EDAMSG.DATA FOCSORT 1 SYS88229.TO95540.RA000.INPDQ.R0000002 OFFLINE 1 TSOINFOC.TSOINFOC.OFFLINE SYSUT1 1 SYS88229.TO95058.RA000.INPDQ.SYSUT1 SYSEDIT 1 SYS88229.T095058.RA000.INPDO.EDIT HOLD 1 SYS88229.TO95058.RA000.INPDQ.R0000003 HOLDMAST 1 SYS88229.T095044.RA000.INPDQ.R0000004 CAR 1 EDA.V3R2M01.CAR.FOCUS
The DDNAME column lists all allocated file names (ddnames). The OCCURRENCES column shows how many data sets are allocated to the corresponding ddname. This number will be one unless two or more data sets are concatenated under the ddname. The DSNAME column shows the fully qualified data set name (DSN) corresponding to the ddname. For concatenated data sets, all the data set names are shown.
How to: |
The ? TSO DDNAME ddname command displays attributes of the queried file name (ddname). If the specified ddname was not allocated, the command displays the attributes as either blanks or zeroes.
? TSO DDNAME ddname
where:
Is the ddname whose attributes you want to display. You may specify up to eight characters. You may also create a general list of allocated files by ddname by specifying a wildcard character (* or ?) with part of the ddname.
The following is sample output from a ? TSO DDNAME ddname command.
DDNAME = CAR DSNAME = EDA.VSR2M00.CAR.FOCUS DISP = OLD DEVICE = DISK VOLSER = TSOPAK DSORG = PS RECFM = F SECONDARY = 1 ALLOCATION = TRACKS BLKSIZE = 4096 LRECL = 4096 TRKTOT = 2 EXTENTSUSED = 1 BLKSPERTRK = 10 TRKSPERCYL = 15 CYLSPERDISK = 886 BLKSWRITTEN = 20 FOCUSPAGES = 8
Reference: |
The -? TSO DDNAME ddname command places file attribute information in Dialogue Manager variables instead of displaying the information on the terminal. These Dialogue Manager TSO system variables have the same names as the attributes returned by the ? TSO DDNAME ddname command. For a complete list of these variables, see Dialogue Manager TSO System Variables.
If there is no information for a variable, the variable will contain blanks if it is an alphanumeric variable. If it is a numeric variable, the variable will contain zeroes.
TSO System Variable |
Description |
---|---|
&DDNAME |
Queried file name (ddname). |
&DSNAME |
Fully qualified data set name. For concatenated data sets, only the first data set name is returned. |
&DISP |
Disposition: OLD, NEW, MOD, or SHR. |
&DEVICE |
DISK, TAPE, TERM, or READER-PRINTER. |
&VOLSER |
Disk or tape volume serial number. |
&DSORG |
Data set organization: PS (sequential), IS (indexed sequential), PO (partitioned), U (undefined), or DA (direct). |
&RECFM |
Record format, for example, F, FB, V, VB. |
&SECONDARY |
Quantity specified for secondary allocations. |
&ALLOCATION |
Unit of secondary allocation: TRACKS, BLOCKS, or CYLINDER. |
&BLKSIZE |
Blocksize. |
&LRECL |
Record length, in bytes. |
&TRKTOT |
Total number of currently allocated tracks, spanning both primary and secondary allocation. |
&EXTENTSUSED |
Total number of currently allocated extents (max 16). |
&BLKSPERTRK |
The number of blocks (of BLKSIZE bytes) that can be written onto 1 track of the device. |
&TRKSPERCYL |
The number of tracks per cylinder for the device. |
&CYLSPERDISK |
The number of cylinders per disk for the device. |
&BLKSWRITTEN |
The total number of blocks in the data set, assuming that all blocks are BLKSIZE long. |
&FOCUSPAGES |
Posted only for FOCUS data sources. This number is the total number of 4096-byte pages in the data source. This is the same as the total number of pages shown by the ? FILE file name command. It is also the same as the highest page number shown by the ? FDT file name command. It does not include SHADOW pages and directory. |
1. -? TSO DDNAME &DD.ENTER DDNAME. 2. -IF &DSNAME EQ ' ' GOTO ALLOCATE; -TYPE DATASET &DSNAME ALLOCATED TO &DD -EXIT -ALLOCATE . . .
The process is as follows:
For detailed information on Dialogue Manager commands and variables, see Managing Flow of Control in an Application.
If you attempt to issue the -? TSO DDNAME command remotely on MVS EDA from a WebFOCUS Windows Server, the following error message is generated:
(FOC303) CONTROL LINE NOT RECOGNIZED IN FOCEXEC: -? TSO DDNAME MASTER
When sending the -? TSO DDNAME command from a Windows Server to MVS, you must place -? TSO DDNAME and a -TYPE command (to display the results in Windows), in a procedure (FOCEXEC) between -REMOTE BEGIN and -REMOTE END, as follows:
-REMOTE BEGIN ex Remote.fex -REMOTE END
The Remote.fex procedure, which will execute on MVS and send the results back to windows, must contain the following:
-? TSO DDNAME -TYPE &DDNAME &DISP ...
You can run Remote.fex from another procedure, or the Command Console.
How to: |
Since you can logically erase an existing data set by issuing a CREATE command against it, it is necessary to have a means of testing for the existence of an Operating System data set before issuing the CREATE command.
? {MVS|TSO} DSNAME datasetname
where:
Is the data set name. If you supply only the unqualified data set name, the prefix from the profile is taken to create a fully qualified data set name. Do not specify member names.
-? TSO DSNAME dsname
where:
Is the data set name.
In this case, there is no output message. The system variable &RETCODE is set and must be tested for the outcome. The possible results follow:
&RETCODE Value |
Equivalent TIBCO FOCUS Code/Message |
---|---|
0 |
(FOC488) Dataset is in catalog: |
4 |
(FOC489) Dataset is in catalog, but not on volume indicated: |
8 |
(FOC490) Dataset is not in catalog: |
You can use the file attribute information returned by the ? TSO ddname command to determine the number of records in the data set and to estimate how much available space is left on the currently allocated tracks.
Note: The estimates obtained from the following formulas are approximations and do not take into account space reused after it was logically vacated by deleted segments.
Available pages (without additional extents) = BLKSWRITTEN - FOCUSPAGES BLKSWRITTEN = BLKSPERTRK x TRKTOT
RECSPERBLK = BLKSIZE/LRECL No. of records = BLKSWRITTEN x RECSPERBLK No. of free blocks = (TRKTOT x BLKSPERTRK) - BLKSWRITTEN
The formulas for fixed-block data sets (that is, SAVE files) usually apply to variable-length blocked (VB) data sets as well. This is true because VB data sets usually have the same length blocks even though the description implies otherwise.
(FOCUSPAGES x 2) + 3