Getting Started
Part Two - Challenge #01


Congratulations on your decision to participate in the Part 2 journey.

A reminder about contest IDs:
All references to Z99999 are examples. Substitute your assigned ID in all cases.

The purpose of this challenge is for you to learn how to use the the ISPF Editor. Explanation of how to use the ISPF Editor is followed by screen shots at the bottom of these instructions.


From the ISPF Primary Option Menu, enter the following:

tso p2

Messages about data set allocations will be displayed followed by a MAXCC=0000 notification that members were copied into the new Part 2 data sets

If you need to start over all of Part 2 or any Part 2 challenge at any time, then enter tso p2over

Enter =3.4 to jump to the ISPF Data Set List panel.
Type your ID in the Dsname Level field.
Press Enter and more data set names appear in the list that previously contained only Part 1 data set names.
New data set names include JCL, SOURCE, STATUS, P2.OUTPUT, and LOAD.

Observe a data set named, Z99999.P2.OUTPUT in the list of data set names.
  Z99999.P2.OUTPUT will eventually contain all Part 2 challenge output.
  Z99999.P2.OUTPUT will frequently be referred to as P2.OUTPUT in the instructions.

Enter e to the left of P2.OUTPUT.

Enter select #01 on the command line to create and edit member #01.

Reference to the word "Type" means do NOT press "Enter" after typing text.
Reference to the word "Enter" means press "Enter" after typing text.

Think of a single word or brief phrase that comes to your mind when someone says "mainframe".

Tab to the first blank line, "type" the word or phrase, then "enter".

Observe a line number appeared on the left and the remaining blank lines disappeared.

Place the cursor directly on the line number.
  On the left side of the line number containing your word or phrase, type 'a' to specify the preferred placement as after this line.

Place the cursor in the editor primary command input area at the top.
  Enter copy ''

Success from the above action is a list of countries copied into #01 after the line with your word or phrase.

The next edit action is to keep only the line with your country.
  Therefore, delete all of the lines except for the line with your country.
  Please be sure to leave the first line with your selected word or phrase.
#01 will only have 2 lines when complete.

How do you complete this action? - Use 1 of the following 3, or a combination of the 3:

  1. A single line can be deleted by entering d on the line number to be deleted.
  2. A consecutive block of lines can be deleted by typing dd on first line number to be deleted, then type and enter dd on last line number to be deleted
  3. A consecutive number of lines can be deleted by entering d on the first line number to be deleted immediately followed by number of lines to be deleted.
Example Screen Shots:

The following is a series of example screens executing the above instructions
where the contestant is from the United States.

Please be sure to accurately include your country because this information is
needed by the contest judges to select country winners.

Future challenges will rarely include screen shot examples. The instructions will
assume you are familiar with navigating ISPF panels and ISPF Editor.

Observe the a on the first line number to copy after the first line.

Observe the f to find your country.
Observe the dd on the first line that is NOT needed

Observe the dd on the line just above the found country.
The second dd completes the block of lines to be deleted.
Observe the d99 on line just below the found country to delete the remaining 99 lines (which is all the remaining lines.

Enter top

Only the two lines you selected should be visible.

F3 to save #01 changes, end, and return to P2.OUTPUT PDS directory

F3 returns to ISPF data set list panel.

First challenge of Part 2 is complete.
  That was easy and the next several challenges are intended to be
  both easy and educational in preparation for more advanced challenges
  that assume knowledge gained in these early challenges.

While many interact indirectly and unknowingly with mainframes each day,
few can say they interacted directly and knowingly with a mainframe today.
You can!

Next: Challenge #02

Need to start over?

Two options are available:
  1. While in P2.OUTPUT PDS directory, enter d to the left of #01 to delete the member
  2. While in edit on #01, enter d999 on the first line number to delete 999 lines,
    then enter i on ****** to the left of the line that reads "Top of Data" to insert a single line.
Intermediate ISPF Editor
Part Two - Challenge #02


Learning the ISPF editor is needed to complete challenges.

Due to the editing of text being so important, this challenge is dedicated to the ISPF editor.

You may notice that some of the following content is repeated information. However, as you will be using the ISPF editor very frequently throughout the remaining challenges, the repetition is critical in order for you to feel comfortable using it.

Two Types of ISPF Editor Commands:
  1. Primary
  2. Line

You can "type" many commands within the edit session, then press Enter.
Pressing Enter results in the execution of all the typed primary and line commands.

The above comments are demonstrated using examples that follow.

  You only need to review the examples.
  No system action is required by you, only study of the examples.
  The challenge that follows assume you have a basic understanding of how to use ISPF editor.

ISPF Editor examples

  1. ISPF Option =3.4 to get ISPF Data Set List panel
  2. Enter Z99999.PDS.DATA in the panel Dsname Level field
  3. Edit (e) of Z99999.PDS.DATA
  4. Select (s) of member new creating an empty member as shown below

Data Entry

Press Tab key to place cursor on first data entry line. Type 1234567890,
tab to next line, and type lower case alphabet a to v, then enter

ISPF line numbers appeared on left (see below) as a result of action above.

Edit session profile

ISPF primary command profile controls behavior of edit session.

Any profile option can be changed. Observe the various options.

Primary command reset removes all the informational items about the edit session.

Result of reset follows:

Edit session scrolling

Observe the SCROLL ===> value above PAGE was changed to CSR below:
Most z/OS technicians prefer CSR

Why? F1 (Help) tutorial Option 7 explains

While in tutorial for EDIT SCROLLING, Option 2 is selected.

The Scoll Amount is explained.
Enter provides even more information and F3 will return to edit session.

Edit session primary and line commands

Several commands are typed (without enter) below
Primary command - cols
Line command - i - on line number will insert 1 line
Line command - r50 - on line number will replicate that line 50 times.

Enter executes the primary and line commands with result below.

Tab and space bar was used to position cursor into blank line
I am going to win this contest! was typed
Line command d99 on line 6 will delete 99 lines that follow

Move m line 1 after a line2
Change c 'uv ' to 'uvwxyz' all occurrences

Result of move/after and change all

Move a block of lines mm to mm, after a the last line

Result of move block of lines after last line

reset and copy c line 2 after a line 6

The copy/after did not execute because reset cancelled that execution

copy c line 2 after a line 6

This time the copy/after worked
An insert i was placed in the Top of Data line area

Data entered on the newly inserted line

Copy c line 1 and overlay a block of lines oo to oo with line 1
Change c 'First' to '1st' all occurrences

Result of line commands copy/overly and primary command change all
Overlay only overlays blank spaces - see last line

Line command to shift right a block of lines ))4 to )) by 4 spaces

Result of shift right a block of lines by 4 spaces

The above examples scratch the surface of the ISPF Editor capabilities.

  • The contest challenges are an opportunity to learn more ISPF Editor techniques.
  • ISPF Editor (F1 - Help) Tutorial has excellent explanations and examples.
  • As demonstrated in Part One, ISPF Editor Macros are easy to create for repeated use.
  • ISPF Editor can be used on very large data sets.
Note: Pay attention in the instructions between Type and Enter wording in these challenges.
Instruction to "type" means that you should NOT press the enter key after typing command or text.
Instruction to "enter" means you should press enter key.


Successful completion of the challenge will create member #02 in P2.OUTPUT

Preliminary Information

  • All data is stored in binary (bits).
  • A binary bit is either 0 or 1.
  • A group of 4 bits forms a hexadecimal value between x'0' and x'F'.
      A byte consists of 8 bits.
      A byte historically is the number of bits used to encode a single character of text in a computer, since it is the smallest addressable unit of memory in many computer architectures.
      A single character of text is represented by a combination of 8 bits or 2 hexadecimal characters.
  • Hexadecimal is a standard to represent data characters.
  • Hexadecimal is used to represent EBCDIC character formats.
  • Hexadecimal is used to represent ASCII character formats.
  • EBCDIC data character format is the default in z/OS.
  • ASCII data character format is the default in some other operating systems.
  • z/OS by default stores data in EBCDIC format.
  • z/OS can store both EBCDIC and ASCII formatted data in data sets.

The challenge will explore hexadecimal, EBCDIC, and ASCII using the ISPF Editor.

Edit e Z99999.P2.OUTPUT and follow the instructions below to complete this challenge.

You may encounter an "Edit Entry" panel when opening a data set.
Simply press Enter to proceed to the ISPF edit session.

Enter the following to create a new member in P2.OUTPUT partitioned data set.
s #02

While in edit on the new #02 member, enter
copy ''

  1. Some data is readable and some is unreadable
  2. The data is a mix of EBCDIC and ASCII
  3. Enter primary command source ascii
  4. Data previously unreadable is now readable and data previously readable is now unreadable
  5. Enter primary command reset
  6. Toggle between source ascii and reset to view differences

z/OS can store and process ASCII, eventhough the z/OS default is EBCDIC.

Enter primary command hex on

  • hexadecimal value is visible for each character regardless of ASCII or EBCDIC
  • hexadecimal values are vertical immediately below the character, example EBCDIC Q character on line 6 is hexadecimal x'D8'
  • hexadecimal value x'20' is an ASCII space
  • hexadecimal value x'40' is an EBCDIC space

Click URL below and scroll forward to review the translation table which is needed to complete the challenge.
ASCII or EBCDIC Translation Table.

Enter primary command hex off

Enter line command hx on any line number to display the hexadecimal values for just that line.
Enter hx again to toggle hex values off for that line.

Two modifications to the #02 member are required to successfully complete the challenge

  • Question #3 - replace ASCII yyyy with the correct year in ASCII format - easily located with an internet search using answer from Question #2
  • Question #4 - change the correct answer, IBM, from EBCDIC format to ASCII format

While the above modifications can be accomplished several ways -
What is available in ISPF Editor to accomplish the task?

  • primary command change x'##' x'##' where ## would be substituted with the appropriate from and to hexadecimal values.
  • ISPF Editor permits displayed hexadecimal values to be changed by overtyping the hex values

Make sure you press F3 or enter save on the command line to save your changes.

Congratulations! You are done with this challenge and may move on to the next one.

Next: Challenge #03

In the event you want to start over:
  • type d99 on the first line number
  • enter primary command copy ''

Moving forward in the contest, remember the ISPF Editor Summary in References drop down
and F1 to view ISPF Edit tutorial for additional assistance.

Job Control Language Basics
Part Two - Challenge #03


All operating systems execute programs and enable program access to resources such as data on disk.

z/OS uses Job Control Language, (JCL), to:

  • execute programs
  • enable program access to z/OS controlled input and output resources

JCL is a stream of statements where:

  • // in column 1 and 2 identifies statement as JCL
  • JOB statement gives a "name" to the task
  • EXEC statement identifies the program to execute
  • DD statement describes the program input and output resources

JOB, EXEC, and DD relationship -

  • JOB statement is followed by 1 or more EXEC statements
  • EXEC statement is followed by 1 or more DD statements
  • DD statement is associated with the preceding EXEC statement

