VSAM Data Sets
Part Two - Challenge #11

Background:

VSAM is one of several access methods in z/OS

You have used several z/OS data storage methods

  • MVS Sequential Data Sets (SEQ)
  • MVS Partitioned Data Sets (PDS)
  • Unix Filesystems (Files)

VSAM, Virtual Storage Access Method, is another z/OS data storage method. VSAM was developed after MVS SEQ and MVS PDS data storage methods. VSAM has superior I/O performance characteristics and the flexibility needed for innovative data storage advancements.

  • Unix filesystems are stored in VSAM Linear Data Set formatted and managed by Unix
  • Db2 relational database tables are stored in VSAM Linear Data Sets formatted and managed by Db2

VSAM is used to organize records into four types of data sets:

  1. Key-sequenced (KSDS)
     This type is the most common use for VSAM. Each record has one or more key fields
     and a record can be retrieved (or inserted) by key value. This provides random access to
     data. Records are of variable length. IMS™ uses KSDSs.
  2. Entry-sequenced (ESDS)
     This form of VSAM keeps records in sequential order. Records can be accessed sequentially.
     It is used by IMS, DB2®, and z/OS® UNIX®.
  3. Linear (LDS)
     This type is, in effect, a byte-stream data set and is the only form of a byte-stream
     data set in traditional z/OS files (as opposed to z/OS UNIX files). DB2 and a number of
     z/OS system functions use this format heavily, but it is rarely used by application programs.
  4. Relative Record (RRDS)
     This VSAM format allows retrieval of records by number; record 1, record 2, and so forth.
     This provides random access and assumes the application program has a way to derive the
     desisred record numbers.

The primary difference between the four types of VSAM data sets is the way that their records are stored and accessed.

Optional - not neccessary to complete the challenge
  If you want to understand details of how VSAM records are stored and accessed,
  then review IBM Redbook VSAM Demystified


Challenge:

Define a VSAM ESDS and copy member of MVS Partitioned Data Set to new VSAM ESDS
  1. From ISPF command line, enter dslist jcl
  2. Edit your jcl partitioned data set
  3. Enter s idcams to select a new empty jcl member
  4. Enter ISPF primary command, copy 'zos.public.jcl(idcams)'

Description of JCL job with 3 execution steps. Two steps execute IDCAMS and the last step executes IKJEFT01.
  1. Delete and define a VSAM data
  2. Copy a PDS member to newly defined VSAM data set
      where REPRO means to reproduce
  3. List attributes of VSAM data set writing output to p2.output(#11)

A syntax error exists and must be corrected
  1. Enter sub ; =sd ; st
    System prompts for a jobname character to complete the build of the JCL JOB statement. Enter a jobname character of your choice
  2. Review JCL job output DDNAME SYPRINT associated with StepName COPY
    The needed correction is to replace @@ with the appropriate OUTFILE value.
    Review of the REPRO INFILE value associated with the JCL DDNAME as a pattern to find appropriate JCL DDNAME to be used for OUTFILE value.
  3. Edit JCL PDS member IDCAMS correcting the syntax error
  4. Enter sub ; =sd ; st
  5. Review JCL job output for success


How to verify challenge was successfully completed
Success is member #11 written into your p2.output partitioned data set where the IDCAMS system utility program execution of command LISTC produces output with a line reading REC-TOTAL-------------12.

Your technical exposure now includes the technical acronym, VSAM. Your z/OS experience is growing.

Next: Challenge #12