Unix File Systems in z/OS
Part Two - Challenge #11

Background:

The previous challenge explained how newly allocated data set names are "cataloged".
As a result, only the data set name is required for z/OS to locate the requested data set name among the thousands of disk volumes storing data set names.

Unix file names are excluded from the Master Catalog and User Catalogs.
However, the z/OS Catalog structure can locate the Unix file system directory containing Unix file names.


How are Unix file names located?

The simpliest answer is that Unix file names are located the exact same way that Unix file names are located in any Unix.

  • Think tree trunk with many branches
  • Unix has one and only one root directory ( / )
      * the tree trunk
  • A Unix file system consists of a directory structure
      * the branches
  • A directory structure means that a directory (branch) can be contained inside another directory
      * more branches
  • A directory within another directory is called a subdirectory
  • The possible number of subdirectories is in the thousands
      * lots of branches
  • Unix file systems contain Unix file names
      * leaves on the individual branches
  • Directories are file systems that contain Unix file names
Reference to a location in a directory structure is called a PATH

IBM AIX is a Unix derivative.
Review the link below from an AIX manual that provides explanation with visuals describing Unix directory structure
Unix Directory Structure


How are z/OS Unix file systems, such as ( /z ) directory, stored on a z/OS controlled disk volume?

  1. Multiple VSAM Linear Data Sets (LDS) type are "defined", each corresponding to particular directory structure.
  2. VSAM LDS Cluster name is "cataloged" - the data set name / volume label pairing
  3. VSAM LDS is "formatted" using a system supplied utility
  4. A z/OS "mount" command associates the VSAM data set name to a Unix directory
      Example:
    MOUNT FILESYSTEM('OMVS.STUDENT.ZFS') MOUNTPOINT('/z')
        where OMVS.STUDENT.ZFS is the VSAM LDS and /z is the Unix directory
  5.   Every z/OS system has a ROOT filesystem mounted at / . The ROOT filesystem contains directories called "mount points" where other filesystems are mounted

The following are available to view and edit Unix file names. Feel free to optionally try these various methods to view and edit Unix file names.

From ISPF session
  • =UF
  • =3.4
  • =3.17
  • TSO OMVS
      * ls
      * cat zfile
      * oedit zfile
From SSH session
  • cat zfile
  • vi zfile

What is available to list all z/OS mounted Unix file systems on the contest system?

From z/OS Unix shell command prompt - either TSO OMVS or SSH session

The above links are external references / help commands, rather that commands to be executed as part of the challenge

From ISPF =UF
  • File_systems drop down
    * recommended selections to review:
    1. Mount table
    5. zFS aggregates
Unix Basics - 3 special file descriptors:
  1. Unix default to read input is stdin
  2. Unix default to write output is stdout
  3. Unix default to write errors is stderr

Challenge:

Successful completion is to code Unix command to write requested report about /z filesystem to hlq.P2.OUTPUT(#11)

While Unix commands can be entered from a Unix shell prompt (stdin) with output written to the display (stdout), it is possible to execute Unix commands using JCL where STDIN, STDOUT, and STDERR are DDNAMEs directing output to to either a Unix file name or a data set name.

Learning System IDs Only (AU0####), click on link below for special instructions.
Learning System ID special instructions for this challenge.


Edit hlq.JCL(JOB11)

Change all lowercase z##### to lowercase your_id in the JCL, then submit

JOB11 JCL executes a system utility, BPXBATCH, which initiates a Unix process. COND CODE 0001 is harmless, if observed in the output.

Description of JOB11 JCL
  • The REMOVE JCL step removes file name /z/z#####/mounts
    * rm /z/z#####/mounts
  • UNIX JCL step
    * STDOUT is writing to file name mounts
    * STDERR is writing to the JES output spool (visible using SDSF)
    * STDIN is DUMMY
    * STDPARM reads a stack of Unix shell ( SH ) commands to be processed

The stack of Unix shell echo commands followed by the ls command writes text lines to the STDOUT DD physical resource
which is currently /z/z#####/mounts file name

The df command has an operand that will create a report with the following format:

Note: When using the interactive Unix shell prompt, df | more command syntax will pause df command output until enter key which will proceed allowing you to see column labels and first entries in the df output

Change JCL JOB11 as follows:
  1. process df command with appropriate operand to write requested report for /z file system ONLY
      Recommendation - Use the Unix command prompt to determine exact df command syntax needed
  2. write report to hlq.P2.OUTPUT(#11)
HINT:
  1. Delete the echo commands and ls command - leave the SH command
  2. Insert a line after the SH command for the df command syntax to output requested report for /z filesystem
  3. Modify STDOUT DD to reference DSN=&SYSUID..P2.OUTPUT(#11),DISP=SHR
       NOTE: Do not forget to delete the continuation lines from the previous STDOUT

Successful completion writes the requested report to hlq.P2.OUTPUT(#11)

Now you have even more z/OS experience with techniques using a combination of JCL and Unix file systems.

Next: Challenge #12