z/OS environment has "readers" to process JCL statements

  • A submit command is available for readers to process JCL
  • The submit command begins a background task, aka "batch job"
  • Submitted JCL requires a JOB statement
  • A start command is available for readers to process JCL
  • The start command begins a foreground task, aka "started task"
  • Started JCL does NOT use a JOB statement
  • Started JCL task is identified by an assigned procedure name

During the contest, challenges will only submit JCL, not start any JCL.


Submit JCL, review JCL job output, identify and correct a JCL error.

From ISPF command line, enter
tso submit jcl(jobs)

View JCL job output using another panel interface - (SDSF) - System Display and Search Facility

From ISPF command line, enter

From SDSF command line, enter

From SDSF command line, enter
owner z99999
where z99999 must be replaced with your ID

From SDSF command line, enter

The following "SDSF STATUS DISPLAY ALL CLASSES" panel is displayed as a result of the above commands

Note: JOB1, JOB2, and JOB3 may or may not be listed in order in the output queue.

Tab to the NP column and type s to the left of JOB1, JOB2, JOB3 to select the output of each JOB, then press enter. F3 to proceed to next selected job.

Below JOB1 JCL JOB output listing includes ENDED - RC = 0000
RC = 0000, is Return Code 0000, indicating JOB success.

Below JOB2 output also reads ENDED - RC = 0000
  Observe JOB2 has 2 STEPNAMEs (STEP1 and STEP2)
    - A STEPNAME is associated with each EXEC statement following a JOB statement
  Observe JOB1 has 1 STEPNAME (STEP1)
  Reason: JOB2 executed 2 programs (EXEC PGM=) and JOB 1 executed only 1 program.

Below JOB3 output includes JOB NOT RUN - JCL ERROR

JOB3 output has details about the JCL ERROR
STMT NO. MESSAGE indicates y and s are unidentifiable characters on the DD statement
  The output includes a number to the left of each JCL statement
  Observe MESSAGE was about STMT NO. 9

JCL needs to be UPPERCASE
The only exception involves Unix services lowercase named resources that are within quote marks. Fix the JOB3 JCL error to complete the challenge.

How? - Use the ISPF Editor to correct the JCL error

  1. =3.4 - jump to ISPF data set list panel
  2. List your data sets by entering your ID in the Dsname Level field
  3. Edit e your ID JCL data set
  4. Select s member JOBS
  5. Hint: While in edit, enter hilite jcl on the primary command line
  6. Identify and correct JCL error
  7. Enter submit on edit primary command line to have system process corrected JCL
  8. =sd ; st - jump to SDSF panel and status st job output

Repeat the above process until successful execution of JOB3

Duplicate JOBNAMEs are listed as a result of submitting the JCL JOB stream repeatedly
Typically, the highest JobID number is the latest

Unwanted JOBNAMEs can be purged by entering p to the left of the unwanted JCL JOB

Challenge #3 is complete once JOB3 successfully completes.
Successful completion of JOB3 will write #03 member into P2.OUTPUT.

Useful and Optional Information

Like ISPF, SDSF has a help tutorial, (F1)

NP is abbreviation for non-protected which means commands can be entered in the NP column

NP column commands:
? - Display a list of the data sets for a job
S - Browse the data sets for a job. You can add:
   B - Use ISPF Browse
   E - Use ISPF Edit
   J - Use ISPF Edit to edit the JCL
P - Cancel a job and purge its output

Next: Challenge #04
Relationship Between Programs and JCL
Part Two - Challenge #04


z/OS has a clever mechanism for a program to use different physical data sources without changing the program.
That mechanism is Job Control Language, JCL. Understanding JCL is required to claim average knowledge of z/OS.

Job Control is the best description of JCL. Therefore, think Job Control when learning about the syntax of JCL.

The previous challenge submitted JCL for processing and introduced JCL terminology and syntax.

Challenge #4 will:

  • elaborate on JCL terminology
  • demonstrate JCL terminology during the challenge
  • use JCL terminology to describe the challenge

To elaborate on JCL terminology, consider a PAYROLL program and a CASH program
where the programs open several filenames to read, process, and write.

PAYROLL program
  open filenames employee, payrate, taxrate as input
  open filenames paystub, totcash as output
  read filenames employee, payrate, taxrate
  process payroll program logic
  write filenames paystub, totcash

CASH program
  open filenames totcash, cashbefr as input
  open filenames cashaftr as output
  read filenames totcash, cashbefr
  process cash program logic
  write filename cashaftr

Observe the JCL below has JCL ddnames with same name as program filenames above

What is a JCL ddname?

  • A ddname is on a DD statement where DD is JCL syntax for Data Definition
  • The program requests access to inputs and outputs using filenames
  • A program filename needs a ddname where the filename = ddname
  • DD parameters describe the input/output data source to be accessed by the program

What is a JCL step?

  • Each EXEC statement starts a new step
  • A step includes the EXEC statement and the following DD statements
  • A stepname is coded immediately after // on the EXEC statement
  • A subsequent EXEC statement is the end of the previous step and start of a new step

Description of a few DD parameters describing the data input/output resources

  • DSN=value - where value is a data set name
  • PATH=value - where value is a unix filename
  • DISP=value - where value is data set name or unix filename disposition, such as NEW, OLD, SHR, CATLG
  • *   - an asterisk(*) where what follows the DD * is in-stream data or control statements the program would recognize

Additional information will be presented about JCL features and functions in later challenges.
For now, let's start with a challenge based upon the background information.


Outline of challenge activity:

  1. Edit source data set
  2. Select data set member
  3. Submit JCL procedure to compile COBOL program source code into machine executable module
  4. Edit JCL data set and copy in new JCL member to execute COBOL program
  5. Submit JCL to execute COBOL program
  6. Locate messages in output describing why COBOL program execution failed
  7. Identify and correct problem

The problem is a matter of failure to open a program filename.
The program filename fails to find the corresponding JCL ddname.

