Reviewing Attributes of Allocated Files Under MVS

In this section:

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.



x
Displaying Allocated Files With ? TSO DDNAME Under MVS

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.



x
Syntax: How to Display Allocated Files With ? TSO DDNAME
? TSO DDNAME


Example: Displaying Allocated Files With ? 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.


Top of page

x
Displaying File Attributes With ? TSO DDNAME ddname Under MVS

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.



x
Syntax: How to Display File Attributes With ? TSO DDNAME ddname
? TSO DDNAME ddname

where:

ddname

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.


Top of page

x
Displaying File Attributes With ? TSO DDNAME 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

Top of page

x
Placing File Attributes in Dialogue Manager Commands

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.



x
Reference: Dialogue Manager TSO System Variables

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.



Example: Using TSO ddname Variables
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:

  1. The command prompts you for the ddname. The information that is entered from the terminal is then placed in the variable &DD. Depending on the value of &DD, the system supplies the information for the variable &DSNAME. If no data set is allocated to the ddname that was supplied, the variable &DSNAME will contain a blank since it is alphanumeric.
  2. The command tests if the variable &DSNAME is a blank. If it is blank (that is, no data set was found for the ddname entered by the operator), the procedure jumps to the label -ALLOCATE and continues. If it is not blank (that is, a data set was found for the ddname entered by the operator), the procedure prints a message stating the name of the data set and exits.

For detailed information on Dialogue Manager commands and variables, see Managing Flow of Control in an Application.



x
Reference: Issuing the -? TSO DDNAME Command From a Windows Server

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.


Top of page

x
Determining If a Data Source Exists Under MVS

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.



x
Syntax: How to Test for a Data Set
? {MVS|TSO} DSNAME datasetname

where:

datasetname

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.



x
Syntax: How to Test for a Data Set in Dialogue Manager
-? TSO DSNAME dsname

where:

dsname

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 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:



x
Estimating Data Set Sizes to Determine Available Space Under MVS

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.


WebFOCUS