Components of the DSFS tree

Figure 1. DSFS directory structure
DSFS tree structure

Start of changeThe DSFS tree has four conceptual levels: root, path, HLQ directory, and data sets.End of change

Root directory

Mount the utility file system at /dsfs in the z/OS® UNIX file system tree, which results in the root of the DSFS tree at path /dsfs. Because this directory is read-only, users cannot store files or directories in it. DSFS places the /txt, /bin, and /rec path directories in this directory at mount time if they are not already present.

All DSFS users have access to the root directory.

Path directory

The path directories determine the processing mode of data sets that are accessed through that path. These directories are automatically created by DSFS if they do not exist in the utility file system. Three processing modes (binary, record, and text) are available with DSFS. All users of DSFS are allowed access to a path directory.
Binary (/bin)
Data sets that are accessed by this path are treated by DSFS as binary data. When a data set is opened by DSFS on behalf of users who are accessing the data set through this path, DSFS reads the records from the data set. Next, it stores the records sequentially in a file in the utility file system as a POSIX byte stream. Updates made by applications to this file are stored in the utility file system file. When the application closes the file, DSFS writes the data to the data set, storing the bytes into sequential records in the data set.
  • For variable-length records, the maximum record size is used for each record except for the last record, which can be partial.
  • For fixed records, the last record is padded with binary zeros if the last record was short.
Record (/rec)
Data sets that are accessed by this path are treated by DSFS as z/OS record format files. When it accesses a data set, DSFS prepends a 4-byte header to each record it reads from the data set and stores the updated records into the POSIX file that is used to represent the data set.
  • For fixed record data sets, each header must specify a length equal to the LRECL of the data set.
  • For variable-length data sets, each header is used to determine the size of the record that is written to the data set.
Text (/txt)
Data sets that are accessed by this path are treated by DSFS as text files. Upon access to a data set, DSFS reads each record from the data set. If it is in fixed format, it strips the trailing blanks. For both fixed and variable record formats, it appends a newline character to the end of the record in the POSIX byte stream. Updates made by applications to this file are stored in the corresponding utility file system file. When applications close the file, DSFS scans the file’s byte stream for newline characters, where each newline character delineates records to be written to the data set. The newline character is not written to the data set. For fixed-length record data sets, DSFS pads with blanks each record to ensure it matches the LRECL.

High-level qualifier directories

DSFS places a high-level qualifier Start of changedirectory nameEnd of change in a path directory if the user application changes the working directory or uses a path name that specifies the Start of changehigh-level qualifier directory nameEnd of change in that path. Start of changeA HLQ directory name can consist of one or more qualifiers of a data set name. Once a HLQ directory has been created, it can only be deleted if the HLQ directory name is excluded by the HLQ list. End of change

Restriction: Start of change New HLQ directories are created only when there is at least one existing PDS, PDSE, or sequential data set whose name begins with the HLQ directory name.End of change
Tip: Start of changeUsers might want to use more than one qualifier to reduce the amount of catalog processing needed to populate or refresh the HLQ directories.End of change

Start of changeTo control the data sets that DSFS can add to its tree, the administrator can create a list of excluded HLQ directory names by using both the HLQ_LIST parameter in the IDFFSPRM file and the dsadm config -hlq_list_add or -hlq_list_remove command. The user must have authority to the DFSMS catalog that contains the high-level qualifiers to access the HLQ directory. Upon first access, DSFS will populate the HLQ directory in its utility file system with names of supported data sets whose names begin with the HLQ directory name and have at least one other qualifier. The supported data sets are fixed or variable record PS/PDS/PDSE.End of change

Restriction: In order to add names of encrypted data sets that begin with the Start of changeHLQ directory nameEnd of change, the DSFS utility file system must be encrypted.

The names that appear in the data set level of the DSFS directory tree do not have the Start of changeHLQ directory nameEnd of change portion of the data set name. In Figure 1, physical sequential data set scott.file1.out is represented as a file called file1.out in the HLQ directory named scott. Start of changeThe sequential data set scott.file1.out could also be accessed as scott.file1/out if scott.file1 were used as the HLQ directory name.End of change

Start of changeThe same HLQ directory names can be accessed from multiple paths to allow different data sets of that HLQ directory name to be processed in different formats. Dynamic allocation (DYNALLOC) and ENQUEUE (ENQ) serialization is used to prevent the same data set from being processed by multiple paths at the same time. Similarly, this serialization is also used to prevent the same data set from being processed by multiple HLQ directories at the same time.End of change

Creation parameters

With the dsadm createparm command, users can specify the data set attributes to use when PS or PDS/PDSE data sets are created. Creation parameters are assigned to an HLQ directory and apply to all data sets created with the same Start of changeHLQ directory nameEnd of change.

Start of changeThese creation parameters are permanently stored in the utility file system and associated with the HLQ directory. They are permanently stored in the utility file system for the directory that represents the high-level qualifier directory name. The user ID of the issuer of the dsadm createparm command must match the HLQ in order to set or replace the creation parameters.End of change

Data sets

The data sets belonging to an Start of changeHLQ directoryEnd of change that is accessed by a DSFS user has a corresponding file (PS) or directory (PDS or PDSE) created inside the HLQ directory with the Start of changehigh-level qualifier directory nameEnd of change removed. Names appear in lowercase, but users can access the names by using uppercase, lowercase, or mixed-case because DSFS is case-insensitive.
Note: Using lowercase is preferable when accessing the names. If you use mixed case or uppercase, shell processing might not find the specified files or directories, especially when wildcards are used. For example, if you have a file that is named my.file in the POSIX shell, you will see the following lines:
# ls my*                                                 
my.file                                                                  
# ls -l my*                                              
-rwxrwxrwx    1 BPXROOT  SYS1           1 Jul 23 00:00 my.file     
# ls -l My*                                              
ls: FSUM6785 File or directory "My*" is not found                            
# ls -l My.file                                      
-rwxrwxrwx    1 BPXROOT  SYS1           1 Jul 23 00:00 My.file  
Any access to a data set is run under the requesting user's credentials to ensure that they have proper access. If access is made to a cached DSFS file system object (for example, a PS data set was read-in and stored in the corresponding file in the DSFS utility file system), then DSFS will make an explicit SAF call to ensure that the user has appropriate authority.

Users can create, rename, and remove data sets with the standard UNIX commands such as rm or mv.

Partitioned data sets (PDS and PDSE) are represented as directories in DSFS, with the members represented as files in DSFS. Users can read, write, rename, create, and remove members.