Once the problem is corrected, program execution writes messages to P2.OUTPUT(#04)

Fewer Screen Shots: The instructions assume learned ability to navigate ISPF, ISPF Editor, and SDSF panels from the previous challenges. Instructions below assume you know where and how to enter the commands.

1. Edit source data set

e Z99999.SOURCE

2. Select member name, cblrdwr, in the source data set

s cblrdwr

  • The first few lines are JCL that execute a JCL "procedure"
      The IGYWCL JCL procedure will be located and expanded once submitted
      Expansion of IGYWCL executes the COBOL compiler program, then executes a system utility to create an executable module.
  • Following the DD * is COBOL program source code
      Quickly browse the COBOL syntax and comments
      Instructions will refer back to this syntax later in the challenge
      Reminder - F8 to page down, F7 to page up - when SCROLL ===> CSR - page up and down relative to cursor position

Optional: to hilite COBOL reserved words, enter hilite cobol

4. Submit JCL to compile COBOL program source code, jump to SDSF, and proceed to SDSF status panel

submit; =sd; st

  • Review CBLRDWR output
      Use s and/or ? in the NP column to review ouput
      JCL JOB should complete successfully RC 00
      If curious, the output is expansion of IGYWCL JCL procedure to compile the COBOL program source code

5. Submit JCL to execute program CBLRDWR

tso submit jcl(job04)

  • Review JOB04 output
      Use s and/or ? in the NP column to review ouput
      JCL JOB failed RC = U4038

6. Locate messages in output describing why COBOL execution failed

  • Carefully read JOB04 SYSOUT ddname output section
    SYSOUT ddname provides problem description and key to corrective action

7. Identify and correct problem

  • JOB04 JCL follows for review
      What follows //RECIN DD * is opened and read by PGM=CBLRDWR
      The physical output location is DSN=&SYSUID..P2.OUTPUT(#04)
        where &SYSUID. is a system symbolic that is replaced with your ID at time of execution
        where DISP=SHR means the data set exists and can "shared"
  • CBLRDWR COBOL source code follows for your review
      Asterisk in column 7 of COBOL source is a comment
      Carefully read the comment statements
      Linkage exists between COBOL program source code and JCL

Correct the JOB04 JCL DDNAME to match COBOL output internally assigned filename
=3.4 to jump to Data Set List Utility panel
  Edit, correct, and submit JCL(JOB04)

Once problem is identified, correct the problem in JCL JOB04 and verify correction by submitting JOB04.
Successful execution of JCL JOB04 writes P2.OUTPUT(#04)

The solution is very simple and proves an understanding of the relationship between a z/OS program and JCL.

Next: Challenge #05

z/OS Data Set Names, Types, and Attributes
Part Two - Challenge #05


A starting point to understand Data Set Names, Types, and Attributes, is a review of what was learned in previous challenges.

  • Sequential data sets (SEQ) contains data records
  • Partitioned data sets (PDS) contains a directory of members, where each member contains data records
  • Example data set names are:
  • Data characters in z/OS are stored in EBCDIC format by default
  • z/OS can store ASCII formatted characters. However, the z/OS default is to interpret the hexadecimal values as EBCDIC
  • z/OS utilities exist to display ASCII formatted characters that are displayed in a readable format
  • z/OS Unix files are available. However, nothing has been explained about z/OS Unix filesystems

Briefly review the details that follow about data set names, types, and attributes.
The challenge does not require memorization of the details.

Completion of the challenge will require awareness of these details.
Therefore, think of the details that follow as a reference summary to refer to during the challenge.

What are the data set name rules?

> Maximum of 44 characters in length
> The 44 characters are divided into segment names
> A period ( . ) is used to separate data set name segments
-- Z99999.SEQ.DATA has 3 segment names
> The period ( . ) counts toward the 44 character length
  The data set name segment has rules and restrictions
-- Maximum length of a segment is 8 characters
-- 1st character must be alphabetic (A to Z) or national (# @ $)
-- Remaining 7 characters are either alphabetic, numeric (0-9), national, or hypen (-)
-- Name segments are separated by a period ( . )

To summarize, data set names must not exceed 44 characters, including all name segments and periods.

Instructions will reference the following abbreviations associated with data set names:

  • HLQ, High Level Qualifier, is the 1st segment of the data set name.
  • MLQ, Middle Level Qualifier, is any middle segment of the data set name.
  • LLQ, Low Level Qualifier, is the last segment of the data set name.

What are the common data set types?

> Sequential
> PDS - Partitioned Data Set
> PDS/E - Partitioned Data Set/Extended
> VSAM - Virtual Storage Access Method
-- VSAM is subdivided into 4 types
    o KSDS, Key Sequenced Data Set
    o ESDS, Entry-Sequenced Data Set
    o RSDS, Relative Record Data Set
    o LDS, Linear Data Set

What are the common data set attributes?

> Record Length
--z/OS is record oriented - not a stream of bytes like other operating systems
    JCL parameter (LRECL=length_value)

> Record Format
-- Fixed
    o data set record lengths are all equal length
    o JCL parameter (RECFM=F)
-- Variable
    o data set record lengths vary between records
    o JCL parameter (RECFM=V)
-- Fixed Blocked
    o a group or block of fixed length records
    o JCL parameter (RECFM=FB)
-- Variable Blocked
    o a group or block of variable length records
    o JCL parameter (RECFM=VB)
-- Undefined
    o understood by system loader of executable modules
    o JCL parameter (RECFM=U)

> Data Set Organization
-- Physical Sequential
    o A sequential data set
    o JCL parameter (DSORG=PS)
-- Partitioned Organization
    o Partitioned Data Set with directory of members
    o JCL parameter (DSORG=PO)
-- Partitioned Organization/Extended
    o Partitioned Data Set with directory of members, faster and more efficient
-- Virtual Storage Access Method (VSAM)
    o 4 unique organization types, (DSORG=VS)
    o System utility program (IDCAMS) control statements define VSAM types and attributes

Other data set types exist but will not be covered in the challenges.
Other data set attributes include disposition (new, old, etc.), disk volume and disk storage space which will be explored in challenge #6.

In preparation for the challenge - review your existing data set name types and attributes

ISPF Data Set List Utility panel =3.4 and view Data Sets Matching your HLQ:
  Two methods exist to view data set types and attributes from ISPF panels
   1. Continue to press F11 and view columns associated with each data set name
   2. In the command column to the left of any data set name, enter either s or i
     Options s and i show slightly different details


The instructions are brief by design.
Rely upon the above background, knowledge, and ISPF navigation experience that you have acquired from past challenges.

Description of challenge
1. A JCL JOB will allocate 4 new data set names, each with different types and attributes
2. You will be instructed to change a single attribute of each data set name.

Submit JCL JOB to allocate the 4 new data set names
tso submit jcl(job05)
Enter refresh on the DSLIST panel to view new data set names

1. Review the new data set allocation types and attributes with MLQ of CH5

2. Delete the new data set allocations by entering d to the left of each data set name with MLQ of CH5

3. Edit e JCL(JOB05) changing JCL DD parameters as follows:

  a. All 4 of the data set names need the record format to include the blocked attribute.
  b. Upon completion of the changes - sub ; =sd; st and review JOB05 output for RC = 00
  c. If JOB05 completed with RC = 00, then =3.4 and review data set name attributes

When satisfied that each of the data set names with MLQ of CH5 include a record format that is blocked, then -
  delete the MLQ of CH5
  edit JOB05 and uncomment the last JCL statement as follows:

submit JCL following the change

Submitting JOB05 with execution of JCL procedure CH5DEL will:
1. Allocate the 4 data sets with blocked attribute record format
2. CH5DEL write the 4 data set name attributes and types to P2.OUTPUT(#05)
3. CH5DEL deletes the 4 data set names

Reminder: Delete the 4 MLQ CH5 data sets before running JOB05

If curious about JCL procedure CH5DEL, then view 'VENDOR.PROCLIB(CH5DEL).

Feel free to check your P2.OUTPUT(#05) written by CH5DEL , then move on to the next challenge!

In the event an original copy of JOB05 is needed, during edit session -
  Delete all the statements - d999 on line number 1
  Copy in original JOB05 - copy 'zos.public.jcl(job05)'

Next: Challenge #06

Virtual Storage Access Method (VSAM)
Part Two - Challenge #06


A starting point to explore Virtual Storage Access Method (VSAM) is a review of what was included in the previous challenge.

> VSAM - Virtual Storage Access Method
-- VSAM is subdivided into 4 types
    o KSDS, Key Sequenced Data Set
      - INDEXED in IDCAMS DEFINE statement
    o ESDS, Entry-Sequenced Data Set
      - NONINDEXED in IDCAMS DEFINE statement
    o RRDS, Relative Record Data Set
      - NUMBERED in IDCAMS DEFINE statement
    o LDS, Linear Data Set
      - LINEAR in IDCAMS DEFINE statement

System utility program (IDCAMS) control statements define VSAM types and attributes.

VSAM has capabilities for speed and data organization flexibility beyond non-VSAM data set types.
You will learn more about these VSAM capabilities in later challenges.
Review the following wikipedia explanation: Wikipedia - Virtual storage access method.

IDCAMS has numerous functions. Only DEFINE CLUSTER and DELETE CLUSTER control statement will be used in this challenge.

A CLUSTER name references 1 or more VSAM data set name components.
An example is the Key-Sequenced Data Set (KSDS) which has a CLUSTER name associated with a:
  1. VSAM CLUSTER INDEX data set name component and
  2. VSAM CLUSTER DATA data set name component.

The challenge below follows the same pattern as the previous challenge with these exceptions:
  1. VSAM data set names instead of non-VSAM data set names
  2. Viewing VSAM CLUSTER attributes is accomplished differently

Again, the instructions are brief by design, relying upon your rapidly increasing experience.

The challenge JCL is using relatively new features only available in the latest version of z/OS.
  The challenge is an opportunity to see something that very experienced z/OS technicians have yet to discover.
  Specifically, JCL in-stream control statements may contain system symbolics to be substituted prior to execution.
Observe DD *,SYMBOLS=CNVTSYS, then &SYSUID. will be substituted with your ID.

Description of challenge
1. A JCL JOB will allocate 4 new VSAM CLUSTERs, each with different types and attributes
2. You will be instructed to change VSAM CLUSTER attributes


Submit JCL JOB to allocate 4 new VSAM CLUSTER names.
tso submit jcl(job06)

1. View JOB06 output for successful completion, RC = 00
=sd ; st

2. View the new VSAM CLUSTER allocation types and attributes with MLQ of CH6

ISPF Data Set List Utility panel =3.4 and view Data Sets Matching your HLQ.

In the command column to the left of a CLUSTER name,
enter listc ent(/) all as demonstrated below.

listc ent(/) all can be entered to the left of each CLUSTER name as demonstrated below

   CLUSTER names have *VSAM* in the Volume column.
   Other data set names with MLQ of CH6 are the CLUSTER physical component data set names on disk.

It is possible to continue to press F11 and view columns associated with each CLUSTER data set name.

However, the only attribute available is DSORG=VS

Optionally, tso submit 'zos.public.jcl(job06a)' executes the same 4 LISTC commands using a JCL job where the output can be reviewed instead of reading output on display.

3. Edit e JCL(JOB06) changing IDCAMS control statements as follows:

  a. The KSDS, ESDS, and RRDS need the recordsize to be an average length of 100 and a maximum length of 1024.
  b. Upon completion of the changes - sub ; =sd; st and review JOB06 output for RC = 00
  c. If JOB06 completed with RC = 00, then =3.4 and review CLUSTER name attributes using listc ent(/) all

Want professional details about IDCAMS DEFINE parameters which includes RECORDSIZE?
IBM Knowledge Center, Defining attributes for clusters and cluster components.

Note: RRDS will add 4 bytes to both average and maximum lengths to handle a unique relative record numbers.
Still code average record length of 100 and maximum record length of 1024 and do not be concerned that 4 bytes were added.

It is unnecessary to manually delete the CLUSTER names, because JOB06 will delete CLUSTER names
prior to DEFINE of the new CLUSTER names.

However, in the event you needed to manually delete the CLUSTER names,
the following is an example of deleting the CLUSTER names from the ISPF DSLIST panel.

When satisfied that the KSDS, ESDS, and RRDS CLUSTER names with MLQ of CH6 each include
a recordsize average length of 100 and a maximum length of 1024, then -
Edit e JCL(JOB06) and uncomment the last JCL statement as follows:

submit modified JCL

If curious about JCL procedure C6DEL, then review JOB06 output.

Feel free to check your P2.OUTPUT(#06) written by C6DEL , then move on to the next challenge!

In the event an original copy of JOB06 is needed, during edit session -
  Delete all the statements - d999 on line number 1
  Copy in original JOB06 - copy 'zos.public.jcl(job06)'

Next: Challenge #07

Character Encoding Formats and Packed Decimal
Part Two - Challenge #07


As mentioned in previous challanges:

  1. z/OS default character coding is EBCDIC
  2. ASCII can be stored in z/OS data sets and Unix files
  3. ISPF Editor has several features for viewing ASCII hexadecimal character format
      a. HEX ON (primary command)
      b. SOURCE ASCII (primary command)
      c. HX (line command)

Another important character encoding scheme is Packed Decimal.
  Storing numbers in Packed Decimal format improves application performance for arithmetic processing.
  Applications must convert EBCDIC numbers into either packed or zoned decimal to perform arithmetic functions.
  Therefore, if the numbers are stored in packed or zoned decimal, then application cycles are reduced.

Outline of tasks in this challenge:

  1. View PDS members with EBCDIC, Packed Decimal, and ASCII
  2. Observe Hexadecimal values for the EBCDIC, Packed Decimal, and ASCII characters
  3. Execute a REXX routine designed convert Packed Decimal and ASCII characters to EBCDIC,
      then write the converted Packed Decimal and ASCII to the display screen
  4. Same PDS member has 2 lines at the bottom in EBCDIC with a signed number and character text
  5. Edit the PDS member and manually convert the EBCDIC signed number to Packed Decimal and the EBCDIC text to ASCII.

A Character Encoding Summary is available to complete the challenge. Browse this document before you begin.

References drop down includes Character Encoding Summary.

Challenge Preparation:

Edit member DATACODE in Z99999.PDS.DATA
  Observe some characters look funny and "Data contains invalid (non-display) characters"

Enter the following on the primary command line:
reset ; source ascii
The ==MSG> will be supressed and ASCII translation will be applied to all characters in DATACODE

Observe below many of the non-displayed characters are displayed. The previous displayed characters are not displayed.
The reason for all the @ characters is because an EBCDIC space is an ASCII @ character. The hexadecimal value is x'40'. When x'40' is displayed as EBCDIC, a blank space is displayed. When x'40' is displayed as ASCII, @ is displayed.

Enter the following on the primary command line:
The display will return to default EBCDIC translation as shown below

Observe below translation is back to default EBCDIC

Enter the following line command as shown below on the first line
The first line number will show Hexadecimal representation of each character on the line

Observe the first line is all EBCDIC spaces, x'40'

It is possible to overtype the Hexadecimal values

Overtype the first 4 Hexadecimal values, 40404040 with 81826162 as shown below, then press enter

Line 1 now displays ab followed by 2 strange characters

Enter the following as shown below
cols; source ascii
to display a column ruler and translate Hexadecimal to ASCII

Observe line 1, column 1-4.
Columns 3 and 4 have ab and columns 1 and 2 are strange.
Therefore, while z/OS default Hexadecimal translation is EBCDIC, z/OS can display ASCII

Enter cancel to return to PDS directory without saving changes

From the PDS directory command line enter the following:
tso a2e

a2e is a REXX routine that was quickly written to:
  1. Read DATACODE lines
  2. Translate Packed Decimal and ASCII to EBCDIC and write the line only when the following is true:
   a. Valid Packed Decimal sign found in last "nibble" of column 4
   b. Valid Packed Decimal number found in columns 1, 2, 3, 4, and last "nibble" of column 4
   c. Valid ASCII space character, x'20', found in any column between column 5 and 80

Note: a2e, (a)scii (2) (e)bcdic


Edit DATACODE and change the last line (9) as follows:
1. change +432 in columns 1-4 to Packed Decimal format
2. change the characters in columns 5-80 to ASCII

Helpful hints:
  While in ascii mode, what you type will be ascii, but that x'C4' in column 12 will require special handling
  5-57 reads - Packed Decimal is superior for arithmetic performance
  58-80 are spaces that need to be changed from EBCDIC to ASCII - F11 to see columns 72-80

F3 to save changes, then
tso a2e
can be used to validate your line 9 Packed Decimal and ASCII changes
  No @ characters should be on the line 9 characters displayed on the screen

Once the changes are complete, then edit DATACODE member and type the following:
rep p2.output(#07)
and enter the following line command on line 000001
F3 to exit edit session.
You just completed the challenge and demonstrated above average skills with hexadecimal, EBCDIC, and ASCII.

Next: Challenge #08

In the event original copy of DATACODE is needed
  Edit member DATACODE in Z99999.PDS.DATA
  D999 on line number 1
  copy ''

Number Hunt
Part Two - Challenge #08


The result of completing this challenge is a single number.

The answer requires locating, interpreting, and summing 9 separate numbers to arrive at the single number.

The 9 numbers are located in 3 separate data sources:
  1. Z#####.HUNT
  2. Z#####.DATA(HUNT)
  3. /z/z#####/hunt
  --- where ##### is the last five digits of your personal ID
  --- note - z is lowercase in the unix file names

The 9 numbers are in 3 separate encoding formats:
  1. Packed Decimal - (remember this can be a positive or negative number)
  2. ASCII

  • 4 numbers are Packed Decimal
  • 3 numbers are ASCII
  • 2 numbers are EBCDIC

The 9 numbers are in specific record numbers, starting in specific column positions within the record.
Each number has a length of 4 bytes

Terminology byte, nibble, and bit are explained at bottom of Character Encoding Summary

Challenge instructions below provide:
1. Data source
2. Record number in data source
3. Column position within the record number

Please reference link below for encoding formats
Character Encoding Summary

Encoding formats must be identified, then the corresponding decimal values are summed to arrive at the final number.

ISPF View ( v ) provides all the capabilities of ISPF Edit ( e )
ISPF View disables ability to save any accidental changes

Use ISPF View ( v ) on the data set name or unix file name to locate data fields and interpret encoding format

  • up, down -- primary command available to position to desired record number
  • right, left -- primary commands available to position in area of desired column
  • hx -- line command provides hexadecimal representation of each column
  • cols -- line command provides column position ruler
  • Columns area -- ISPF View display top right shows the data columns that are being displayed

Helpful Hint: A unix file directory path (such as unix file directory path /z/z#####) can be entered on the =3.4 data set list panel, then ( v ) to the left of any unix file in the directory to ISPF View the unix file name


Submit JCL to allocate the data to be "hunted":
tso submit 'zos.public.jcl(p2ch8)'

Note: If you need to start over, submit the above JCL again because the JOB08 to record answer deletes the data sets and unix files needed for this challenge

Data Source Record Column Length
/z/your_id/hunt 4 34 4
/z/your_id/hunt 8 1 3
/z/your_id/hunt 26 40 4
your_id.PDS.DATA(HUNT) 17 45 4
your_id.PDS.DATA(HUNT) 23 16 4
your_id.PDS.DATA(HUNT) 25 33 4
your_id.HUNT 2 650 4
your_id.HUNT 2 830 4
your_id.HUNT 4 1021 4
Once the 9 decimal numbers are totalled, then edit your JCL data set name and select member name JOB08
Replace 1111 in member JOB08 with the single number, then sub on the primary command line

=3.4 and browse P2.OUTPUT member #08 for the number

Next: Challenge #09

Data Set Space and Disk Storage Extents
Part Two - Challenge #09


The massive amount of data controlled by IBM mainframes is critical data.

If you have a bank account, your money is more than likely controlled by an IBM mainframe. When you check your bank balance from a Smart Phone, the transaction most likely runs on a mainframe to return your bank balance to the Smart Phone. Your travel reservations, flight, hotel, and rental car, are most likely stored on mainframe controlled disk storage. These examples are just scratching the surface of the critical data controlled by mainframes.

Large Enterprises and governments are entrusted as caretakers of critical data that the general population and the economy depend upon. These caretakers of critical data have jobs of high responsibility and experience.

Recent terminology describing critical data is Data Gravity. As the exponentially growing stream of non-critical data is the vast majority of data flowing at any moment, data gravity is a phrase being used to differentiate the most important and critical data (data with heavy density) from the non-critical and disposable data such as a tweet.

Enough of the high level stuff. Back to the basics of data in a z/OS environment.

Completing challenge #09 will not be difficult. However, the challenge is designed to introduce elementary details about z/OS data management.

Previous challenge review:

  • z/OS default character encoding is EBCDIC. However, ASCII can be stored and processed.
  • z/OS is a record-oriented operating system where records have defined lengths
      Conversely, in a stream of bytes oriented operating system, the text data streams require "newline" or "carriage return" characters in the data stream.
  • z/OS stores records in a variety of data set types
    Sequential, PDS, PDS/E
    Unix file system
        - which are VSAM Linear Data Sets formatted for Unix filesystems
        - more about that in Part 3 of the contest.
  • Data set attributes include:
    Record Length
    Record Format
        - F Fixed Length Records
        - FB Fixed Length Blocked Records
        - V Variable Length Records
        - VB Variable Length Blocked Records
        - U Undefined Length Records

Challenge #09 explores another data set attribute - space

  • Other operating systems allocate files as if disk storage capacity is unlimited
      This continues until the disk storage capacity is full
      Manual action is required to free up disk storage space to continue
  • z/OS allocates files (i.e. Data Sets) with a defined disk storage capacity limit
      Data Sets are allocated using a space attribute

While the space attribute limits the total amount of disk storage that a data set can consume, flexibility does exist.

System assignment of disk storage space include:
1. Primary extent size
2. Secondary extent size
3. Disk device size-allocation-unit applied to the primary and secondary extents
  a. Cylinders
  b. Tracks
  c. block length
  d. others exist

  where -
TRK is the "size-allocation-unit" that happens to be 56,664 bytes on z/OS controlled disk devices
5 is the primary extent - in this case the primary extent size is 56,664 x 5 = 283,320 bytes
1 is the secondary extent - in this case the secondary size is 56,664 bytes

Space allocation flexibility:
  Only 1 primary extent allocation per data set name
  The 1st secondary extent allocation only occurs when the primary extent is full
  Additional secondary extent allocations only occur when previous secondary extent is full
  The total number of secondary extent allocations depend upon data set type - ranging from 15 to 255

References drop down Data Set and Disk Storage Capacity has a table of maximum secondary extents by data set type

An extent is a contiguous area of disk space with an absolute starting location on the disk device and an absolute ending location on that same disk device.

A free extent is a contiguous area of disk space with an absolute starting location on the disk device and an absolute ending location on that same disk device that is available for any new primary and secondary extent allocation sizes that will fit.

A few simple diagrams to visualize z/OS disk space allocation follow:

A large enterprise has thousands of disk devices, each with a unique disk device address and label.
The disk storage administrator or systems programmer use a system utility to initialize disk volumes,
allocating a label and a VTOC, Volume Table of Content.

The label points to the disk location of the VTOC.
The VTOC has starting and ending location of every extent (primary, secondary, and free extents.

A newly initiatize disk volume would have 1 free extent capable of holding a single primary extent allocation. Typically, a disk volume contains many primary and secondary extents.

When a primary extent is allocated, the VTOC is updated with:
1. data set name
2. starting location of the data set name primary extent (p1)
3. ending location of the data set name primary extent (p1)
4. starting location of free space (f1)
5. ending location of free space (f1)

When a primary extent is full and secondary extent allocated, then VTOC is updated with:
1. starting location of the data set name secondary extent
2. ending location of the data set name secondary extent
3. starting location of free space extent
4. ending location of free space extent

Over time, the VTOC is updated with numerous:
1. data set names
2. starting location of the data set name extents
3. ending location of the data set name extents
4. starting location of free space extents
5. ending location of free space extents

The challenge is an opportunity to view space allocation by allocating primary and secondary space.
The challenge repeatedly writes into the data set name until reaching the maximum number of secondary extents for the specific data set type.

A previous challenge introduced the acronym HLQ, High Level Qualifier - the 1st segment of a data set name
your_id in the form of Z##### is your hlq
  Moving forward in the written instructions, substitute your_id for hlq


Successful completion of challenge #09 is to modify data set name space allocation secondary extent value from 1 track to 2 tracks

Submit JCL to allocate new data set name and copy data into the new data set name:
tso submit jcl(job09)

JOB09 allocated a data set name hlq.EXTENT.TEST

Display hlq.EXTENT.TEST "Data Set Information" ( i ) from data set list panel ( =3.4 ) and review:
  • Current Allocation
      Allocated tracks
      Allocated extents
  • Current Utilization
      Used tracks
      Used extents
Submit JCL to add more records to hlq.EXTENT.TEST
tso submit 'zos.public.jcl(job09b)'

The number of records added by JOB09B will result in more secondary extents
  Review the "Data Set Information" for number of "Used extents"

Submit JCL JOB09B again to add even more records to hlq.EXTENT.TEST
tso submit 'zos.public.jcl(job09b)'

The additional number of records added by JOB09B will result in more secondary extents
  However, JOB09B returns SB37, out of space condition during this 2nd execution
  Review the "Data Set Information" for number of "Used extents"

Submit JCL to write VTOC information about hlq.EXTENT.TEST into hlq.P2.OUTPUT(#09)
tso submit 'zos.public.jcl(job09c)'

View hlq.P2.OUTPUT(#09) and observe:
  • Ext seq
  • Begin-End
    Cyl-hd   Cyl-hd
  • Reltrk, numtrks

The P2.OUTPUT(#09) shows numtrks are 1 for the primary and all secondary extents

Edit JCL(JOB09) and change only secondary space extent from 1 to 2 for the hlq.EXTENT.TEST data set name

sub, then review the "Data Set Information" and observe value of "Secondary tracks"

Again -

Submit JCL to add more records to hlq.EXTENT.TEST
tso submit 'zos.public.jcl(job09b)'

The number of records added by JOB09B will result in more secondary extents

Press enter a few times until you see notification the job completed.

  Review the "Data Set Information" for number of "Used extents"

Submit JCL JOB09B again to add even more records to hlq.EXTENT.TEST
tso submit 'zos.public.jcl(job09b)'

The additional number of records added by JOB09B will result in more secondary extents
Submit JCL to write VTOC information about hlq.EXTENT.TEST into hlq.P2.OUTPUT(#09)
tso submit 'zos.public.jcl(job09c)'

View hlq.P2.OUTPUT(#09) and observe:
  • Ext seq
  • Begin-End
    Cyl-hd   Cyl-hd
  • Reltrk, numtrks
  • Note: View requires F11 (shift right) to display content of the numtrks column. Browse b will display content of the numtrks column without need to shift right.

If P2.OUTPUT(#09) shows numtrks primary extent value of 1 and secondary extent values of 2, then the challenge is complete.

Understanding data set types and attributes are core to advancing your knowledge about z/OS data and disk space management

Congratulations! You know more about z/OS than the average person

Next: Challenge #10

If you want to read more about the disk technology storing this "massive" amount of critical data:
Physical direct access storage used by z/OS today is provided on hardware such as the IBM DS8880 "includes informative short video" that can scale from 3 terabytes to more than 3 petabytes of physical storage capacity. A single mainframe connects to many physical hardware storage controllers which could potentially scale to more than 3 petabytes. Thus, a single mainframe is capable of processing an enormous amount of data.

Catalog of Data Set Names and Volume Labels
Part Two - Challenge #10


Completion of challenge #10 means you will have knowledge about z/OS that many z/OS technicians eventually understand after decades of using z/OS. However, a few highly experienced technicians must understand these details thoroughly. The z/OS technicians that understand these details in challenge #10 are typically the best z/OS technicians in a large enterprise.

The previous challenge described how a data set name is stored and located on a specific disk volume.

Large enterprise z/OS environments have many thousands of disk volumes.

How does z/OS locate a data set name among many thousands of disk volumes?
Challenge #10 will answer the above question with an explanation, then challenge your understanding of the explanation.

The simple answer is a CATALOG which is a list of entries consisting of Data Set Name / Volume Label pairs.
  When a data set name is allocated on a disk volume, z/OS updates a "catalog" inserting an entry with the data set name / volume label pair.
  Request to access an existing data set name starts with search of the "catalog"

The diagram below will be described in detail.

Refer back the diagram periodically to understand the description that follows.

The diagram consists of:
  • 1 Master Catalog (MCAT)
  • 3 User Catalogs (UCAT)s - 1, 2, and N
  • 6 High Level Qualifiers (HLQ or ALIAS) - hlq1, hlq2, hlq3, hlq4, hlq5, hlq6
  • 12 Data Set Names - example name is hlq1.dsn1
  • 4 Disk Volumes - vol1, vol2, vol3, vol4

z/OS can manage many thousands of disk volume labels and millions of data set names.
  Are all these cataloged data set name / volume label pairs in one place?
  "No". While possible to put all the pairs in one catalog data set,this is a bad idea for many reasons.

Where are these data set name / volume label pairs stored?
  z/OS has a Master Catalog (MCAT) which is a VSAM data set type.
  A z/OS system has one and only one MCAT

The MCAT could store millions of data set name / volume label pairs.
  But the "best practice" is to only store critical operating system data set name / volume label pairs in the MCAT
  The business data set name / volume label pairs are stored in User Catalogs (UCAT)s

z/OS has many UCATs.
  Each UCAT is defined by the storage administrator or systems programmer.

So, how does z/OS know which UCAT has the requested data set name / volume label pair?
  That question is the key to understanding the z/OS catalog structure.
  All searches for data set names start with the MCAT.
MCAT has other entry types:
   1. ALIAS name entry
   2. User Catalog name entry

The ALIAS name is effectively the HLQ that represent a collection of data set names.
  Each ALIAS name entry is "related" to a UCAT name
  Each UCAT name entry can have many ALIAS names "related" to it.
  Therefore, the MCAT consists of many ALIAS / UCAT name pairs.

A contest system example would be Z99999.JCL
- HLQ is Z99999 - An ALIAS name of Z99999 was defined to the MCAT, "related" to a UCAT name
Note: Z99999 here refers to the actual userid Z99999, not to your personal userid. The command below defined an ALIAS / UCAT pair entry in the MCAT
- define alias(name('z99999') relate('catalog.useraa'))

A future request for data set name 'Z99999.JCL' will:
 1. Search the MCAT
 2. Find Z99999 ALIAS name related to UCAT 'CATALOG.USERAA'
 3. Forward the search to UCAT 'CATALOG.USERAA'
 4. Find Z99999.JCL and associated volume label - data set name / volume label pair
 5. Forward the search to the volume label where VTOC resides

A few commands to visualize the above explanation -
From ISPF command shell panel =6, enter the following:

  • listc entry('z99999')
  • listc entry('z99999') all
  • listc
  • listc all
  • listc entry('catalog.useraa')
  • listc entry('catalog.useraa') all
  • tso help listc
3 facts from the above Background needed to complete the challenge:
  1. Above LISTC commands included contest system Master Catalog name
  2. The Master Catalog and User Catalogs are VSAM data set types
  3. The contest system has User Catalogs

Now you are ready for a challenge to demonstrate knowledge about z/OS catalog structure.


Successful completion is coding 2 LISTC commands as instructed.

Review the LISTCAT command syntax.

LISTCAT command syntax

  • The LISTC command processed by a JCL job includes much more information than LISTC command executed from TSO/ISPF session. The difference between JCL job LISTC and interactive LISTC includes how to list User Catalogs.
  • The interactive LISTC command was limited to data set names starting with your ID, a.k.a. HLQ, a.k.a. Catalog Alias Name.
  • JCL processing of LISTC ALL will result in abend 722, system (JES2) line limit setting exceeded.
    Bottom line - LISTC ALL in the JCL will NOT produce the requested the report and scorep2 routine will score challenge 10 as incorrect.

  1. tso submit jcl(job10)
  2. Review JOB10 SYSPRINT DDNAME output using SDSF (=sd) status panel (st).
  3.     The output is over 25,000 lines where the interactive LISTC had less than 12 lines.
        The output is all entries in the Master Catalog - far beyond what is specifically requested for successful completion.
  4. Please purge the large output from test runs as you proceed - p in NP column to left of JOB10 while in SDSF status (st) panel.

Edit e hlq.JCL(JOB10)
JOB10 includes 1 LISTC command with no operands.

Modify LISTC command adding operands that will:
1. List all the Master Catalog data set attributes such as VSAM type, MAXLRECL, VOLUME, etc.
  Submit and review JOB10 output - sub ; =sd; st

Edit hlq.JCL(JOB10) and replicate (r) the LISTC command line creating a 2nd LISTC line.

Modify the 2nd LISTC command to include operands that will:
2. List **only the User Catalogs known by the Master Catalog.
  Submit and review JOB10 output - sub ; =sd; st

The number of lines in the correct JOB10 SYSPRINT DDNAME output is less than 250 lines.
Observe Rec-Cnt column in the SDSF status panel for number of lines in output.

Once satisfied with output of JOB10 execution, then Edit hlq.JCL(JOB10) and change as follows:
1. Comment or delete JCL statement SYSPRINT DD that writes output to JES spool SYSOUT=*
2. Uncomment JCL statement SYSPRINT DD that writes output to &&TMP
3. Uncomment JCL statement EXEC TRUNC80

If the job run was successful, then P2.OUTPUT(#10) will contain requested information.
The #10 output is truncated to 80 columns and that is expected.

Now you know more than the average z/OS technician.

Feel free to move on to the next challenge now.

Next: Challenge #11

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


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
        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
      * 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

  • 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


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)
  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

IT Organization and Data Center Support
Part Two - Challenge #12


Large Enterprise IT organizations are divided into specific roles with distinctive responsibilities.

  • Application Development
    * Maintain existing programs and write new programs in support of the business
    * Supported by all roles that follow
  • Data & Disk Storage Administration
    * Maintain and monitor disk storage space used by application development and production processing
    * Define logic and constructs to automatically assign disk storage for new data sets based upon requesting application or user
    * Backup important data and be prepared to restore data upon request
  • Data Security Administration
    * Secure and monitor protected data sources
    * User ID management and authorizations
    * Secure data tranmitted over networks
    * Selectively encrypt data
  • Data Base & Transaction Services Administration
    * Support and services related to complex Data Base & Transaction Services technology
  • Systems Programming
    * Install and maintain hardware, operating system software and other vendor software
    * Responsible for problem identification and resolution of operating system failures operational issues
    * Implement and support procedures used by all IT organization roles
    * Responsible for system performance and system capacity
Far from least of these roles and responsibilities is

  • Operations - Systems and Network
    * 24x7 Data Center control, monitoring, and problem resolution related to hardware, operating system, and network
    * Responsible to all users for continued IT service
    * Most operational procedures and processes are created by System Programmers
    * Receives support from any of the above distinctive roles depending upon the problem
  • Production Analysts
    * 24x7 Data Center control, monitoring, and problem resolution related to application program processing
    * Maintain production schedules involved many thousands of jobs that run daily
    * Support and services related to automation of operation and production processing
    * Receives support from any of the above distinctive roles

An interesting aspect about these technology roles and responsibilites is that the skills can be applied to a wide variety of industries.

The previous challenges are core z/OS skills that prepared you for challenges related to these specific roles. The best place to start a journey of mastering a large enterprise IT organization is the operations and production analyst area. This is where everything comes together and has the broadest view of the technology, roles, and responsibilities.


Successful completion of this challenge has data in hlq.P2.OUTPUT(#12).

z/OS operation staff must be familiar with operating system commands for immediate problem analysis related to reported problems.


  • Large Enterprise Executive Assistant (EA) is very aware that an unscheduled mainframe outage costs the company a small fortune every minute that the processing environment is unavailable to the general public.
  • EA receives a message on the screen while interacting with the mainframe that reads, "Catastrophic System Failure".
  • EA is alarmed that this message could represent financial harm to the organization.
  • EA calls the production operation help desk, the nerve center of critical processing activity, and reports the "Catastrophic System Failure" message.
  • Help desk immediately informs the lead operator that EA is reporting a "Catastrophic System Failure".
  • The lead operator now owns this reported problem.
  • None of the automated processes or automated operational alert mechanisms is reporting a system problem.
  • If the lead operator is unable to isolate and resolve a problem, the procedure is for operator to contact systems programming.
  • The lead operator is expected to manually check on the z/OS environment with a series of actions prior to contacting the systems programming team for assistance with the reported problem.

Output from the commands below will contain answers to questions that the systems programmer will ask you, the lead operator.

Use the SDSF console facility, then open a user log to conveniently look back through command output previously entered.

=sd ; ulog

Navigating the system log uses syntax that is available when reading a data set using ISPF such as

  • find
  • find prev
  • up (F7)
  • down (F8)
  • left (F10)
  • right (F11)
  • top (m F7)
  • bottom (m F8)
  • CSR for Scroll amount

Enter the following commands as if you are the lead operator just looking around the z/OS environment for anything abnormal. Don't worry if you enter a command incorrectly. It will not affect the ability to complete the challenge 100% correctly. Just enter the proper command again.

  • /d t
  • /d r,l
  • /d grs,all
  • /d m=cpu
  • /d m=stor
  • /d m=chp
  • /d asm
  • /devserv qdasd,type=all
  • /d alloc,grplocks
  • /d omvs,limits
  • /d omvs,file,exception
  • /d omvs,waiters
  • /$jddetails
  • /d autor
  • /d ios,stop
  • /d a,l
  • /d msgfld
  • /d prog,exit
  • /d prog,apf
  • /d prog,defaults
  • /d ssi,status=active
  • /d ppt,all
  • /d net,id=osatrl1e,e
  • /d tcpip,,n,route
  • /d tcpip,,n,devlinks

Entering ulog again will show all command output in our personal user log.

z/OS Display commands and descriptions
z/OS DEVSERV command and description

Enter the following to immediately engage with the on-call systems programmer which simulates a cell phone text message facility:

tso zhelp
Tip: There are just 3 questions. The first time, just record the question and press enter to read and record the next question.

Read each question and enter to proceed to next question. The output from the commands previously entered include the answers to the questions. Review the ULOG or SYSLOG to find the answer to each question and enter tso zhelp providing answers. You may enter tso zhelp as many times as needed. Each new execution of zhelp replaces previous zhelp answers.

Answers are written to hlq.P2.OUTPUT(#12). View hlq.P2.OUTPUT(#12) to validate your answers

Attention MAC workstation contestants:
If hlq.P2.OUTPUT(#12) lines appear blank, then enter right of F11 and scan for numbers.
If the 3 numbers are on the far right side of the line, all is ok, F3. Score routine will find the numbers.
If the lines are totally blank, then enter answer to question #1 on line 1, answer to question #2 on line, and answer to question #3 on line 3 .

Next: Challenge #13

Operations Automation
Part Two - Challenge #13


Enter the following to begin this challenge -
tso submit jcl(job13a)

Automation of operational procedures can be accomplished with software products or available commands accompanied by a small bit of programming.

Large Enterprise computing operations are highly automated. While the environment runs on autopilot, if a problem occurs beyond the scope of automated operations, then the technical staff must quickly react to identify and resolve the problem.

A large computing environment infrastructure is constantly changing as a result of upgrades to hardware, software, network, and business applications. Automated procedures require adjustments to accommodate those changes. Changes to the environment can result in a problem automation is unable to handle requiring operations or systems technical staff to identify and resolve the problem.

Therefore, like a fireman or an aircraft pilot, an operator should spend time reviewing the automated procedures. The more the operator learns about the underlying technology, the better equipped the operator is to manage unexpected problems or even find an opportunity to contribute additional automation.

Automation related to security is receiving significant attention as a result of web enablement of critical systems and data that was not previously available to the general public. When someone or something is continously looking for open doors to access critical data that does not belong to them, then action is needed. A couple of decades ago, those doors to the critical data did not exist. Even when the doors are closed, those doors may not be sufficiently locked. The issue is data must pass between the highly fortified back end systems and the general public. While authentication, encryption, and other fortifying technology is applied, the criminally minded are constantly probing for weaknesses to exploit.

Some highly secure computer systems are without network connectivity or the network is only able to read while updates are not possible or the network is only able to send updates while read of existing updates is not possible. Many large enterprise IBM mainframe environments must enable both reading and writing to serve the general public. The IBM mainframe has achieved the highest level of security for such an environment. If you are curious about computing security levels, internet search for "Common Criteria", "Evaluation Assurance Level, EAL", "Multi-Level Security, MLS", or "Trusted Operating System". IBM z Systems hardware running z/OS has achieved EAL 5+ rating which is the best rating achieved by a publicly accessible general purpose computing environment. An example of a computer system rated EAL 6 is where the operator of the computing system is a military pilot flying the most advanced aircraft.

While IBM z Systems running z/OS has EAL 5+ capabilities, requirement to implement and maintain security best practices is required by the organization.

Many IBM z Systems z/OS environments are tightly locked down which only enables designated users to access only what they are explicitly permitted to access. The result is the inability to learn about and explore z/OS capabilities to develop z/OS skills. Your participation in the Master the Mainframe contest provides access to capabilities unavailable to many internal technical staff members within a large enterprise operation.

Operations technical staff are trusted staff members. Operations technical staff will have access to capabilities necessary for their job responsibilities that are not available to application development and other Information Technology staff. Operations is a great place to gain the big picture of the organization.

Challenge Scenario

You are a trusted member of the operations staff. Security and systems programming staff collaborated about the potential need for additional firewall rules based upon suspected unauthorized external probing of the system. You are instructed to collect data when a specific symptom occurs to provide the security and systems programming staff with immediate facts about the environment that may potentially prove or disprove technical staff theory that would assist with effective firewall adjustments.

Do the following because as a trusted operator you are asked to:

  1. Use SDSF SYSLOG facility
    =sd ; log
  2. Enter the following MVS command
    /d net,csmuse,pool=4khcom
      write down detail total for 4KHCOM pool
  3. Enter the following command from either SDSF or ISPF panel
    tso netstat stats
      write down values for:
        - IPV4 Packets Received
        - IPV4 Received Header Errors
        - IPV4 Received Address Errors
        - IPV4 Received Packets Discarded
        - IPV4 ICMP Messages Received
        - IPV4 ICMP Messages Sent
        - Current Established Connections
        - Current Stalled Connections
        - Current Servers in Connection Flood
    Hint: You can copy the entire output of the command, for example, with Vista TN3270 you can use a combination of Edit pulldown Copy followed with repeating Copy Functions > Copy Append to place the entire output into your clipboard.
  4. Wait several minutes, then
        - record second set of values using above 1, 2, and 3
        - record differences in values

Note: MVS command /d tcpip,,netstat,stats produces the same output as tso netstat stats.


The operational symptoms described by security and systems programming staff are occurring several times a day resulting in the repeated labor intensive task to collect requested data. Operations staff decided to automate the above procedure. However, the automated procedure has a syntax error that must be corrected to work.

You previously submitted JCL(JOB13A) which accomplished 1, 2, and 3 outlined in the above challenge scenario. JCL(JOB13A) wrote output from first execution of commands into hlq.CH13.OUTPUT(RUN1).

JCL(JOB13B) writes output from second execution of commands into hlq.CH13.OUTPUT(RUN2). A REXX routine reports the differences in values of interest to security and systems progamming staff.

The REXX routine does work properly. If you care to view the REXX routine, browse 'b' ZOS.MTM2017.PUBLIC.CLIST(CH13).

Big hint: The REXX routine assumes correct command syntax producing command output. Review hlq.CH13.OUTPUT(RUN2) after submitting JOB13B for more useful problem symptoms.

Enter the following -
tso submit jcl(job13b)

Use SDSF to review JOB13B output. Use ? to the left of JOB13B and select s DDNAME SYSTSPRT with associated StepName REPORT.

Observe SYSTSPRT output fails to have values for the second execution of the commands. Example, variable 'R2.4KHCOM.POOL' is in the report where the value for 4khcom pool should be. The REXX routine uses variable R2.4KCOM.POOL to store and report the value. Other REXX routine variables begin with R2.. If the output contains literals that begin with R2., then something is still incorrect. REXX routine is NOT the problem. The REXX routine is reading hlq.CH13.OUTPUT(RUN2) and the content in RUN2 is incorrect as a result of an error in JOB13B.

JCL(JOB13B) is creating hlq.CH13.OUTPUT(RUN2). Therefore, a correction to JCL(JOB13B) will produce a good report.

Once a good report is produced, then write the report to hlq.P2.OUTPUT(#13) as follows:

  • Enter xdc to the left of DDNAME SYSTSPRT associated with StepName REPORT as follows:

  • Another panel is displayed enabling member #13 to be written to p2.output as follows:
    BLKS in the Space units field is required. However, value below Space units (BLKS) will be ignored of Disposition shr. In screen shot below, all attributes in red must be specified and then press Enter

Successful completion will be a valid report in hlq.P2.OUTPUT(#13)

Next: Challenge #14

Production Control Analyst
Part Two - Challenge #14


Try an internet search using words z/OS Production Control Analysts. You will find jobs using terminology from the previous challenges. Large Enterprise IT organizations use Job Scheduling Software to control thousands of JCL jobs with complex processing dependencies. The skill set of a Production Control Analyst includes analysis of JCL job dependencies. A responsibility of the Production Control Analyst is to identify and resolve issues related to scheduled JCL jobs.

An analogy to JCL job scheduling dependencies is a manufacturing assembly line where cars proceed through a series of assembly stations. Each station completes a task, such as installing the front windshield. If the windshield installation station fails, the assembly line stops until the windshield installation station problem is resolved. Obviously, immediate attention is directed to the windshield installation station due to business impact that can be costly.

You can think of z/OS Production Control and Job Scheduling as an assembly line where the product passing through the assembly process is critical business data.

JES2 is a z/OS component that reads and prepares JCL for processing by z/OS. A brand new Job Scheduling feature is available in the latest z/OS level used in this contest.

This is an opportunity for you to learn some specific z/OS technology and terminology many professional z/OS Production Control Analysts have not had the opportunity to learn.

The new feature is JES2 Execution Control, JEC.

If you interview for a z/OS Production Control Analyst position and the employer asks, "Are you familiar with XYZ Production Control Job Scheduling software?"

You can respond, "No, however, I do have experience with JES2 Execution Control which is the principle behind the more sophisticated Production Job Scheduling software packages."

That response would be impressive, demonstrate your technology flexibilty, and potentially prompt them to ask, "What is JES2 Execution Control?", giving you the opportunity explain your value to them.

A JEC statement stream is a special type of JCL statement stream that creates a job group. A job group includes related job names with assigned attributes that determime when execution should begin for each job name.

What value is the new JEC capability in an IT organization that has Job Scheduling Software?

  • Application developers can use a private Job Scheduling mechanism to test dependency processing before implementing the jobs into the production schedule
  • A Production Control Analyst could use JEC to resolve a problem in the production job schedule
    * a toolbag of JEC procedures could be constructed to resolve production job scheduling processing problems more quickly
  • New automated operation procedures can be implemented without adding additional complexity in the production control job schedule
  • JEC is included with z/OS and does not require installation or additional software costs

As previously mentioned, z/OS technology skills can be applied to a wide variety of businesses.

For the purpose of this challenge, let's assume a business that orders massive volumes of food products, then distributes packaged food products to bakeries, restaurants, donut shops, etc. The specific business application involves bulk ordering of flours, sugars, and oils, then distributed in packed smaller bulk amounts to client bakeries, restaurants, donut shops, etc.

The fictitious company name is "FSOC, Flours, Sugars, Oils Company"

A daily set of JCL jobs are scheduled and processed that are critical to the business.

Clients place orders for flour, sugar, and oil throughout the day as input to the following schedule of JCL jobs:

J####?? where ?? represents a JCL job name suffix for:

??  JOB Description
00  cut-off ordering deadline is reached for next day deliveries
 --- 10, 20, and 30 can run concurrently after 00 successfully completes
10  flour orders are totalled
20  sugar orders are totalled
30  oil orders are totalled
 --- 11, 21, and 31 can run concurrently after 10, 20, and 30 respectively
11  flour inventory checked to fill orders
21  sugar inventory checked to fill orders
31  oil inventory checked to fill orders
 --- 12, 22, and 32 can run concurrently after 11, 21, and 31 respectively
12  flour order added to next day client shipment
22  sugar order added to next day client shipment
32  oil order added to next day client shipment
 --- 40 can run after 12, 22, and 32 successfully completes
40  create truck delivery loads and shipping instructions
 --- 41 can run after 40 successfully completes
41  create massive bulk order based upon product inventory levels

The challenge will focus on JEC statements used to control job name dependency processing of the above jobs.

Challenge Setup Actions:

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

Enter the following:
tso ch14
The above changed all occurrences of #### to the last 4 digits of your ID in hlq.JCL(JOB14A) and hlq.JCL(JOB14B)

Enter the following:
tso submit 'zos.public.jcl(fsoc)'
The above copied data sets and executable modules required for this challenge.

The following data sets were created as application program inputs and outputs:

Several executable modules were copied to hlq.LOAD


  • The challenge is limited to a "correction" in the JCL JEC statement stream
  • The challenge is limited to a subset of JEC capability and function
      JES2 Execution Control includes capability and function beyond what you will observe in this challenge
  • You will have no need to understand the application code or application JCL in this challenge
      Part 3 includes exposure to the application code and application JCL


JEC statement dependency relationship has 2 steps:
  1. Submit JEC statements to inform the system of JOB dependencies
  2. Submit the JCL JOBs identified by the JEC statements

View hlq.JCL(JOB14A)
Observe the following:

  • JOBGROUP statement identifies a job group named G####
      where #### is last 4 digits of your ID
  • 12 GJOB entries
  • GJOB statements identify individual JCL job names in the group
  • AFTER operand associated with GJOB statement creates a JCL job dependency relationship

Submit the JCL JEC statements and review the status of the job group as follows:
Enter the following while viewing hlq.JCL(JOB14A):

submit ; =sd ; jg

help or F1

  Note: In the event of system message, "In data Z#####.JCL", then help or F1 again

3 to select Action Characters
D, Display Information in the log.
You can add:
E - Jobs in the group that encountered an error
J - Jobs associated with the group
L - Information about the group, long form
N - Network
P - Dependencies for the group

Enter to go forward in the Action Characters help panel and observe:
JP    Dependencies for the group (access the JP panel).

Try the various actions above on the Job Group JG panel Action Characters against your job group, G####. You will need to F3 to exit from action command output and return to JOB GROUP DISPLAY panel to enter next action character command.

The next step of the challenge is to submit the JCL jobs, then enter these same commands to observe the differences

Note: Next action involves JCL JOB14B - NOT JOB14A

The JCL job names identified in the JOB GROUP DISPLAY need to be submitted - which follows:

View hlq.JCL(JOB14B)
Observe the following:

  • 12 job names, each identified by JCL JOB statement - 1 for each GJOB in JCL JOB14A
  • Each job name is executing a JCL procedure with the exception of J####00
      Each JCL procedure contains:
        unique program name to be executed
        allocation of specific inputs and outputs required by the program
      However, understanding the JCL procedure is NOT relevant to completing this challenge
  • SCHEDULE is a JEC statement that connects a job name to JOBGROUP=G####
    12 SCHEDULE statements
  • J####00 job name contains
    TYPRUN=HOLD on the JCL JOB statement
     EXEC PGM=IEFBR14 - not a JCL procedure
  • J####00 will execute immediately upon being 'released' from hold status
  • G#### job dependency chain will begin to execute only upon completion of J####00
Enter the following while viewing hlq.JCL(JOB14B):

submit ; =sd ; jg

Try the Job Group Action Characters to observe differences
  • JP now includes unique JES2 JobIDs with dependency JES2 JobIDs
  • DJ now includes unique JES2 JobIDs with job status and completion status
From SDSF enter
  • J#####00 in Status HOLD
  • Several J####?? jobs in queue SETUP
  • However, one of the J####?? jobs is in queue PRINT
      - this is a big hint about the correction needed to JEC statement stream
      - check the dependency diagram in the instructions above

From SDSF ST panel enter a to the left of J####00 as follows to 'release' the job:

Following completion of J####00, then the other job names with dependencies will run

Note: It may take a minute or so for the order of the jobs and the Queue to match the above display.

Check the Job Group from SDSF as follows:

=sd ; jg

  • JOBGROUP Status is Complete
  • Current-CC is ABENDU4038

Select s G#### and observe the messages in the JOBGROUP log to determine which jobname ended with ABEND=U4038

According to the dependency diagram above in the instructions, what job name should run last? A correction is needed in JOB14A JEC statement stream to avoid the abend

If the JOBGROUP has a program abend, then:

  • from SDSF jg panel, enter c to the left of G#### to cancel the JOBGROUP
  • from SDSF jg panel, enter p to the left of G#### to purge the jobs and the JOBGROUP
    NOTE: purge might take a minute or two to complete.
      Do NOT proceed until G#### is purged from queue.
  • tso submit 'zos.public.jcl(fsocx)'
      above JCL resets the application input and output data sets to the original state
  • Edit JOB14A
    correct the JEC statement stream to be consistent with the dependency diagram
       view the other JEC statements and observe AFTER JEC dependency operands
       the correction is to insert 1 JEC statement in the JOBGROUP stream of statements
      The above submit of JOB14A established the JES JOBGROUP dependencies.
    tso submit jcl(job14b)
      The above submit of JOB14B put the JCL jobs in the queue for execution using established JOBGROUP dependencies.
  • from SDSF ST panel, release a J####00
  • from SDSF JG, select s G#### JOBGROUP log

If the JOBGROUP log reads that all jobs completed successfully, then:

  • from SDSF jg panel, enter xdc to the left of G#### as follows:

    Another panel appears and enter the following to write the G#### JOBGROUP log to hlq.P2.OUTPUT(#14)

  • from SDSF jg panel, enter c to the left of G#### to cancel the jobs and the JOBGROUP
  • from SDSF jg panel, enter p to the left of G#### to purge the jobs and the JOBGROUP
    NOTE: purge might take a minute or two to complete

z/OS JES2 Execution Control Statements

You'll find the output from this challenge is stored in P2.OUTPUT(#14). Well done! You are quickly reaching the end of part two!

Next: Challenge #15

Business Programming Language
Part Two - Challenge #15


You use computer programs many times a day. Each time you use your cell phone or access the internet, you are executing computer programs. The vast majority of the time you pay for something, computer programs are being executed. 92% of money is digital, meaning the money is controlled by computers. Only 8% of money is physical coins and paper.

Computer programs are computer instructions and programming languages are used to create the computer programs. Understanding computer programming languages is a fundamental skill in today's highly digitized world. Experienced computer programmers know after learning the first computer programming language, it is increasingly easy to learn and use other computer programming languages.

One programming language was designed specifically for business, COBOL, COmmon Business-Oriented Language. COBOL is one of the early programming languages. COBOL programming language continually improved over decades as did the business logic written in COBOL. COBOL code is processing some of the worlds most critical data every day. COBOL was tailor made for processing critical back-end data. The benefit of knowing this programming language is the ability to understand the critical day to day business logic implemented by employees probably long retired from a company.

During the past few decades, several major programming languages emerged with the internet, such as Java, Java Script, C/C++, Python, etc. These programming languages and the internet are tailor made for each other just as COBOL was tailor made for processing back-end critical data. Newer programming languages, such as SWIFT and GO, continue to emerge with the emergence of internet devices and blockchain.

Each of these programming languages are important in the technology area they best serve. A highly experienced application developer will take the time to thoroughly understand the critical back-end programs to write highly efficient front-end programs. Quite often, a minor change to back-end programs can make front-end programs much simpler to write and maintain while being significantly more efficient. An example would be a mobile phone program that communicates with a mainframe program to check a bank balance where the front-end mobile phone is written in Java Script or SWIFT and the back-end mainframe program is written in COBOL.

COBOL programming language is an excellent starting place to learn how to create computer programs.

Reasons include:

  • Easy to read and maintain as a result of English-like syntax
  • Emphasis on inputs and outputs
  • Split into logical sections called Divisions
      Define program inputs and outputs
      Declare program variables
      Business logic using the above inputs, outputs, and variables
  • Program syntax is compiled validating the syntax prior to execution
      Compiled programs are more efficient for high volume and high frequency processing
      Re-compile is only required when source code needs to be changed
  • Large Enterprise employers have lots of critical COBOL programs
      COBOL on a resume is attention getting and could help get that interview
      Employers are aware it is a mistake to re-write highly efficient COBOL into a different programming language
      Employers are aware it is relatively easy to web enable back-end COBOL processing without making program changes
There are over 220 billion lines of COBOL programs running today, which equates to around 80% of the world's actively used code. z/OS on the mainframe can run COBOL programs written for previous generation operating systems as well as today's 64 bit operating systems without requiring a recompile of the programs which is a huge benefit to large enterprises with applications that run 24 hours a day, 7 days a week.

The contest system will use the latest release of COBOL. Enterprise COBOL for z/OS, V6.1 continues the IBM commitment to COBOL on z/OS. Companies gain the benefit of new investment combined with more than 50 years of IBM experience in compiler development. This allows new code and recompiles of existing code to exploit hardware efficiencies introduced with state-of-the-art mainframes.

This challenge uses COBOL programming language to demonstrate fundamental programming skills. All programming languages can accomplish the same computer instructions using different syntax. If all programming languages can accomplish the same computer instructions just using different syntax, then why so many different programming languages? If you are interested in an answer to the question, then please read a brief explanation posted in stackoverflow below:

Why are there so many programming languages?.

Challenge Preparation:

The challenge is to correct an existing COBOL syntax problem, then enhance the same COBOL program.

NOTE: If you already have some experience with COBOL or you just want to try to complete the challenge without preparation, then go for it. If you struggle with completing the challenge, then please review the challenge preparation.

In Part 3, some of the challenges include COBOL. The Part 3 challenges will assume knowledge of challenge preparation below.

The following will prepare you to accomplish the challenge.
So, if you do not review this now and you decide to tackle Part 3, then remember this is here to review later as needed.

  1. Compile COBOL programming language into executable program that writes a single line
  2. Review simple read and write
  3. Review simple read numbers, add numbers and write the sum
  4. Review simple character string read, move character string operation, and write the moved character string
  5. Review simple read from data set name and write to different data set name
  6. Review boolean logic using COBOL IF/THEN/ELSE and EVALUATE
  7. Review do loop iteration and transfer control processing using COBOL PERFORM
  8. Review iteration processing to read and change a stream of records using COBOL PERFORM
  9. Review COBOL compile syntax error and correction using intrinsic function capability
  10. Review COBOL string capability
  11. IBM Enterprise COBOL professional documentation

To accomplish the above challenge preparation, you will be given explicit instructions to follow and you will be directed to a different web site to read an explanation.

  1. Compile COBOL programming language into executable program that writes a single line
    tso submit 'zos.mtm2017.public.cobol(cbl1)'

    =sd ; owner your_id ; st

    sj to the left of CBL1

    Observe the following:
    • JCL PROCEDURE, IGYWCLG, used to compile the in-stream COBOL program language statements
        create executable program a.k.a. "link edit", and run (execute) the program

    NOTE: Use Function Key 3, F3 , as needed to exit and return to previous panels.
    Review output using SDSF ST panel as follows:

    ? to the left of CBL1
    Observe 6 DDNAMEs in CBL1 output
    JESMSGLG - JCL job return code for each of 3 JCL steps COBOL (compile), LKED (link edit), GO (run)
    JESYSMSG - system message associated with job execution
    SYSPRINT (COBOL - ProcStep) - COBOL program language compile output
    SYSPRINT (LKED - ProcStep) - create executable program
    SYSOUT (GO - ProcStep) - output from program execution
    select s each DDNAME above and review the DDNAME output

    =sd ; st

    sj to the left of CBL1
    Observe COBOL programming source code to DISPLAY literal characters

    Note: If the command input area is not long enough to enter desired tso submit command, navigate back to the SJ panel, or to ISPF option 6 (ISPF command shell) to enter command. From ISPF option 6 (ISPF command shell), prefixing the submit command with TSO is optional. In fact a command such as submit entered without TSO will be remembered on the ISPF command shell and can be used later retrieved for optional modification and reexecution.
  2. Review simple read and write
    tso submit 'zos.mtm2017.public.cobol(cbl2)'

    =sd ; st

    sj to the left of CBL2

    Observe the following:
    • DATA DIVISION and WORKING STORAGE SECTION are used to define a program variable data field, DATA-RECORD, to store the ACCEPTed value and DISPLAY content in the variable field
    • The declared data type, PIC X(80), is a picture clause where X means character format and 80 is the length of the data field.

    Review information about COBOL program structure at URL below
      Thanks to University of Limerick for an excellent description
      Scroll forward in the link below - start reading at COBOL coding rules
    COBOL Program Structure from University of Limerick

    Review information about COBOL basic syntax at URL below
    COBOL Basic Syntax

    Review information about COBOL data types at URL below
    COBOL Data Types

    Review information about COBOL basic verbs at URL below
    COBOL Basic Verbs

    Review output using SDSF ST panel as outlined in #1

  3. Review simple read numbers, add numbers and write the sum
    tso submit 'zos.mtm2017.public.cobol(cbl3)'

    =sd ; st

    sj to the left of CBL3

    Observe the following:
    • INPUT-AREA declares several variables
    • Example is FIRST-NUMBER with a PIC 999 which means the length is a fixed 3 numeric structured field.
      Important - the behavior of fixed structured numeric fields include:
      1. When PIC 999, then input of 1234 would be read as 123 truncating last number
      2. When PIC 999, then input of 23 would be read as 230 where zero is at the end of the field
      3. When PIC 999, then input of 023 would be read as 023 where data field includes leading zero for correct arithmetic operations using this number
      4. Given a sum field such as ADD-ANS PIC 9999, when the value exceeds 4 numbers, then the leading number will be truncated
      5. Program techniques exist to insert zero in leading position when number is less than length of field
      6. Compiler options exist to take action when truncation occurs as a result of a sum exceeding length of field

    Review output using SDSF ST panel as outlined in #1

  4. Review simple character string read, move character string operation, and write the moved character string
    tso submit 'zos.mtm2017.public.cobol(cbl4)'

    =sd ; st

    sj to the left of CBL4

    Observe the following:
    • FIRST-CHARS data type is character length of 80
    • SECOND-CHARS data type is character length 1
    • MOVE character field with length of 80 TO a character field with length of 1
    • Review the program output to see character truncation behavior
    • COBOL programming techniques exist to determine length of character field and take action based upon the length

    Review output using SDSF ST panel as outlined in #1

  5. Review simple read from data set name and write to different data set name
    tso submit 'zos.mtm2017.public.cobol(cbl5)'

    =sd ; st

    sj to the left of CBL5

    Observe the following:
    • COBOL verbs READ and WRITE are designed to associate internal file name with a JCL DDNAME while ACCEPT and DISPLAY are designed to read and write from default input and output
    • INPUT-OUTPUT SECTION and FILE-CONTROL is used to identify input and output file information
      1. SELECT identifies a program internal name
      2. ASSIGN TO identifies a JCL DDNAME associated with the program internal name
      3. FILE SECTION describes attributes of the SELECTed files
      4. FD - File Descriptor
    • Notice the JCL DDNAMEs RECIN and PRINT at the bottom
    • Read the PROCEDURE DIVISION file handling verbs and compare to PRINT DDNAME output

    Review information about COBOL File Control at URL below
    COBOL File Organization

    Review information about COBOL File Handling Verbs at URL below
    COBOL File Handing Verbs

    Review output using SDSF ST panel as outlined in #1 with one exception -
    CBL5 output includes PRINT DDNAME to instead of SYSOUT DDNAME

  6. Review boolean logic using COBOL verbs IF/THEN/ELSE and EVALUATE
    tso submit 'zos.mtm2017.public.cobol(cbl6)'

    =sd ; st

    sj to the left of CBL6

    Observe the following:
    • JCL PROCEDURE is IGYWCL with parameter CBLPGM=CBL6
      1. IGYWCL created a permanent program, CBL6, in hlq.LOAD
      2. Previous jobs used JCL PROCEDURE IGYWCLG that created a temporary program
          where IGYWCL created a permanent program that can be executed repeatedly without repeatedly compiling the program language source code
          You will execute the permanent program, CBL6, repeatedly from TSO/ISPF interface
    • Read code from EVALUATE to END-EVALUATE
    • Read code from IF to END-IF
    • A period exists after END-IF indicating end of a sentence
      1. A period can terminate a PROCEDURE DIVISION paragraph
      2. A period can terminate a PROCEDURE DIVISION sentence
      3. A period can terminate a PROCEDURE DIVISION statement
      4. A PROCEDURE DIVISION statement without a period is logic embedded within the sentence
    • IF to END-IF is a sentence with many statements
    • EVALUATE to END-EVALUATE is a statement within an existing sentence
    • Therefore, the sentence ( IF to END-IF. ) is compounded true/false program logic

    You will now repeatedly execute program CBL6 to help you understand the above explanation

    From ISPF Command Shell panel =6, enter the following:
    call load(cbl6)

    Interact with the CBL6 program logic considering the above explanation of CBL6 source code
      Note: You can enter input using lowercase and/or uppercase characters.

    Review output using SDSF ST panel as outlined in #1

  7. Review do loop iteration and transfer control processing using COBOL PERFORM
    tso submit 'zos.mtm2017.public.cobol(cbl7)'

    =sd ; st

    sj to the left of CBL7

    NOTE: Thanks again to University of Limerick for an excellent explanation and example COBOL code to demonstrate iteration (do loop ) processing and transfer of control processing.

    Review information about COBOL iteration and transfer control processing at:
    COBOL PERFORM explanation from University of Limerick

    Observe the following:
    • CBL7 source code is from University of Limerick site with explanation of iteration logic and transfer of control using the PERFORM verb
    • PERFORM in-line is generally used for iteration (do loop) logic
    • PERFORM out-of-line is used for transfer of control (branch to then return) logic

    Review output using SDSF ST panel as outlined in #1

  8. Review iteration processing to read and change a stream of records using COBOL PERFORM
    tso submit 'zos.mtm2017.public.cobol(cbl8)'

    =sd ; st

    sj to the left of CBL8

    Observe the following:
    • CBL8 might look familiar
      A previous challenge required a JCL modifiication to make COBOL CBLRDWR source code execute successfully
      CBL8 was copied from CBLRDWR, then modified as follows
      1. REC-STORAGE was structured into 2 fields, REC-NUMBER and REC-TEXT
      2. An in-line PERFORM sentence is used to loop through a read operation to read input records until the last record
      3. The in-line PERFORM sentence includes execution of an out-of-line PERFORM to execute code located at CHANGE-REC, then return control to the in-line PERFORM to read the next record
      4. The out-of-line PERFORM code at CHANGE-REC modifies the input record field, REC-TEXT, to literal Hello COBOL before writing the record

    Review output using SDSF ST panel as outlined in #1

  9. Review COBOL compile syntax error and correction using intrinsic function capability
    tso submit 'zos.mtm2017.public.cobol(cbl9)'

    =sd ; st

    sj to the left of CBL9A and CBL9B

    Observe the following:
    • The source code is similar to code seen earlier with several differences
      1. FIRST-NUMBER is declared as character, PIC X(3), instead of numeric, PIC 9(3)
      2. SECOND-NUMBER is declared as character, PIC X(3), instead of numeric, PIC 9(3)
      3. COMPUTE verb is used to add FIRST-NUMBER and SECOND-NUMBER
    • CBL9 consists of 2 jobs, CBL9A and CBL9B
    • CBL9A fails to compile as a result of arithmetic attempted on character data type
    • CBL9B successfully compiles and executes as a result of applying an intrinsic function
      1. FUNCTION NUMVAL(FIRST-NUMBER) converted character data type to numeric data type
      2. FUNCTION NUMVAL(SECOND-NUMBER) converted character data type to numeric data type
    • Enterprise COBOL has many intrinsic functions
    • COBOL intrinsic functions are effectively reusable code that significantly reduces the number of lines you need to code to accomplish a task in the logic

    Review output using SDSF ST panel as outlined in #1

  10. Review COBOL string capability
    tso submit 'zos.mtm2017.public.cobol(cbl10)'

    =sd ; st

    sj to the left of CBL10

    Observe the following:
    • While possible in the DATA DIVISION to declare different views of a record or of fields within a record, any string can have a starting position and length immediately applied in the PROCEDURE DIVISION giving a unique view of the string
    • LITERAL-STRING(2:5) is an example of unique view immediately applied to an existing string in the PROCEDURE DIVISION

    Review output using SDSF ST panel as outlined in #1

  11. IBM Enterprise COBOL for z/OS professional documentation

    Congratulations! If you stepped through the challenge preparation, then you can claim to know COBOL. You can signup for a COBOL class at your University and get a very good grade. COBOL is skill that can be an attention getter on a resume to help secure an interview with a large enterprise where the core business logic is COBOL.

    Below are the COBOL professional manuals used by large enterprise application developers


COBOL program language source code, CBL15, is available to:

  1. read first set of numbers declared as packed decimal data type
  2. total first set of numbers
  3. read second set of numbers declared as a character data type
  4. total first and second set of numbers
  5. write grand total to hlq.P2.OUTPUT(#15)

The following actions are needed to complete the last Part 2 challenge:

  1. edit hlq.SOURCE
  2. s cbl15 to select new empty member named cbl15
  3. copy COBOL program language source code from 'zos.mtm2017.public.cobol(cbl15)'
  4.   Note: enter hilite cobol color code known COBOL reserved word syntax.
  5. submit
  6. review CBL15 output
  7. identify compile errors
  8. edit hlq.SOURCE(CBL15), correct compile errors, and resubmit until execution is successful

Hint: Only 1 line in CBL15 requires 2 changes to successfully execute program

Successful execution of CBL15 writes the total of all read numbers into hlq.P2.OUTPUT(#15)

You just completed Part 2. Time to check your work.

Next: Completing Part 2