Data Sets
Part Two - Challenge #07

Get up to speed on z/OS Data Sets, and the many ways of managing data on the mainframe.


The basics about z/OS Data Sets

About those Data Sets -

We’ve been using data sets and members throughout these challenges without really spending time talking about what they are. You’ve probably picked up that they’re a way of recording data, and that they behave somewhat similarly to files and folders on a typical desktop operating system, but there’s a bit more to it than that.

Watch the video below to jump-start your knowledge on z/OS data sets.

Some operating systems process data as a stream of bytes or characters where a new line of data requires a "carriage return" character or "line feed" character embedded in the stream of bytes or characters.

z/OS manages Data Sets differently.

z/OS Data Sets are created with an assigned 'record length' whereas files do not have assigned record lengths.

An assigned record length has implications on how Data Sets are created, how programs process data, and contributes to why z/OS memory management is superior to other operating systems.

z/OS does include a POSIX compliant Unix where Unix files are created, updated, and read using Unix file handling access methods as it would on any POSIX compliant Unix system. z/OS has both Data Sets and Unix files. The integration of a POSIX compliant Unix enabled simultaneous use of Data Sets and Unix files. While z/OS Unix files follow that stream of bytes standard, z/OS formats a special Data Set type to hold Unix file systems.

Data Set Names and Rules

Data set naming rules are:

  • A data set name consists of one or more parts connected by periods.
      Each part is called a qualifier.
  • Each qualifier must begin with an uppercase alphabetic character (A to Z) or the special character @, #, or $.
  • The remaining characters in each qualifier can be uppercase alphabetic, special, or numeric (0 to 9) characters.
  • Each qualifier must be 1 to 8 characters in length.
  • The maximum length of a complete data set name is 44 characters, including the periods.
  • Most z/OS environments agree upon detailed data set naming standards.

Valid data set names are:

  • X
  • A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.VW

Invalid data set names are:

  • .X
      Period is only used to separate qualifiers
      All lowercase alphabetic characters are invalid
      Qualifier cannot begin with a numeric
  • A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z
      Length is greater than 44
      MAINFRAME qualifier is greater than 8 characters

Data Set Creation Attributes

A comment before exploring the attributes and syntax of data set creation.

In many z/OS systems the disk storage administrators manage the details you are about to learn. Many that use the system are told to follow a documented procedure to allocate new data sets without ever being exposed to system fundamentals of allocating a new data set. Remember, the objective of the Master the Mainframe contest is exposure and experience with the system fundamentals. Someone must know how things work. Those technical associates that know how things work are essential to the IT infrastructure everyone else relies upon.

z/OS data sets are a collection of "records" and not a stream of bytes.
  When a z/OS program reads data, the program is reading one or more data records.
  When a z/OS program writes data, the program is writing data records.

z/OS needs more than a data set name to create a data set such as:

  • Record length
  • Record format
    Fixed length records or Variable length records
    Blocksize - number of records in a block
  • Data Set Organization
    Sequential - a collection of records
    Partitioned - a collection of members where the members contain records
    VSAM - Virtual Storage Access Method
       flexibility to organize records in four unique types
       designed for high speed and high volume access to data

Syntax involved in creating a data set includes:

  • LRECL - logical record length
  • RECFM - record format
  • BLKSIZE - block size
  • DSORG - data set organization
  • SPACE - disk storage size limits
    primary extent value
       - all data sets have 1 primary extent
    secondary extent value
       - numerous secondary extents are automatically created after the primary extent
         is full
  • UNIT and optionally VOL=SER=
      device type and disk volume label
  • LIKE - uses attributes of a like data set name for creating new data set

Creating New z/OS Data Sets

Data Sets - Create / Copy / Delete

You can create and manage data sets however you like. Beginners tend to like the ISPF panels, because they show all of the required fields with short descriptions. Experienced system programmers tend to have a collection of JCL that they edit and run as a job. You can also interface with data sets through GUI interfaces, APIs, and panels in ISPF.

Commonly used mechanisms to create z/OS data sets are:

  • JCL DD parameters
  • ISPF Data Set Utility panel
  • TSO ALLOCATE command
  • System utility programs such as IDCAMS
  • System services, Storage Managed Subsystem (SMS)

A newly created data set requires specific data set attribute information such as:

  • What is the desired the record length (LRECL= value)
  • Are the record length fixed in size or variable in size (RECFM= value)
  • What is the desired data set organization (DSORG= value)
  • What volume should be used to store the data set (VOL=SER= value)
  • What is the volume type, disk or tape (UNIT= value)
  • How much disk space should the data set be limited to consuming (SPACE= value)


While there are many ways to create new data sets, JCL will be used to create data sets in challenge 7.

Create a data set using JCL DD parameter provided by local storage administrator

You will be submitting the JCL in Figure #1

Figure #1

