ZDSATTR Function: z/OS

Returns the attributes for the data set name that is specified in the input variable according to the type of request.
Category: External Files
z/OS specifics: info-item


zdsattr(variable name, <option>);

Required Argument

variable name
specifies the name of the variable that is created by ZDSIDNM.

Optional Argument

specifies that either File or Volume attributes can be requested for sequential data sets or partitioned data sets. The specification can be entered as File, Vol, Vols, F, V, FV, VF, ALL, or null. ALL, or its equivalent FV, is the default. Invalid options are ignored.
Note:ZDSATTR returns attributes for sequential data sets, partitioned data sets, VSAM data sets, or UFS files. It returns attributes for up to 20 volumes. The actual volume count is displayed at the start of the attribute display.


Invoking ZDSATTR

Use the following method to invoke the ZDATTR function:
length xattr $4096;
xattr = zdsattr(variable name, option); 

File Attributes

The following attributes are returned for a file:
Creation Date Management Class
Expiration Date Storage Class
Last Referenced Date DSNTYPE
Data Set Organization Record Format
EATTR option Logical Record Size
Compressible option Blocksize
Data Class

Volume Option Attributes

The following attributes are returned for a volume. The attributes are returned for up to twenty volumes that are in a list.
Volume Serial Allocated Extents
Device Type Allocated Unit
Unit of Allocation Used Extents
Device Name Used Unit
Primary Allocation Volume Sequence Number
Secondary Allocation EAV Volume
When more than one volume is assigned to a z/OS data set, a Volume Summary with the following attributes is returned after the individual volume attributes:
Allocated Extents
Allocated Unit
Used Extents
Used Unit
Note: The term Unit is replaced by Tracks, Cylinders, Blocks, Bytes, Kilobytes, or Megabytes, according to the allocation type of the data set.
In addition to the preceding attributes, the following attributes are returned if a partitioned data set is specified, whether the data set is a PDS or PDSE:
Maximum Directory Blocks
Used Directory Blocks
Number of Members
For PDSE data sets, the Maximum Directory Blocks value is marked UNLIMITED. Used Directory Blocks and Number of Members are returned for both types of partitioned data set. For PDSE, the Volume attributes Used Extents and Used Unit are marked with the value N/A.

VSAM Attributes

A VSAM cluster can have at least one associated data set (DATA) and possibly more. The associated data sets can include an INDEX data set, AIX data sets, and a PATH data set. These data set names are output as a group before the CLUSTER attributes are output. Typically, the variable created by zdsidnm() and input to zdsattr() contains the cluster name and associated names, if they conform to the data set name structure of the cluster and to the filter specified to zdslist(). In this case, the individual attributes of each of the associated data sets are output. If the names do not conform, so that they are not passed via the zdsidnm() variable, then the user needs to input them as a separate filter.
The following attributes are returned for a VSAM cluster:
Creation Date Storage Class
Expiration date LOG value
Data Class LOGSTREAMID specified – Yes/No
Management Class BWO value
The following attributes are returned for a VSAM data or index component:
Type of data set AIX Key Relative Position
EATTR option – Yes/No SHROPTNS
Compressible option – Yes/No Stripe Count
Average LRECL Allocation Unit
Maximum LRECL Primary Allocation
Buffer Space Secondary Allocation
Free Space Logical Records
CI Size Records Deleted
CI/CA Records Inserted
Extended Addressability – Y/N Records Updated
Extended Format – Y/N Records Retrieved
Key Length VSAM Options
Key Relative Position
Note: No more than thirteen VSAM options are returned.
The following VSAM volume attributes are returned:
Volume Serial % Used
Devtype Physical Record Size
Allocated Extents Volume Type
Allocated Tracks (Cylinders) EAV volume – Y/N

UFS Attributes

If a file is a directory and the input variable from ZDSIDNM contains an entry list within ellipses, then a UNIX Directory Entry List is displayed following the attribute display. The file size for a directory is displayed as a string of ‘*’. The attributes that are displayed are similar to those that are displayed by the FINFO and DINFO functions.
The following attributes are displayed for UFS:
File Type File Size
Access Permissions Status Change Date
Number of Links Last Access Date
Owner Name Last Modified Date
Group Name


length xdsn $4096;
xdsn=zdslist(‘catlg’, ‘userID.sas.*’, ‘’, ‘’);
length xnum 8;
length xidnm $256;
length xattr $4096;
do i = 1 to xnum;
	   xidnm=zdsidnm(xdsn, i);
	   xattr=zdsattr(xidnm, ‘ALL’);
The output format for the ZDSATTR function is a character variable that contains attributes. The format of the display within the variable is as 72-byte lines that contain a 44-byte value, a 25-byte descriptor, and three trailing bytes of empty spaces. For UFS files, the data set name display can overlap several lines. The first line of the attributes, the count of attributes, is converted by a subsequent function, ZDSXATT, for use as a DATA step loop counter while individual attributes are displayed.
Value						          Descriptor

zoned decimal count of attributes
cccccc.ccc.ccc (data set name)					
nn						              Total Volume Count
** FILE ATTRIBUTES **       
	File attributes as above		    File attribute descriptors
	Volume attributes – volume 1		Volume attribute descriptors
	Volume attributes – volume n		Volume attribute descriptors
If a data set resides on more than one volume, then a Volume Summary such as the following example is returned:
*** Volume Summary ***
Allocated Extents
Allocated Unit
Used Extents
Used Unit
*** End Volume Summary ***
For VSAM, the following output is added:
User Catalog Name
For a VSAM cluster, the following output is deleted :
Total Volume Count
And the following line is added:
Associated Data Set Names
Followed by VSAM Cluster Attributes:
   Cluster attributes
The following output is returned for VSAM Data or VSAM Index:
For a UFS file, the following output is deleted :
Total Volume Count
And these attributes are displayed:
If the filename is a directory and an entry list is present, then the following output is returned:
	Entry list, within ellipses