Description of JCL in Figure #1

  1. IKJEFT01 is the execution program.
     It is the TSO session program executed in batch instead of interactively.
  2. SYSTSPRT is TSO program output.
      Using SYSTSPRT in JCL enables redirection of TSO display output to any data set or unix file.
    DD operation is 3 lines where -
       DSN= --- the data set name
       DISP= --- the data set disposition is NEW
       DATACLAS= --- local routine supplies the data set attributes
  3. SYSTSIN DD * means what follows is a TSO command-
    LISTD TSO command will list data set name attributes

The JCL creates a new data set name using attributes assigned by the local system disk storage administrator as a result of DD parameters DATACLAS=MTMSEQ. The local storage administator created the MTMSEQ data class which contains the assigned attributes. A LISTD command writes the newly created data set attributes into the same newly created data set name.

Take the following actions:

  1. tso submit 'zos.public.jcl(p2ch7a)'
  2. Respond with a when prompted for a jobname character
  3. The JCL jobname is your ID suffixed by a
  4. Use SDSF to review JCL jobname output
      SDSF commands prefix ; owner your ID ; st will display all jobs owned by your ID
  5. The JCL job successfully created a new data set using attributes assigned by storage administrator controlled routine

View attributes of newly created data set

The JCL job created a new data set beginning with your ID followed by p2ch7.seq1

Take the following actions:

  1. dslist p2ch7.seq1
  2. view 'v' the content of p2ch7.seq1 data set name
    view will include left side line numbering and any modifications are discared
  3. Observe the assigned LRECL, RECFM, and DSORG values as a result of DATACLAS=MTMSEQ

Make a note of the LRECL, RECFM, and DSORG values. The values are needed to complete the challenge.

Also, entering i to the left of your p2ch7.seq1 data set will return assigned attributes information to the display.

Modify JCL to create a sequential data set using attributes you specify

You will be submitting the JCL in Figure #2 after replacing # symbols with valid attributes

Figure #2

Description of JCL in Figure #2

  1. The 1st JCL step executes IDCAMS program
    SYSIN reads IDCAMS commands to delete your P2CH7.SEQ2 data set
  2. The 2nd JCL step executes IEFBR14 program
      IEFBR14 is a dummy program convenient for allocating a data set using JCL DD operation
    SYSUT2 DD operation is 6 lines with various parameters
      Instructions to change # symbols with valid parameters will be provided
  3. The 3rd JCL step executes IKJEFT01 program
      Processes TSO command LISTD P2CH7.SEQ2
      Writes the command output into the data set created in 2nd JCL step referenced by SYSTSPRT DD
      Result - attributes of P2CH7.SEQ2 data set are written into P2CH7.SEQ2

Take the following actions:

  1. Edit your ID JCL partitioned data set
    dslist JCL
      edit 'e' JCL partitioned data set
      enter 's p2ch7b' to select a new member with name p2ch7b
    copy 'zos.public.jcl(p2ch7b)' to copy JCL into the empty member
  2. Change line 1100 ###### to VPWRKA
    VPWRKA is a disk volume serial label available on the system
      The newly created data set will be stored on disk volume VPWRKA
  3. Change line 1300 # symbols as follows:
    LRECL value should be the same that was used for P2CH7.SEQ1
    RECFM value should be the same that was used for P2CH7.SEQ1
    DSORG value should be the same that was used for P2CH7.SEQ1
  4. Submit the modified JCL and jump to SDSF status panel to view output
    sub ; =sd ; st
      enter 'b' when prompted for JCL jobname character
  5. View JCL job output in SDSF for success
      If unsuccessful, then correct JCL and resubmit JCL job

Complete the challenge by creating member #07 into your P2.OUTPUT data set

You will be submitting the JCL in Figure #3

Figure #3

Description of JCL in Figure #2

  1. The 1st JCL step executes IEBGENER, a system utility program
    SYSUT1 is the input to be copied
    SYSUT2 is the output of the copied data
    SYSIN references DUMMY meaning IEBGENER needs no commands to perform the copy
    SYSPRINT is where IEBGENER writes result of execution
  2. The content of your P2CH7.SEQ1 and P2CH7.SEQ2 is copied into your P2.OUTPUT member name #07
  3. The 2nd JCL step executes IDCAMS, a system utility program
    SYSIN reads IDCAMS commands to delete your P2CH7.SEQ1 and P2CH7.SEQ2 data sets

Take the following actions:

  1. tso submit 'zos.public.jcl(p2ch7c)'
      enter 'c' when prompted for JCL jobname character
  2. dslist p2.output
  3. view 'v' your p2.output partitioned data set
  4. select 's' member name #07
      If you see a report of both P2CH7.SEQ1 and P2CH7.SEQ2 attributes, then success

Another challenge accomplished. You will increase your understanding and recognize patterns as a result of repetition.
Repeated hands-on exposure followed by brief explanation is incrementally advancing your experience and skill level.

You are ready for the next challenge!

Next: Challenge #08