Getting Started
Part Two - Challenge #01

Background:

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

Click twisty to view Reminder
Contest ID in the instructions:
  All references to Z##### are examples.
  Substitute your assigned ID in all cases.

The Basics

IBM Z is a powerful computer known as the mainframe in which z/OS is the IBM Z flagship operating system.

z/OS consists of many components. The components supply a rich collection of features and functions inclusive of API's to web enable any existing business application.

Classic components are available to interact with z/OS and will always be available.
-- Exposure to the classic interfaces will help you understand and master advanced z/OS interfaces
-- Many experienced z/OS System Programmers and System Administrators use both the classic interfaces and the advanced z/OS interfaces.

What is a z/OS System Programmer?

A mainframe System Programmer, usually shortened to Sysprog, plays a central role in running mainframe operations. They are responsible for coordinating, and sometimes executing, just about every change that happens on the system. If a new release of software is coming in, a storage unit is getting upgraded, or a decision needs to be made on how to handle a problem, the sysprog will be involved.

You don’t become a sysprog overnight. Most sysprogs start in one specific area and accumulate knowledge over time until it makes sense to take on a more central role. While they may not have to actually configure that storage device or bring up that new piece of software, being able to effectively plan and communicate with the specialists in those respective areas is part of what makes a sysprog so useful.

See Other mainframe jobs #MyMainframeJob

TSO, ISPF, and SDSF are classic interactive components.

  • TSO, Time Sharing Option, is a command line interface, CLI, analogous to personal workstation MS-DOS as the underlying CLI for Microsoft Windows.
  • ISPF, Interactive System Productivity Facility, is a full screen text based interface which is analogous with Microsoft Windows minus the GUI icons to launch features and functions.
  • SDSF, System Display and Search Facility, is another full sceen text based interface with system operation and monitoring facilities.

z/OS has a clever and unique mechanism for program execution regardless of the programming language.
-- The same mechanism includes an ability to associate program file names with z/OS managed physical resources.
-- The mechanism is Job Control Language, JCL.

One thing just about every sysprog will have to be able to do is use JCL. JCL (Job Control Language) is one of the ways you can tell the system what to do. Tasks submitted through JCL enter the JES (Job Entry Subsystem) for processing.

Having JCL and JES available to you is kind of like being the boss of a construction crew. You don’t have to do any of the heavy lifting, but you need to be able to say WHAT to do, WITH what resources, and WHERE to put the finished product. On z/OS, the WHAT is generally a program that has already been written, and we’re just telling it to run that program on some data, and then put the output somewhere else.

  • JCL, Job Control Language, consists of operational statements. JCL is roughly analogous to shell scripts.
    EXEC operation instructs z/OS what program to load and execute.
    DD operation statements associate program file names with z/OS physical resources,
      the program inputs and outputs.

Part 2 outcome includes hands-on z/OS experience with:

  • TSO, ISPF, SDSF, and JCL
  • System log
  • System commands
  • System utilities
  • Unix system services
  • Unix file systems
  • Data set types, attributes, and characteristics
  • Data character encoding schemes
  • Disk storage management
  • Data Security
  • Network communications

In challenge #1 you will learn about z/OS TSO, Time Sharing Option

The challenge objective is familiarity with TSO, Time Sharing Option.

  • TN3270 LOGON results in a session with TSO.
  • The contest system is customized to automatically start ISPF,
    a panel driven interface with full screen support.
    --- Therefore, you do not see the TSO READY prompt during LOGON process.
  • TSO is a command line interface, CLI, without full screen support.
  • TSO CLI is accessible by terminating ISPF entering x from ISPF Primary Option Menu.
  • TSO CLI displays a READY prompt for TSO commands to be entered.
  • Entering ISPF from TSO READY prompt displays the ISPF full screen support interface.

Challenge:

  • The purpose of challenge is basic navigation of z/OS TSO/ISPF
  • Initial exposure is the objective of challenge 1 with repetition and explanation to follow in later challenges
Access TSO Ready prompt, then complete TSO tasks as instructed

Logon to z/OS TSO/ISPF as you learned in Part 1.

Keep in mind the following:

  1. Right side Ctrl is TN3270 enter key by default
  2. Substitute your personal ID when instructions reference Z#####
  3. Left side Ctrl is TN3270 reset keyboard
  4. Tab key, arrow keys, and mouse click can be used to reposition cursor for data entry
  5. TN3270 display has 'protected' fields disabling ability to type into those protected areas on the display
       Use tab or left side Ctrl key to reset keyboard in the event of keyboard lock as the result of attempting to type in a 'protected' area on the display
Once logged on to TSO, then ISPF Primary Option Menu is displayed.
Enter pfshow off in the Option ===> This will suppress the function keys.
Observe the bottom of your TN3270 session. Suppressing the function keys now lets you see the "Enter X to Terminate .."
Time to logout. From ISPF Primary Option Menu, enter x to terminate the ISPF session.

The following display may or may not appear.

If the following screen appears, then tab to Process Option and enter 2 to Delete data set without printing.

The Log Data Set contains activity from session which is no longer needed.

When you are in a terminal session all of your activity is logged. Keep the planet clean and delete these unneeded data sets.

Upon successful termination of ISPF, a TSO READY prompt appears.


Actions to complete challenge #01

Complete the below actions to become familiar with some basic commands.

  1. Enter time to display time and date
  2. Enter netstat home to display system IP address
  3. Enter listc to display a current list of your personal data sets
  4. Enter submit 'zos.public.jcl(part2)' to process a background job allocating new personal data sets
  5. Enter listc to display a current list of your personal data sets
  6. Enter submit 'zos.public.jcl(tsojcl)' to process a background job which executes the same commands
  7. Enter ispf to launch the full screen ISPF Primary Option Menu
  8. Enter pfshow on to display function keys at bottom of ISPF screen

**Helpful hint: Text in bold can be copied and pasted into TN3270 session.

Enter TSO commands shown in screen shots below to complete the challenge.

Following the READY prompt, enter time as shown below
Following the READY prompt, enter netstat home as shown below
Following the READY prompt, enter listc as shown below
Following the READY prompt, enter submit 'zos.public.jcl(part2)' as shown below

Note: Enter a character of your choice when ENTER JOBNAME CHARACTER(S) - appears.

When JCL does not begin with a JCL JOB operand, then the system will generate a JOB statement beginning with your ID followed by a character(s) of your choice.

The above background job allocated new personal data sets.

Following the READY prompt, enter listc as shown below to list the new data set names
Following the READY prompt, enter submit 'zos.public.jcl(tsojcl)' as shown below
The above background job processed the same commands and wrote the output to a personal data set

Following the READY prompt, enter ispf as shown below
From the ISPF Primary Option Menu, enter pfshow on to display function keys at bottom of screen.
If you want to prove successful completion of the challenge, then take the following actions:
  From the ISPF Primary Option Menu, enter dslist p2.output
Tab to the left of the data set name and enter b to browse P2.OUTPUT data set name
Tab to the left of the member name #01 and enter s to select
Observe the member name in the data set has is the result of TSO READY prompt commands

If member #01 includes output from time, netstat home, and listc, then you successfully completed challenge 1

Enter return to return to ISPF Primary Option Menu

While many interact indirectly and unknowingly with an IBM Z mainframe each day,
few can say they interacted directly and knowingly with an IBM Z mainframe today.

You can!

Next: Challenge #02

System Display and Search Facility, SDSF
Part Two - Challenge #02

Background:

You will be introduced to SDSF, a z/OS classic interface

SDSF is a panel driven interface

SDSF is used frequently throughout the contest

Familiarity with SDSF is needed to complete challenge #02 and future challenges


Useful information about SDSF to help you complete the challenge

A less than 7 minute video is available to explain SDSF.


Challenge:

Learn a few System Display and Search Facility, SDSF, basics
Challenge 2 uses SDSF to view JOBs and JOB output owned by your ID.
Future challenges will assume you know how to use SDSF to view JOB output owned by your ID

**Helpful hint: Text in bold can be copied and pasted into TN3270 session.

Logon to TSO/ISPF as you learned from previous challenges.

Enter SDSF commands shown in screen shots below to complete the challenge.

From ISPF Primary Option Menu, enter sd to display the SDSF Menu
Remember to substitute your ID for z#####

From SDSF Menu, enter prefix * ; owner z##### ; st to display status of all jobs owned by your ID
  Semi-colon ; is used to stack commands
   SDSF command prefix * is to display all jobnames
   SDSF command owner z##### is to limit display of jobnames owned by z#####
   SDSF command st is to display status of jobnames owned by z#####
Enter tso submit 'zos.public.jcl(pgm01a)' to submit a background job to be processed

The purpose is to demonstrate how a submitted background JOB owned by you is available in SDSF to view
Enter c jobname suffix
Observe JOB with your ID followed by C suffix is SUBMITTED
  3 asterisks *** requires enter to proceed
Another enter will display a message with ENDED and MAXCC=00
  Again, 3 asterisks *** requires enter to proceed
SDSF STATUS DISPLAY lists JOBNAMES owned by your ID
  Observe the JobID column
   Any JobID beginning with TSU is a Time Sharing session, your TSO interactive session
   Any JobID beginning with JOB is a background JOB previously submitted
   SDSF STATUS DISPLAY may contain several entries including
   your TSO session (TSU), and additional jobnames (JOB)
   Z#####C is the output from the background job submitted in challenge 2

  Observe the NP column
   Action characters can be entered in the NP column
   Tab to the left of Z#####C and enter action character ? in the NP column
   -- If several Z#####C entries exist, then tab to Z#####C with the highest JobID number

Note: Enter may be required to refresh display for list to include recent JCL jobs submitted.

Observe the DDNAME column
  Each DDNAME is a section of the JOBNAME output

Tab to the left of SYSOUT and enter s in the NP column to select the SYSOUT section of the JOB
SYSOUT section of the JOBNAME is displayed as shown below

Press F3 or enter end to return to the previous display after viewing SYSOUT content
Tab to left of SYSOUT and enter xdc in the NP column
The xdc action will write the output to a member name within a data set name
  Tab to Data set name input area and type p2.output - DO NOT enter yet
  Tab to Member to use input area and type #02 - DO NOT enter yet
  Tab to Disposition input area and type shr - Now you can enter
The previous enter wrote member name #02 in data set name p2.output
  Upper right area of display includes PRINT CLOSED 10 LINE to indicate action is complete
Enter end or press F3 to see list of JOBNAMEs in the SDSF STATUS DISPLAY
Optional:
  Type p to the left of each JOBNAME with PRINT in Queue column to purge,
  then enter to execute the purge of JOBNAMEs from Queue PRINT
  Enter 1 or 3 when Confirmation Action appears to confirm purge request

WARNING: p to the left of your JobID TSU session will purge your TSO session
  If you purge your TSO session from Queue EXECUTION, then you will need to logon to TSO/ISPF again
If you want to verify you successfully completed challenge 2, then take the following actions:
  Enter dslist p2.output to jump to ISPF data set name list utility panel
Tab to left of p2.output data set name and enter b to browse data set name
Tab to left of member name #02 and enter s to select the member name to be browsed.
After browsing content of member name #02 in data set name p2.output, then press F3 or enter end a few times until you are returned to the ISPF Primary Option Menu

Successful execution of the challenge instructions created member name #02 in data set name P2.OUTPUT
where #02 contains print output from a program that was executed using JCL.

Congratulations! You are done with challenge #02. You're ready for the next challenge.

Next: Challenge #03


Interactive System Productivity Facility, ISPF
Part Two - Challenge #03

Background:

You will learn the basics of ISPF

Familiarity with ISPF is needed to complete challenge #03.

ISPF is used frequently throughout the contest to complete challenges and it was introduced in Part 1 of the contest.

While web based DevOps software exists for z/OS, ISPF is a classic and common z/OS UI. DevOps software can vary. DevOps software objective is to accelerate programming of business applications and reduce or eliminate the need of the business application developer to understand details about the underlying infrastructure.

Try some of these tools out on IBM Z Trial. In this contest, you will be going a bit deeper to learn about the code behind the buttons in a user interface.

The Master the Mainframe contest objective is for you to learn about the details in the underlying operating system. Many IT support roles exist in large enterprises that use IBM Z for critical business services and data such as security administrators, disk storage administrators, database administrators, operations, production control analysts, system programmers, etc. These support roles are responsible for production processing, software installation, software support, system support, and procedures used by the business application developers.

System technicians are frequently good programmers. They just do not focus on programming of specific business applications. System technicians write programs in support of the IT infrastructure.

ISPF is panel driven where the panels provide access to functions. The contest will use a small subset of the existing panels and functions primarily for working with data sets and unix files. In future challenges, ISPF panels will be used for disk storage administration tasks and database administration tasks.


Useful Information About ISPF

An 8 minute video is available to explain ISPF.


Challenge Preparation

LOGON to TSO automatically invokes ISPF Primary Option Menu

Optional: ISPF help command or f1 displays the ISPF help tutorial
The ISPF help tutorial has more than you will ever use. You can continuously enter to step through the ISPF help

Enter return or press f3 to exit ISPF help tutorial
Enter Option 3 to Perform utility functions
A variety of utility functions are available to select

Enter Option 4 to Print or display list of data set names
Tab to the Dsname Level input field and enter your ID

The Dsname Level field is for data set name pattern matching
Returned is all data set names matching a data set name pattern beginning with your ID
Enter return to return to the ISPF Primary Option Menu
From the ISPF Primary Option Menu, 3.4 would jump directly to the ISPF data set list utility panel

A very useful alternative is to enter dslist 'z#####' jumping directly to the data set list utility panel displaying all data set names beginning with your ID.

Tutorial about dslist command:


Challenge:

The challenge objective is familiarity with the ISPF data set list utility function
  • The data set list utility function has a command line and a command column
  • Many actions are available using the command line and the command column
  • The rich set of actions and their purpose only become obvious to a z/OS system technician with responsibilities to manage a large enterprise IBM Z mainframe infrastructure
  • If you land a job as a z/OS system technician, you will learn about the rich set of actions and their purpose from senior z/OS system technicians

Use ISPF to copy a member of a partitioned data set to a different partitioned data set
  1. Use dslist ISPF command to list data set names beginning with your ID
  2. Tab to the left of partitioned data set name ending with PDS.DATA
  3. Enter co / in the command column to the to the left of partitioned data set name ending with PDS.DATA
    co is to copy
      slash / tells the system to use the data set name on the line
A list of members in the partitioned data set are displayed

Tab to the left of member name FUN and enter s to select the member to be copied
  1. The Copy Entry Panel is displayed
  2. Tab to Name input field and type p2.output
  3. Tab to the New member name input field, type #03, then enter to process the copy
******************************************************************
*** A slash / is a required selection option for Replace like-named members
******************************************************************

Validate successful completion of challenge 3
Enter dslist 'z#####.p2.output' - Remember to substitute your personal ID for z######

  1. Data Sets Matching your ID with suffix of p2.output is displayed
  2. Tab to command line and enter b to browse the partitioned data set
  1. Partitioned data set member names are displayed
  2. Tab to member name #03 and enter s to select the partitioned data set member to be browsed
      If you see member name FUN instead of member name #03, then delete d member name FUN
      and attempt the copy again remembering to include #03 as the member name during the copy operation
  3. Welcome! You are on your way to completing Part 2 of the contest
  4. If you see - Do you know the Efti Wall word below? - in member name #03,
    then you successfully completed challenge 3

Congratulations! You are done with challenge #03 and you are ready for the next challenge.

Next: Challenge #04


ISPF Editor
Part Two - Challenge #04

Background:

ISPF Editor is feature/function rich

This challenge will continue to explore ISPF functionality and navigation techniques.

Familiarity with ISPF Editor is required to complete challenge #04 and many of the future challenges

While in ISPF Edit session, enter help or press function key 1, F1, to display online ISPF Editor tutorial help.

Highly recommended -
The contest instruction web site has an ISPF Editor Command Summary under the References drop down.
ISPF Editor Command Summary

Professionals continue to learn ISPF editor tricks and techniques for many years after their first exposure to ISPF editor.

For a few quick hints with getting around in ISPF, check out this video Ray Mullins made just for you:

Become proficient with ISPF editor with repeated use and exploration.


Useful information about ISPF that will help you complete challenge 4 and future challenges

As a reminder, there is a short video available to explain ISPF Editor.

Click on the following URL, then select Lecture 7 video which is less than 8 minutes.
z/OS Introduction

Note: If "Start Chat"appears, decline.
Chat is for clients considering purchase of more IBM Z technology features.


Challenge:


Use ISPF editor to change text image
From ISPF Primary Option Menu enter dslist seq.data to jump to data set list utility panel

Tab to the left of your SEQ.DATA data set name and enter e to the left of the data set name to edit the sequential data set.

An EDIT Entry Panel may appear - enter to proceed

Observe the upper left EDIT indicating edit mode.
Enter pfshow off on the ISPF editor in the Command input field.
pfshow off removes the program function key legend at the bottom exposing more text lines.

Enter reset on the ISPF editor in the Command input field.
reset removes the ==MSG> lines providing more room for text on the display

Observe line 7 below
  • Line 7 is a series of ISPF editor change c commands.
    Semi-colon ; is used as a command separator to execute 3 changes commands.
    --- It would have been possible to enter 1 change command at a time.
  • Line 7 change commands were used to obfuscate the text image.
  • You will use the reverse to show the original text image.

Enter the following ISPF primary commands:
  • c x'00' '(o)(o)' all;c x'01' | all
  • c x'02' / all; c x'03' \ all
Remember - copy and paste is available to avoid typing mistakes

Explanation of the 3 ISPF editor primary commands follows:
  • c x'00' '(o)(o)' all
      change c hexadecimal value 00 x'00' to text string (o)(o) all occurrences
      x'00' is an unprintable character, therefore unseen by you.
  • c x'01' | all
      change c hexadecimal value 01 x'01' to text string | all occurrences
      x'01' is an unprintable character, therefore unseen by you.
  • c x'02' / all
      change c hexadecimal value 02 x'02' to text string / all occurrences
      x'02' is an unprintable character, therefore unseen by you.
  • c x'03' \ all
      change c hexadecimal value 03 x'03' to text string \ all occurrences
      x'03' is an unprintable character, therefore unseen by you.


The result of the 3 ISPF primary change all commands is the original text image.

  1. Tab to line 000002 and overtype 000002 with dd (do not enter yet).
  2. Tab to line 000009 and overtype 000009 with dd (now enter).
  3. You are using ISPF editor line command area to delete a block of lines.
    -- from the first dd to the following dd
    ---- a single d would delete a single line
    ---- so now you can see how ISPF line commands work

Observe the block of lines were deleted exposing more of text image

  1. Type (without enter) rep p2.output(#04) in the ISPF editor primary command input area.
  2. Tab to line 000001 and overtype 000001 with cc (do not enter yet).
  3. Tab to last line and overtype last line number with cc (now enter).
      You many need to F8 (to scoll forward)
      or enter ISPF editor primary command down for last line to be visible.
  4. You are using ISPF editor line command area to copy a block of lines
    -- from the first cc to the following cc
    ---- A single c would copy a single line

An EDIT - Confirm Replace panel may appear warning truncation will occur.
  Truncation is expected.
  Enter to proceed.

Enter end;return to save the changes and return to ISPF Primary Option Menu.

Enter dslist p2.output to jump to the Data Set List panel.

Tab to the left of your P2.OUTPUT data set name
and enter b to browse the partitioned data set.

Partitioned data set member names appear.
Tab to left of #04 member name.
Enter s to select #04 member name.

Visible is the text you previously created from your changed SEQ.DATA data set name.
Enter end;return to jump back to ISPF Primary Option Menu.

Review of what you learned about the ISPF editor (other than the Simpson family members):

What you learned in challenge 4 about the ISPF editor is important for completion of future challenges.

  • Line commands are typed over top of line numbers to the far left of the line text.
  • Primary commands are typed in the edit session Command ===> field.
  • Line commands can be executed against a single line or a block of lines.
  • A combination of line and primary commands can be typed into the edit session,
     then the line and primary commands are executed upon depressing enter.
  • While in ISPF edit session, F1 (function key 1) displays the ISPF editor help tutorial.
  • Remember you have access to an ISPF editor summary reference -
    ISPF Editor Command Summary

Congratulations! You are done with challenge #04 and you ready for the next challenge.

Next: Challenge #05
Job Control Language, JCL
Part Two - Challenge #05

As a System Programmer, you prepare the environments and infrastructure needed by developers, operators, security administrators, database administrators, and other IT functions to do their jobs. If there are new requirements or growing applications– perhaps your company is expanding into a new region or has a new product - you have to create and manage those systems.

You also have the ability to make the environment easier for developers to use so they don’t have to code everything into each program. For example, if the data records in the system are in a certain order (aka sorted) the developer’s application will run faster and the application developers will not need to write extra code in their programs.

This challenge will introduce you to the commands and language used to run pre-defined programs or jobs and perform tasks on the system.

Background:

For every job that you submit, you need to tell z/OS where to find the appropriate input, how to process that input, and what to do with the resulting output. You use job control language (JCL) to convey this information to z/OS through a set of statements known as job control statements.

While application programmers need some knowledge of JCL, the production control analyst or system programmers must be highly proficient with JCL, to create, monitor, correct and rerun the company's daily batch workload.

You will learn about the input/output relationship between program execution and JCL

Understanding JCL is required to be considered experienced with z/OS. Many employers are looking for JCL experience.

In previous challenges you submitted JCL for execution and viewed the output using SDSF.

In challenge #05 you will learn the basics of JCL.


Focusing on the purpose of JCL can make JCL easy to learn.
Purpose of JCL:
  • Identify what program to execute
  • Identify program inputs and outputs
Program Execution
  • A program has internally coded file names.
  • A program reads, writes, and updates those internally coded file names.
  • Program execution requires an internally coded file name to be redirected to a z/OS managed physical resource.
    ---------------------------------------------------------------
    The z/OS managed physical resources include:
      1) Data Set Names
      2) Unix File Names
      3) Any physical input/output device defined to z/OS
    ----------------------------------------------------------------
  • How is a program internal file name redirected to a z/OS managed resource?
    -- The best answer is JCL, Job Control Language
    -- Other answers could include TSO ALLOCATE command
      and a system supervisor call, (SVC 99), aka DYNALLOC
JCL Syntax
  • // starting in column 1
  • JCL is UPPERCASE
      Only exception is lowercase in quotes for unix file names, unix parameters, etc.
  • The 2 most important JCL operations are:
    EXEC
       - used to identify what program to execute
    DD
       - used to connect program file names with z/OS managed inputs and outputs

JCL DD, Data Definition, operation is used to redirect a program internally coded file name with a z/OS defined physical data source.

JCL below has JCL DD operations with ddnames spelled exactly as the internally coded file names within the executed sort program.

Program SORT is coded with internal file names to -
Open and read from:
    SORTIN
    SYSIN
Open and write to:
    SORTOUT
    SYSOUT

What is a JCL ddname?

  • A ddname is a label on the DD operation
      where DD is a JCL reserved word, Data Definition
  • A program requests access to inputs and outputs using file names
  • A program file name needs a ddname
      where the file name = ddname
  • DD parameters describe the input/output data source to be accessed by the program

What is a JCL step?

  • Each EXEC operation starts a new step
  • A step includes an EXEC operation followed by DD operations
  • A stepname is coded immediately after // on the EXEC operation
  • A subsequent EXEC operation 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
  • DISP=value - where value is data set name disposition,
    such as NEW, OLD, SHR, CATLG
  • PATH=value - where value is a unix file name - in quotes if mixed or lower case
  • PATHOPTS=, PATHMODE=, and PATHDISP= where values assign unix file name dispositions and attributes
  • SYSOUT=* - write to system managed output area known as the JES Spool
      where JES Spool is a special formatted area on disk,
      SDSF is used to view the JES Spool

----------------------------------------------------------------------------------------------
The program determines JCL the ddname.
----------------------------------------------------------------------------------------------
If a program file name does not have an associated JCL ddname, then the program execution will fail
with a message reporting no associated ddname was found for the program file name.


A short video lecture on JCL (Optional)

Less than 13 minutes -


Challenge:

What you are expected to understand for future challenges

Challenge 5 is the last challenge with step by step actions accompanied by screen shots on how to navigate ISPF, ISPF Editor, and SDSF.

Assumption is made in future challenges that you understand how to:

  • Use ISPF 3.4 panel or DSLIST command to list data set names
  • Use ISPF Editor to modify data set names and/or data set member names
        Remember ISPF Editor Command Summary in References drop down
        and pressing F1 for online ISPF Editor help tutorial
  • Use SDSF to locate and view your JCL job output

If you struggle with the increasingly abbreviated instructions related to
ISPF, ISPF Editor, and SDSF, then review previous challenges such as this challenge.


JCL in Action

While the challenge involves JCL execution of a program to process a small number of data records, millions of data records are processed in large enterprises using JCL.

Actions:

  1. From the ISPF command or ISPF option line enter tso submit 'zos.public.jcl(sortpgm)'
      See Figure #1 and Figure #2 below
  2. From the ISPF command or option line enter =sd;st to jump to the SDSF status panel.
      See Figure #3 below
      Enter prefix ; owner z##### to see status of all jobs your id owns.
  3. You should find job SORTPGM output.
      See Figure #4 below
  4. Tab to left of SORTPGM JCL job output.
      See Figure #4 below
  5. Enter ? question mark to left of SORTPGM to see DDNAME sections of the JCL job output.
      See Figure #4 below
    *NOTE: JESMSGLG, JESJCL, and JESYSMSG are system generated DDNAMEs
       as a result of JCL execution.
    SORTOUT, and SYSOUT DDNAMEs are written as a result of SORTPGM execution.
  6. Use tab key typing s to left of each DDNAME section to select the individual DDNAME sections to be viewed.
      See Figure #5
      The result of enter is a select of the first DDNAME to be viewed.
      Press F3 results in a select of the next DDNAME to be viewed.
      Continue pressing F3 to view each JCL JOB DDNAME output section.
  7. JESMSGLG is a dynamically allocated DDNAME section containing system messages for this job.
      See Figure #6
      Observe 00 in the Return Code RC column indicating success.
      Observe line with 6 CARDS READ which means 6 JCL statements were processed.
  8. JESJCL is a dynamically allocated DDNAME section containing all JCL statements and JES2 control statements.
      See Figure #7
      Observe each JCL statement is numbered.
      Observe SORTIN is redirected to data set name ZOS.MTM2019.PUBLIC.SHARED.DATA member name AIRCODES.
      Observe SORTIN DD parameter DISP=SHR.
        SHR means the data set name should exist and can be shared with other jobs.
      Observe SYSIN is redirected to data set name ZOS.MTM2019.PUBLIC.SHARED.DATA member name SORTCMD.
      Observe SYSIN DD parameter DISP=SHR.
        SHR means the data set name should exist and can be shared with other jobs.
      Observe SORTOUT is redirected to SYSOUT=*, the JES spool output area visible using SDSF.
      Observe SYSOUT is redirected to SYSOUT=*, the JES spool output area visible using SDSF.
  9. JESYSMSG is a dynamically allocated DDNAME section.
      See Figure #8
      JESYSMSG includes:
        Job's hardcopy log
        JES2 and operator messages about the job processing
        Allocation of devices and volumes
        Execution and termination of the job steps and the job
        Disposition of data sets
  10. SORTOUT is the where program SORT wrote the results of the sort operation.
      See Figure #9
      SORT operation included:
        Data to be sorted from //SORTIN DD DSN=ZOS.MTM2019.PUBLIC.SHARED.DATA(AIRCODES)
        Sort operational command from //SYSIN DD DSN=ZOS.MTM2019.PUBLIC.SHARED.DATA(SORTCMD)
  11. SYSOUT is where program SORT wrote messages about the sort operation.
      See Figure #10
      Observe SORT FIELDS=(1,3,AC,D)
        Above sort command was read from //SYSIN DD DSN=ZOS.MTM2019.PUBLIC.SHARED.DATA(SORTCMD)
        Sort fields beginning in column 1 for a length of 3 using ASCII character format (AC) in descending order (D).

Figure #1


Figure #2


Figure #3


Figure #4


Figure #5


Figure #6


Figure #7


Figure #8


Figure #9


Figure #10


Modify a sort command and submit JCL to execute a SORT program that reads your modified sort command
  1. Use ISPF dslist, the data set list command, to list your pds.data partitioned data set.
      See Figure #11
  2. Tab to the left of your pds.data partitioned data set and enter e to edit.
      See Figure #12
  3. Enter s sortcity to select partitioned data set member name sortcity
      See Figure #13
  4. Member sortcity is empty because it is a new member.
      See Figure #14
      Enter copy 'zos.mtm2019.public.shared.data(sortcity)' to copy data into the new member
  5. Member sortcity now includes a sort control statement.
      See Figure #15
      Enter reset to suppress the ==MSG> lines.
    Description of SORT FIELDS=values:
    SORT FIELDS=(starting position, length, data format, A/D)
      where A/D is Ascending or Descending order
    Change starting position to 30, length to 9, and sort order to Descending.
      No screen available showing the change
    Press F3 to save, end, and exit ISPF edit mode
  6. Use ISPF dslist, the data set list command, to list your jcl partitioned data set.
      See Figure #16
  7. Tab to the left of your jcl partitioned data set name and enter e to edit.
      See Figure #17
  8. Enter s sortcity to select partitioned data set member name sortcity
      See Figure #18
  9. Member sortcity is empty because it is a new member.
      See Figure #19
      Enter copy 'zos.public.jcl(sortcity)' to copy JCL into the new member
  10. Member sortcity now includes JCL
      See Figure #20
    JCL Description:
        Line 1 is a JCL JOB operation has SORTCITY as a given name
        Line 2 is a JCL EXEC operation to execute program SORT
        Line 3 is a JCL DD operation to read data from SORTIN
          where member name is CITIES and partitioned data set name is ZOS.MTM2019.PUBLIC.SHARED.DATA
        Line 4 is a JCL DD operation to read sort control command from SYSIN
          where member name is SORTCITY and partitioned data set name is your ID PDS.DATA
          You previously changed the sort control command in the SYSIN
          &SYSUID. will be replaced with your ID
          Member name SORTCITY in your PDS.DATA partitioned data set has your change
        Line 5 is a JCL DD operation to write sorted data to SORTOUT
          where SYSOUT=* means the output will be in the JES spool
        Line 6 is a JCL DD operation to write program sort messages to SYSOUT
          where SYSOUT=* means the output will be in the JES spool
      Enter submit ; =sd ; st
        JCL job is submitted to the system for processing
        Jump to SDSF
        Status jobs using SDSF
  11. A message reading JOB SORTCITY(JOB#####) SUBMITTED
      See Figure #21
  12. Review SORTCITY JOB output
      See Figure #22
      Tab to left of SORTCITY, enter ?
  13. Review each DDNAME section of SORTCITY output
      See Figure #23
      Tab to left of each DDNAME section, type s to select each section, then enter
  14. JESMSGLG is first DDNAME section
      See Figure #24
      Observe return code RC is 00 indicating successful completion.
      Press F3 to leave JESMSGLG
  15. JESJCL is second DDNAME section
      See Figure #25
      Observe the substitution for &SYSUID..
      Press F3 to leave JESJCL
  16. JESYSMSG is third DDNAME section
      See Figure #26
      Observe the system allocated data set names.
      Press F3 to leave JESYSMSG
  17. SYSOUT is forth DDNAME section
      See Figure #27
      Observe program sort messages.
      The output shows the SORT FIELDS= values you should have coded.
      Press F3 to return to SDSF status panel
  18. Use ISPF dslist, the data set list command, to list your P2.OUTPUT partitioned data set.
      See Figure #28
  19. Tab to the left of your P2.OUTPUT partitioned data set and enter b to browse.
      See Figure #29
  20. Tab to the left of member name #05 and enter s to select the member to be browsed.
      See Figure #30
  21. The data sorted is displayed.
      See Figure #31
      Enter cols to display columns
  22. The data sorted is displayed with column header visible
      See Figure #32
      Observe column 30 for a length of 9.
      The data was sorted in descending order displaying the largest city by population in the world.
      If the data appears as shown, you successfully complete challenge 5.

Figure #11

Figure #12

Figure #13

Figure #14

Figure #15

Figure #16

Figure #17

Figure #18

Figure #19

Figure #20

Figure #21

Figure #22

Figure #23

Figure #24

Figure #25

Figure #26

Figure #27

Figure #28

Figure #29

Figure #30

Figure #31

Figure #32


The challenge created member #05 in data set name P2.OUTPUT from SORT program output.

Before moving on to the next challenge, re-read "What you are expected to understand for future challenges".

Congratulations! You are done with challenge #05 and you ready for the next challenge.

Interesting fact...

To better understand JCL, understand why it exists. It’s all about the I/O – how fast can we make the input/output so we can process billions of records (think credit card transactions coming in from all over the world at the same time). To do that, the system needs to have the fastest independent input output devices. The DD statement makes this possible. It associates an internal program file name with a physical resource which allows I/O device independence. Programs do not have to be recompiled to go after different data sources and they retain stability. This is why some programs still running today have been around for 20+ years and still keep on going.


Next: Challenge #06

JCL: Identify and Correct a Syntax Error
Part Two - Challenge #06

In this challenge you are introduced to identifying and correcting JCL syntax errors.Let’s fix some JCL.

Background:

You will identify and correct a JCL error

JCL with errors do not execute. Therefore, JCL errors are harmless.

System messages report the syntax error for you to correct. Do not worry about being perfect with JCL. If a syntax error exists, the system helps identify error.


System Utilities

System utility programs are shipped with the operating system. Experienced z/OS technicians take time to learn about the system utility programs. Reason - why write a program to accomplish a task when a system utility program exists to accomplish the task.

A simple system utility, IEBGENER, is used in this challenge.

IEBGENER documentation explains the following:

  • IEBGENER utility is a copy program.
  • SYSPRINT ddname is required for program execution messages.
  • SYSUT1 ddname is input.
  • SYSUT2 ddname is output.
  • SYSIN ddname is required and used for more complex copy operations requiring control command input that IEBGENER understands.

Assumptions made in challenge 6 instructions

Assumption is made that you understand how to:

  • Use ISPF 3.4 panel or DSLIST command to list data set names
  • Use ISPF Editor to modify data set names and/or data set member names
        Remember ISPF Editor Command Summary in References drop down
        and F1 for online ISPF Editor help tutorial
  • Use SDSF to locate and view your JCL job output

If you struggle with the increasingly abbreviated instructions related to
ISPF, ISPF Editor, and SDSF, then review previous challenges such as this challenge.

Challenge 6 is without explicit screen shots demonstrating you know how to accomplish various tasks using briefly written instructions.


Challenge:

Create a new member in your JCL partitioned data set
  1. List and edit your JCL partitioned data set.
  2. Select s p2ch6 to create a new member named p2ch6
      which is initially an empty member in your JCL partitioned data set
  3. From ISPF editor primary command line enter copy 'zos.public.jcl(p2ch6)'

Review JCL syntax in member name P2CH6
Observe the following:
  1. EXEC PGM=IEBGENER
  2. SYSPRINT ddname output is redirected to JES spool using SYSOUT=*
  3. SYSIN ddname input is redirected to DUMMY meaning no control commands are given to the program.
  4. SYSUT1 ddname is the copy input where DD * means what follow is text data.
    *Note: SYMBOLS=CNVTSYS is a relatively new JCL feature enabling substitution of system known variables.
  5. SYSUT2 ddname is the copy output redirected to member name #06 in your P2.OUTPUT partitioned data set.

Submit JCL and review JCL job output to identify JCL syntax error
  1. From the ISPF editor primary command line, enter submit ; =sd ; st
  2. From the SDSF status panel, tab to the left of P2CH6 JCL job output owned by your id, and enter s to select the JCL job output
  3. Observe the following in P2CH6 JCL job output:
      Message P2CH6 - JOB NOT RUN - JCL ERROR
      Last line 3 IEFC662I INVALID LABEL
      Look up a few lines and find JCL line 3
      Big Hint - JCL DDNAMEs must be uppercase - you might have observed it earlier
The simple example is how to identify JCL syntax errors. The bottom of the output in the JESYSMSG will report the JCL line number where the system recognized a problem existed with brief explanation of the problem.

A quick word about those JCL errors, from Colton and Sara...


Fix the JCL syntax error, resubmit the corrected JCL, and review the output for success
  1. List and edit your JCL partitioned data set.
  2. Select s a new member name, P2CH6
  3. Correct the JCL syntax error using ISPF editor
  4. From the ISPF editor primary command line, enter submit ; =sd ; st
  5. From the SDSF status panel, tab to the left of P2CH6 JCL job output owned by your id, and enter s to select the JCL job output
  6. If P2CH6 JCL job output shows 00 under column RC, then a return code of 00 is success
  7. If P2CH6 JCL error persists, then you will need to identify and correct the JCL error to complete the challenge

Review successful completion
  1. List and browse b your P2.OUTPUT partitioned data set.
  2. Select s member name #06 to be browsed.
  3. Observe values were written into member #06 for system symbols &YYMMDD &HHMMSS &SYSNAME
If you are curious and want to see available system symbols that can be used in variety of ways, then from SDSF primary option menu, enter sym. Other uses of system symbol substitution are explored in future challenges.

You practiced what you learned in the previous challenge and demonstrated ability to use the classic z/OS interfaces to accomplish tasks with brief instructions. Congratulations!

Next: Challenge #07

Data Sets
Part Two - Challenge #07

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

Background:

The basics about z/OS Data Sets

About those Data Sets -

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

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


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

z/OS manages Data Sets differently.

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

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

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


Data Set Names and Rules

Data set naming rules are:

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

Valid data set names are:

  • X
  • PREFIX.TEST1
  • DEPT58.IDEAS.FUTURE.APPROVED.#4
  • A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.VW

Invalid data set names are:

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

Data Set Creation Attributes

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

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

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

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

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

Syntax involved in creating a data set includes:

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

Creating New z/OS Data Sets

Data Sets - Create / Copy / Delete

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

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

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

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

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

Challenge:

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

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

You will be submitting the JCL in Figure #1

Figure #1

Description of JCL in Figure #1

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

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

Take the following actions:

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

View attributes of newly created data set

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

Take the following actions:

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

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

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


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

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

Figure #2

Description of JCL in Figure #2

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

Take the following actions:

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

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

You will be submitting the JCL in Figure #3

Figure #3

Description of JCL in Figure #2

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

Take the following actions:

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

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

You are ready for the next challenge!

Next: Challenge #08

Just a Bit
Part Two - Challenge #08

This challenge will introduce you to data character encoding – a skill required to understand computer and network technology.

Background:


Learn about Bits, Nibbles, Bytes, Hexadecimal, EBCDIC, ASCII, and BCD

Classic school education involves arithmetic and script symbols for alphanumeric and special characters. Computer and network technology expertise requires additional knowledge of data character encoding.

If you are not familiar with Bits, Nibbles, Bytes, Hexadecimal, EBCDIC, ASCII, and BCD, then the section below is mandatory Use this as reference as you complete the challenge.

The digital world operates using electronic signals where a signal is either off (0) or on (1). A light switch is a good analogy. The light switch is either off or on.

Everything builds upon the word binary. Binary, 0 or 1, is the lowest level of our digital world. Computer instructions, alphanumeric and special characters are binary at the lowest level.


A bit is a binary state, either state 0 (off) or 1 (on).

Computer processing and network transmission involves probably more bits than grains of sand. Everything in computer processing and network transmission is a massive stream of bits. When you type a character, a small stream of bits is generated to represent the character. System commands and programming language verbs are a stream of bits.

No one codes a stream of bits (0's and 1's) when typing characters nor codes of stream bits when programming. So, how are the stream of bits organized to form characters, commands, etc.?

The answer starts with hexadecimal.

Hexadecimal is a more human friendly method to represent a defined string of bits. Hexadecimal requires a thinking adjustment because our mind muscle is trained in decimal.

The word 'deci' means 10, therefore there are ten numbers (digits) in the decimal number system. The valid numbers in a base 10 number system are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

Hexadecimal has 16 positions (0-9 and A-F representing positions 10-15).

To further complicate matters, 2 different character encoding standards evolved at roughly the same time. Each character encoding standard assigned a different hexadecimal value to alphabetic characters, numbers, and special characters. Those 2 character encoding standards are:

  1. EBCDIC, Extended Binary Coded Decimal Interchange Code
  2. ASCII, American Standard Code for Information Interchange

The good news is EBCDIC and ASCII have hexadecimal in common.

Two separate character encoding standards were developed in the early 1960's, EBCDIC and ASCII.

EBCDIC, Extended Binary Coded Decimal Interchange Code, was devised in 1963 and 1964 by IBM and was announced with the release of the IBM System/360 line of mainframe computers. It is an eight-bit character encoding. The IBM System/360 is the foundation and original DNA for today's IBM Z.

ASCII, American Standard Code for Information Interchange, was developed from telegraph code. Its first commercial use was as a seven-bit teleprinter code promoted by Bell data services. ASCII codes represent text in computers, telecommunications equipment, and other devices.

Many of today's personal computers and smaller servers use ASCII as a character encoding standard.

IBM Z mainframes use EBCDIC as a default character encoding standard. However, IBM Z mainframes can store and process ASCII character encoding.

A third numeric only standard exists for binary encoding of decimal numbers, Binary Coded Decimal (BCD). BCD is used to store numbers with positive (+) and negative (-) values. Wikipedia explanation of Binary Coded Decimal


Terminology

  • Bit, a binary state either 0 or 1
  • Nibble, 4 Bits used to encode a hexadecimal digit (0 - F)
  • Byte, 8 Bits used to encode a single character
      A Byte is 2 Nibbles or 2 hexadecimal digits
      A Nibble is also known as a half Byte

Challenge 8 explores the binary world of Bits, Nibbles, Bytes, Hexadecimal, EBCDIC, ASCII, and BCD. If the binary world is new to you, show your persistence by completing challenge 8 and you will have the elementary fundamentals applied to the digital world forever.

References drop down includes a Character Encoding Summary with Hexadecimal format for each displayable EBCDIC and ASCII character. As a starting point, observe lowercase a in the table as EBCDIC x'81' and ASCII x'61'
Character Encoding Summary


Challenge:

Use ISPF editor to explore Hexadecimal, EBCDIC, ASCII, and BCD

EBCDIC Character Encoding

Use ISPF editor to explore Hexadecimal and EBCDIC

  1. Edit Z#####.PDS.DATA
      Remember to substitute your ID for Z#####
  2. Select s new member name EBCDIC
  3. Enter ISPF primary command copy 'zos.mtm2019.public.shared.data(ebcdic)'
      As previously mentioned, z/OS is EBCDIC by default
      Observe the numbers, lowercase alphabet, uppercase alphabet, and special characters
  4. Enter ISPF primary command hex on
      Hexadecimal values for each character are shown vertically in the two rows below the character.
      Enter ISPF primary command cols to display a columns line serving as a column ruler
    cols can be used on the command line or on a line number

      Observe line 000004, column 1 is 0 and the associated hexadecimal value is F0
       - x'F0' is short for hexadecimal value F0
      Press F3 to exit the ISPF edit session of member name EBCDIC

Observe Figure #0

The result of hex on and cols ISPF commands
is displayed. Line 00004 column 1 shows EBCDIC character 0 represented by x'F0'

Figure #0


ASCII Character Encoding

You should still be in Z#####.PDS.DATA partitioned data set. If not, then edit Z######.PDS.DATA.

  1. Select s new member name ASCII
  2. Enter ISPF primary command copy 'zos.mtm2019.public.shared.data(ascii)'

Observe Figure #1

As previously mentioned, z/OS can store, read, and update ASCII while EBCDIC is the default

  • Some lines you can read because it is EBCDIC, the z/OS default encoding format.
  • Some lines have unreadable text because it is ASCII
  • Enter primary command hex on to display hexadecimal representation of each text character
  • Enter primary commands reset to suppress the ==MSG> lines

Figure #1


Observe Figure #2

The result of hex on displays the hexadecimal value for both ASCII and EBCDIC characters

  • Line 1 consists of ASCII alphabet characters
  • Line 3 consists of EBCDIC alphabet characters and number characters
  • Line 4 consists of ASCII number characters which unreadable
  • Enter ISPF primary command source ascii to change display output from EBCDIC to ASCII

Figure #2


Observe Figure #3

The result of source ascii is ASCII characters are readable and EBCDIC characters are unreadable

EBCDIC and ASCII use a common hexadecimal character encoding

  • Line 1 consists of ASCII alphabet characters now readable
  • Line 3 consists of EBCDIC alphabet characters and number characters now unreadable
  • Line 4 consists of ASCII number characters now readable

Figure #3


Observe Figure #4

Enter ISPF line command cols on line 4 as seen in Figure #4

Figure #4


Observe Figure #5

ASCII alphabet and numbers are readable as a result of command 'source ascii'.

Line 4 has ASCII 0-9 starting in column 1.

Line 4 columns 20-29 are x'20' values. x'20' is an ASCII space.

Overtype hexadecimal x'20' values to x'F0' to x'F9' on line 4, columns 20-29, as shown.

x'F0' to x'F9' are the hexadecimal values for EBCDIC 0 - 9.

Figure #5

Depending upon the emulator, the above Figure #5 might display a few strange fonts in column 20 - 29. Just ignore it.


Observe Figure #6

The result of entering x'F0' to x'F9' on line 4, columns 20-29 are unreadable.

Enter ISPF editor primary command reset

Figure #6


Observe Figure #7

The result of ISPF primary command reset is a return to EBCDIC character encoding.

Line 4, columns 1-10 are unreadable with unprintable hexadecimal values.

Line 4, columns 20-29 now read EBCDIC 0-9

Saving the changes is unnecessary, enter ISPF primary command cancel

Figure #7


BCD and Packed Decimal Character Encoding
  1. Edit Z#####.PDS.DATA
      Remember to substitute your ID for Z#####
  2. Select s new member name packed
  3. Enter ISPF primary command copy 'zos.mtm2019.public.shared.data(packed)'

Observe Figure #8

  • Overtype line 5 with cols
  • Overtype line 6 with hx
  • Overtype line 9 with hx
  • Overtype line 12 with hx

Figure #8


Packed Decimal, a form of BCD, is neither EBCDIC or ASCII.

Remember the 'nibble' word? Packed Decimal uses nibbles.

Observe Figure #9

A column ruler is now above line 5

Line 5 is a heading with positive (+) and negative (-) symbols

Line 6 has hexadecimal values under the + and - symbols

  • Column 1 has x'0A' which is 2 nibbles, x'0' and x'A'
      where x'A' is used to denote a packed decimal field as a positive number
  • Column 4 has x'0B' which is 2 nibbles, x'0' and x'B'
      where x'B' is used to denote a packed decimal field as a negative number
  • Column 7 has x'0C' which is 2 nibbles, x'0' and x'C'
      where x'C' is used to denote a packed decimal field as a positive number
  • Column 10 has x'0D' which is 2 nibbles, x'0' and x'D'
      where x'D' is used to denote a packed decimal field as a negative number
  • Column 13 has x'0E' which is 2 nibbles, x'0' and x'E'
      where x'E' is used to denote a packed decimal field as a positive number
  • Column 16 has x'0F' which is 2 nibbles, x'0' and x'F'
      where x'F' is used to denote a packed decimal field as a positive number

Line 9, columns 1-3, is a packed decimal number, x'04096A', a total of 6 nibbles

  1. 1st nibble is 0
  2. 2nd nibble is 4
  3. 3rd nibble is 0
  4. 4th nibble is 9
  5. 5th nibble is 6
  6. 6th nibble is A
      where x'A' nibble means positive +4096  

Another packed decimal format example in Figure #9 -

Line 12, columns 1 and 2, is a packed decimal number, x'256B', a total of 4 nibbles

  1. 1st nibble is 2
  2. 2nd nibble is 5
  3. 3rd nibble is 6
  4. 4th nibble is B
      where x'B' nibble means negative -256

Enter ISPF primary command save. Member packed is read in the next challenge.

Enter ISPF primary commands cancel ; s #08

The result is cancel current ISPF edit session and select a new member (#08) for a new ISPF edit session.

Figure #9

Now you aware of the packed decimal format. Many large financial enterprise store financial numbers in packed decimal to help improve speed of calculations.

The new empty #08 partitioned data set member will be used to complete the challenge by demonstrating your understanding of Hexadecimal, EBCDIC, ASCII, and Packed Decimal.


Complete the Challenge

Observe Figure #10

Do the following actions in order:

  1. Do not press enter key until explicitly reading 'now press enter key'
  2. Tab to first empty line and type 0123456789
  3. Tab to second empty line and type uppercase A
  4. Tab to third empty line and type lowercase z
  5. Tab to forth empty line and type number 4096
  6. Now press enter key
  7. Enter ISPF primary commands cols ; hex on

Figure #10


Observe Figure #11

The result of the previous actions are displayed in Figure #11

Change member #08 as follows:

  1. Change line 2 column 1 from EBCDIC uppercase A to ASCII uppercase A
  2. Change line 3 column 1 from EBCDIC lowercase z to ASCII lowercase z
  3. Change line 4 columns 1-4 from EBCDIC 4096 to Packed Decimal 4096
      Line 4 - Packed Decimal 4096 will leave column 3 unused
      Line 4 - Change column 3 to x'40', an EBCDIC space

There are a couple of ways to accomplish the changes.

If you need to start over, you can delete the lines and start over

Figure #11


Observe Figure #12

Once you feel that you successfully completed the changes,
  type ISPF edit primary command rep p2.output(#08)
  tab to line 1 and overtype line number 000001 with c99
enter to replace z#####.p2.output(#08) with all lines from z#####.pds.data(#08)

Figure #12


Congratulations! You are done with challenge #08 and you ready for the next challenge.

Now that you know about EBCDIC, with a bit more info you could read Adi's t-shirt
(pictured at recent SHARE.org eventalong with a few other mainframers)

Next: Challenge #09

Data Sets, Unix Files, and Character Encoding
Part Two - Challenge #09

Background:

You will learn about the flexibility of z/OS applied to MVS Data Sets, Unix Files, EBCDIC, and ASCII

z/OS grandfather operating system was MVS. MVS included a variety of record oriented Data Set organizations.

Data Sets are written, read, and updated by MVS.

Unix is a base component of z/OS. Unix stores streams of bytes in Files in Unix Filesystems.

Files are written, read, and updated by Unix.

z/OS is a powerful combination of MVS and Unix which includes MVS Data Sets and Unix Files. z/OS software and business applications can use MVS Data Sets and Unix Files simulaneously or interchangebly.

The previous challenge exposed you to binary, hexadecimal, and character encoding standards, such as EBCDIC and ASCII.

Challenge 9 exposes you to the flexibility of z/OS applied to MVS Data Sets, Unix Files, and character encoding standards.


z/OS Disk Storage Allocation for MVS Data Sets and Unix Files
  • z/OS disk storage space is allocated in 'extents'
      Extent is a contiguous area on disk
      z/OS data sets have 1 primary extent
      When a primary extent is full, then a secondary extent is allocated
      The number of secondary extents depends upon the type of data set
      The size of a primary and secondary extents are determined by a SPACE attribute

    See References drop down Data Set Allocation and Disk Storage Summary

  • There are many different types of data sets in z/OS, and different methods for accessing them. Among the most commonly used types are:
    Sequential
      In a sequential data set, records are data items that are stored consecutively.
      To retrieve the tenth item in the data set, for example, the system must first
      pass the preceding nine items. Data items that must all be used in sequence,
      like the alphabetical list of names in a classroom roster, are best stored
      in a sequential data set.
    Partitioned
      A partitioned data set or PDS consists of a directory and members.
      The directory holds the address of each member and thus makes
      it possible for programs or the operating system to access each
      member directly. Each member, however, consists of sequentially
      stored records. Partitioned data sets are often called libraries.
      Programs are stored as members of partitioned data sets.
      Generally, the operating system loads the members of a PDS
      into storage sequentially, but it can access members directly
      when selecting a program for execution.
    VSAM
      In a Virtual Storage Access Method (VSAM) key sequenced data set (KSDS),
      records are data items that are stored with control information (keys)
      so that the system can retrieve an item without searching all preceding
      items in the data set. VSAM KSDS data sets are ideal for data items
      that are used frequently and in an unpredictable order.
    VSAM Linear Data Set
      Linear dataset is the only form of byte-stream dataset
      Can be formatted for Unix Filesystems
      Can be formatted for Db2 Tablespaces and Indexspaces

Challenge:

Use TSO Unix interface, OMVS, to edit Unix file and copy in data from an MVS data set
  1. Enter TSO OMVS to launch a Unix shell prompt
  2. Enter oedit ascii to edit a new Unix file
  3. Enter edit primary command copy 'zos.mtm2019.public.iso8859'
      Result is a copy MVS sequential data set records into Unix file
      Enter edit primary command hex on to display the hexadecimal values of the copied ASCII text
  4. Press F3 or save;end to exit edit session and return to shell prompt
  5. Enter exit, then enter again to exit from Unix shell prompt

Examine Unix File stream of bytes behavior
  1. From the Unix shell prompt, TSO OMVS, enter ls -TH ascii
      Unix ls command with -T flag lists the ascii file tag information where:
      output includes untagged and T=off (no tag assigned)

      Unix ls command with -H flag lists file formats and text data delimiters where:
      output includes nl (newline character, ascii x'15') is used as the text data delimiter
  2. From Unix shell prompt, enter cat ascii
      Unix cat command is used to 'concatenate' or display text file
      Displayed output is unreadable because system default is to read EBCDIC, not ASCII
      Newline character (nl, x'15') embedded in the ascii text did result in 15 newlines when text was displayed
  3. From Unix shell prompt, enter iconv -t IBM-1047 -f ISO8859-1 ascii | more
      Unix iconv command converts characters from one code page set to another where:
    -t IBM-1047 specifies the 'to' output character encoding where IBM-1047 is EBCDIC
    -f ISO8859-1 specifies the 'from' input character encoding where ISO8859-1 is ASCII
    iconv to EBCDIC did not recognize newline (nl x'15') as a valid EBCDIC character

Optional but helpful: From Unix shell prompt, enter man ls or man cat or man iconv to read about details of those Unix commands within the z/OS environment. When presented with (Page #), entering q will quit display of the command output.


Change a Unix file character encoding tag

z/OS utilities provide options to manage tags on UNIX files.

The chtag command allows you to set, modify, remove, or display information in a file tag.

Research the z/OS Unix chtag command by entering z/OS Unix command man chtag or an internet search.

********
Change the ascii file tag to EBCDIC using the z/OS Unix chtag command.
********

Success is when Unix command ls -TH ascii displays T=on with assigned EBCDIC character encoding scheme.

Unix command chtag -r ascii removes any previously assigned character encoding tag.

When your ascii Unix file has the EBCDIC tag assigned:

  1. From Unix shell prompt, enter ls -TH ascii > taglist
  2. From Unix shell prompt, enter cp taglist "//p2.output(#09)"
      The following truncation message is expected and can be ignored
    cp: FSUM6260 write error on file "//p2.output(#09)":
      EDC5003I Truncation of a record occurred during an I/O operation.
Optional: You can browse member #09 in your P2.OUTPUT MVS partitioned data set to verify the text is what you expect.

You are now aware of z/OS flexibility related to MVS data sets, Unix files, and character encoding.
You know more about z/OS than the average person.
Congratulations!

Next: Challenge #10

Manage Unix Processing with JCL
Part Two - Challenge #10

Background:

z/OS is a powerful blend of technology

The Unix operating system started as an internal project at Bell Labs, and has gone on to be the basis of Linux, Android, MacOS, and countless other computing platforms. It is in fact so prevalent in the world of IT that many users wished they could somehow combine the two so they didn’t have to have two sets of computers to work on both platforms.

Unix System Services (USS) was developed on IBM Z so that users familiar with Unix could have access to a Unix-style interface without having to leave the mainframe. Today, USS is used not only by developers and systems programmers, but leveraged by the core z/OS operating system to provide functionality and scripting ability.

Unix is a critical component of z/OS. The Unix component enabled z/OS has taken the z/OS grandfather operating system MVS far beyond the original classic capabilities. MVS classic capabilities are still critical, trusted, and widely used. The tightly coupled Unix in the z/OS environment capabilities are not yet fully realized. The opportunities to modernize business applications and the development of business applications is just beginning. While much has been done, more will happen in the future.

The purpose of challenge 10 is a simple demonstration of mixing classic JCL with Unix shell processing.

A part of the challenge is the increasingly abbreviated instructions that demonstrated your increased skill level with z/OS.



Challenge:

Submit JCL used to execute Unix shell commands

You will be exposed to details about your personal Unix directory. The information you learn is necessary to complete the next step of the challenge.

  1. From ISPF command line, enter tso submit 'zos.public.jcl(unixsh)'
  2. From SDSF, view the JCL job output using ?
  3. Select s the output identified by DDNAME STDOUT and StepName SHELL
    STDOUT is where the Unix commands wrote the command output
  4. F3 or end to exit back to JCL JOB output
  5. Select s the output identified by DDNAME SYSPRINT and StepName LISTC
    SYSPRINT is output about the VSAM Linear data set formatted to filesystems including your personal filesystem
      The output does NOT play a part in challenge 10 but will play a part in a Part 3 challenge
  6. F3 or end to exit back to JCL JOB output
  7. F3 or end to exit back to SDSF Status panel
  8. Enter sj to the left of UNIXSH JCL job to see the JCL used to create the output
      What follows //STDPARM DD * is the Unix command input
      What follows //LISTC EXEC PGM=IDCAMS will be used in a Part 3 challenge
  9. While in SDSF EDIT of UNIXSH JCL -
      type ISPF primary command rep jcl(unixsh)
      tab until cursor is positioned on 000001 to enter an ISPF line command
      type ISPF line command c19 on line 0000001 to copy 19 lines, then enter
      truncation message is expected, enter to proceed

Modify JCL to execute Unix commands and write output to MVS Partitioned Data Set Member

If the previous challenge 10 action was completed successfully, then your JCL partitioned data set has member UNIXSH

  1. From ISPF command line, enter dslist jcl
  2. Edit e your JCL partitioned data set
  3. Select s member name UNIXSH

You previously executed UNIXSH JCL.

Description of the UNIXSH JCL

  • BPXBATCH is a system supplied utility program to interact with z/OS Unix services
  • BPXBATCH writes to STDOUT and STDERR
  • BPXBATCH reads from STDPARM
  • Observe all the Unix commands following //STDPARM DD * are terminated with a semi-colon (;)
  • Observe sh is the first STDPARM input providing a shell for the Unix commands that follow
  • Observe //STDOUT DD is writing output to the JES spool, SYSOUT=*

Modify and submit the JCL member UNIXSH as follows to complete the challenge:

  • Modify //STDOUT DD statement to write Unix command output to
    DSN=&SYSUID..P2.OUTPUT(#10),DISP=SHR,DCB=LRECL=80
  • Modify //STDPARM DD * input to process only 3 Unix commands
      1) sh uname -mrsvI ;
      2) rm -r * ;
      3) ls -al ;
  • Enter sub ; dslist p2.output to submit JCL and list your p2.output partitioned data set
  • Your p2.output member #10 should contain Unix command output

If successful, then p2.output(#10) will contain output from the Unix uname and ls commands

If p2.output(#10) is without output from the Unix uname and ls commands, then review JCL job output and make necessary corrections


You are ready for the next challenge!

Next: Challenge #11

VSAM Data Sets
Part Two - Challenge #11

Background:

VSAM is one of several access methods in z/OS

You have used several z/OS data storage methods

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

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

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

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

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

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

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


Challenge:

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

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

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


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

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

Next: Challenge #12

Edit VSAM using File Manager
Part Two - Challenge #12

Background:

Write, Read, and Update VSAM

IBM File Manager extends the standard browse, edit, copy, batch and print utilities of Interactive System Productivity Facility (ISPF) to help developers work with VSAM structured data.

It is possible for z/OS system programmers to customize ISPF environment to programmatically identify VSAM organization when the classic ISPF edit, view, or browse commands are used, then launch IBM File Manager services to write, read, and update VSAM.


File Manager

The contest system ISPF Primary Option Panel includes F option
to select interactive File Manager.

Option F.2 will jump directly to File Manager Edit Entry Panel.
Tab to Data set/path name input field and enter a VSAM data set name to edit.

File Manager Editor uses ISPF Editor primary commands and line commands.


Challenge:

Use File Manager to Identify and Modify Packed Decimal in a VSAM data set

A VSAM ESDS data set created in the previous challenge includes 2 packed decimal numbers.

Each number is displayed on the text line immediately above the packed decimal number with the sign, positive or negative.

The first packed decimal number is positive 4096.
The second packed decimal number is negative 256.
The challenge is to change the packed decimal numbers as instructed.

If assistance is needed understanding the packed decimal format, review Table 2. and Table 3. in References drop down Character Encoding Summary

  1. Edit your VSAM.ESDS data set using File Manager
  2. Change the File Manager Editor Format setting from CHAR to HEX (upper right)
  3. F8 or enter down to page down to display records below in VSAM.ESDS
  4. F7 or enter up to page up to display record above in VSAM.ESDS
  5. Enter line command cols on line number 9 to display a columns ruler
    immediately above the packed decimal numbers on line number 9
  6. Enter line command cols on line number 12 to display a columns ruler
    immediately above the packed decimal numbers on line number 12
  7. Packed decimal numbers are represented by hexadecimal nibbles
      where each nibble can be changed by overtyping existing value with new value
  8. Change packed decimal positive 4096 to positive 2048
  9. Change packed decimal negative 256 to negative 128
  10. After changing packed decimal numbers, then
      enter top to position first line at the top of the display
      type ISPF primary command rep p2.output(#12)
      enter ISPF line command c12 on line number 1

Your p2.output member name #12 should now contain 12 records
with packed decimal numbers positive 2048 on line 9 and negative 128 on line 12


Successful completion includes member name #12 in P2.OUTPUT with packed decimal 2048+ on line 9 and 128- on line 12

You can now say you are familiar with numbers stored in packed decimal format.

Next: Challenge #13

z/OS System Utilities & JCL Syntax Error Correction
Part Two - Challenge #13

Background:

Challenge description

z/OS includes many system utility programs. The challenge exposes you to a few of the system utility programs. These system utility programs can be executed interactively or more commonly executed in batch. "Batch" implies submitting JCL to execute the system utility programs in the background.

The challenge involves using JCL to execute various system utility programs to

  1. Allocate an MVS sequential data set
  2. Allocate an MVS partitioned data set
  3. Allocate an MVS partitioned data set extended
  4. Define an MVS VSAM KSDS data set
  5. Allocate a Unix File
  6. Write a record into the MVS sequential data set
  7. Write the record from the MVS sequential data set to an MVS partitioned data set member
  8. Write the record from the MVS sequential data set to an MVS partitioned data set extended member
  9. Write the record from the MVS sequential data set to an MVS VSAM KSDS
  10. Write the record from the MVS sequential data set to a Unix file
  11. List your data sets
  12. Upon success, delete all newly allocated MVS data sets and the Unix file

You will be challenged to identify and correct a number of JCL syntax problems and system utility program commands for all JCL job execution steps to complete successfully.


List of the system utility programs used in the challenge
  • IDCAMS
      Used to define, alter, and delete VSAM data sets
      Used to repro (copy) data records into VSAM data sets from other data sources
      Used to repro (copy) data records from VSAM data sets into other data sources
      Used to delete and alter/rename MVS sequential and partitioned data sets
  • IEFBR14
      A dummy program but useful for JCL DD operations such as allocating new data sets
  • IEBGENER
      Used to copy sequential data set records
  • IEBCOPY
      Used to copy partitioned data set member records
  • IKJEFT01
      Used to execute TSO environment in background
  • BPXBATCH
      Used to execute Unix environment in background

Challenge:

Submit JCL, Review Output, and Correct Syntax Errors
  1. Enter tso submit 'zos.public.jcl(ch13)'
      You will need to enter a unique job character suffix for the generated JCL JOB statement
  2. Review the JCL job output to identify initial JCL syntax errors
  3. Enter dslist jcl
  4. Edit your jcl partitioned data set
  5. Select new member name ch13, s ch13
  6. copy 'zos.public.jcl(ch13)'
  7. Correct the identified syntax errors
  8. Submit and review output, sub ; =sd ; st
  9. After correcting the initial JCL syntax errors, more errors appear requiring identification and correction

The challenge will take more time than previous challenges. The JCL stream has several problems where some problems only surface after correcting previous problems.

**Review twisties below for "Description of JCL" and "Problem Identification Assistance".


Description of JCL JOB CH13
  1. DELETE step executes program IDCAMS
      Delete previously created data sets preparing to create new data sets
  2. DEFINE step executes program IDCAMS
      Define a VSAM KSDS
  3. ALLOCATE step executes program IEFBR14
      Creates 3 MVS data sets, sequential, partitioned, and partitioned extended
  4. C1 step executes program IEBGENER
      Copy single record to the newly created sequential data set
  5. C2 step executes program IEBGENER
      Copy record from sequential data set to partitioned data set member
  6. C3 step executes program IEBGENER
      Copy record from sequential data set to a Unix file
  7. C4 step executes program IEBCOPY
      Copy member from a partitioned data set member to a partitioned data set extended
  8. C5 step executes program IDCAMS
      Copy record from sequential data set to a VSAM KSDS
  9. LISTC step executes program IKJEFT01
      List all data set names beginning with your ID
      LISTC step will only execute IF all previous steps receive RC of 00
  10. D1 step executes program IDCAMS
      Delete previously created data sets preparing to create new data sets
  11. D2 step executes program BPXBATCH
      Remove unwanted Unix files from your Unix subdirectory

Problem Identification Assistance

The first time submitting ch13 JCL, the job output reports JCL errors on STMT NO. 12 and 24. Statement 12 errors are associated with the EXEC statement. Statement 24 errors are associated with the DD statement. The JESJCL section of the output shows the JES read JCL statements numbers referenced by the JCL error messages. Use ISPF primary command, hilite jcl, for additional assistance.

Submitting ch13 JCL after successfully correcting the first set of JCL syntax errors, the job output reports JCL errors on STMT NO. 9, 10, 11, and 19. Internet search for zos dsorg for assistance on replacing @@ with correct values for the sequential data set and the partitioned data sets. Statement 19 error is a misspelled JCL reserved value. Internet search for zos disp for assistance.

Submitting ch13 JCL after successfully correcting the second set of JCL syntax errors, the job output does not report specific JCL syntax error associated with a specific JCL statement number. Review of the output includes STEPNAME C3 with an RC of FLUSH. Near the bottom of the JESYSMSG DDNAME, the problem can be identified. JCL job needs to update your FILENAME directory. What is the FILENAME directory in the JESYSMSG?

Submitting ch13 JCL after successfully correcting the third set of JCL syntax errors, again the job output does not report specific JCL syntax error associated with a specific JCL statement number. Review of the output immediately after execution of JCL step C3, includes +IEB157I PD@ DD STATEMENT NOT FOUND with JCL step C4 receiving RC of 8. Review of DDNAME SYSPRINT associated with StepName C4 is the best description to identify the exact problem. The utility copy command has an incorrect INDD value.

You're in the final stretch. Submitting ch13 JCL after successfully correcting the forth set of JCL syntax errors, again the job output does not report specific JCL syntax error associated with a specific JCL statement number. Review of the output reports execution of JCL step C5 receiving RC of 12. Review of DDNAME SYSPRINT associated with StepName C5 is the best description to identify the exact problem. The utility command is misspelled.


Successful completion includes member name #13 in P2.OUTPUT with list of your data sets prior to deleting the challenge 13 created data sets.

NEXT!

Next: Challenge #14

Db2 SQL
Part Two - Challenge #14

Background:

Learn Once, Apply Everywhere

A relational database is similar to a spreadsheet. However, a relational database can be concurrently read and updated by many users and the relational database has many capabilities unavailable to personal spreadsheets. A spreadsheet is a relatively low volume, low frequency personal data source where a relational database is a high volume, high frequency industrial strength data source.

A major benefit of learning to use any relational database system is you can apply the knowledge to all available relational databases systems.


What is a Relational Database


What are the Most Popular Relational Databases


Learn Generic SQL from w3schools SQL Tutorial


**Use w3schools SQL Tutorial Try it yourself >> to learn about SELECT SQL command and learn about SELECT with WHERE clause. You will be expected to code a SQL SELECT with WHERE clause to be executed on an IBM Db2 for z/OS relational database in the challenge.


Challenge:

Configure Db2 Interactive ISPF Panel

Panels are available on the contest system to interactively process SQL statements.

From the ISPF Primary Option Menu, enter D2 for the Db2 Interactive functions.

The panel is used to interact with Db2 subsystem

Below - observe SSID: value is blank. Enter d to change the 'Defaults'.

Below - the Db2 Name value needs to be DBCG. Type DBCG, then enter to proceed to next panel

Below - DEFAULTS PANEL 2 is displayed.
No change is necessary.

Enter to proceed

Below - observe SSID: value is now DBCG
Your DB2 Interface panels are now ready to access the contest DB2 subsystem Enter 1 to Process SQL Statements

A harmless WARNING panel might appear. Enter to proceed. The next twisty starts with the SPUFI display.


SQL Processor Using File Input, SPUFI

The SPUFI panel should be displayed as a result of the previous action.

Type pds.data(sql) in the input data set name area as shown below,
then tab to output data set name area and enter sql.out as shown below

Note: When YES is present for CHANGE DEFAULTS and EDIT INPUT,
then result will be interim defaults panel followed by edit session

Above action may result in a harmless WARNING panel.
Enter to proceed.

Above actions result in the interim CURRENT SPUFI DEFAULTS panel.
No change is required.
Enter to proceed.

Above actions result in an ISPF edit session.
Z#####.PDS.DATA(SQL) is initially empty.
Enter the SQL select statement as shown below.

Cut and paste text -
select * from ibmuser.dept;

F3 to save and exit from the ISPF edit session

Enter to execute the SQL statement saved in Z#####.PDS.DATA(SQL).

Above actions result in DB2 returning the result set from the select statement.

The asterisk following the select returns all rows and all columns from ibmuser.dept where ibmuser is owner of table name dept.

Observe the table column names in the output.
The column names can be used for selective SQL output.

F3 to exit and return

Navigate your way back to the SQL processing ISPF edit session using the same input data set and output data set.

Type -- in column 1 and 2 preceding the first select statement.
The result is the first select statement is now a comment statement.

Insert a new line and enter the select statement as displayed below.

For copy and paste convenience select * from ibmuser.dept where deptname = 'OPERATIONS';

F3 to save and exit the ISPF edit session, then enter to execute the new SQL select statement.

The above action results in the output below where all rows and all columns are returned
from ibmuser.dept where the deptname = 'OPERATIONS'

Navigate your way back to the SQL processing ISPF edit session using the same input data set and output data set.

Type -- in column 1 and 2 preceding the second select statement.
The result is the first and second select statements are now comment statements.

Insert a new line and enter the select statement as displayed below.

For copy and paste convenience select deptname from ibmuser.dept where admrdept = 'A00';

F3 to save and exit the ISPF edit session, then enter to execute the new SQL select statement.

The result is all rows with only column deptname is returned where the admrdept column is equal to A00.

You are now ready for the simple challenge.

What you learned in Challenge 14 is needed to complete the final Part 2 challenge.


Edit, modify, and execute a fourth SQL statement in Z#####.PDS.DATA(SQL)
  1. All previous statements in Z#####.PDS.DATA(SQL) need to be comment statements
  2. Same as previous interactive SQL executions, write the output to sql.out
  3. Insert a fourth statement to return the following:
    • select only the phonenumber column from table vphone owned by ibmuser where employeenumber is '200220'

Actions to complete the challenge

The SQL output is written to Z#####.SQL.OUT

  1. Edit Z#####.SQL.OUT
  2. Enter the following ISPF editor commands:
    • Type primary command rep p2.output(#14)
    • Overtype line 000001 with line command c99, then enter
      c99 is to copy the next 99 lines - you could enter c19 to copy the next 19 lines
      c99 will get all the lines because the number of lines is less than 99

A display will appear reporting the 'data set attributes are inconsistent. Truncation may result..'

The message is expected. Press enter to proceed.


Successful completion includes member name #14 in P2.OUTPUT with output from the requested Db2 select.

You learned about interactive execution of SQL statements returning a result set from Db2 for z/OS relational database tables.

NEXT! The final Part 2 Challenge

Next: Challenge #15

Number Hunt
Part Two - Challenge #15

Background:

Challenge requires the sum of 6 numbers. You must find the 6 numbers to sum.

Number Hunt has become a very popular challenge and enjoyed by many contestants. The Number Hunt requires applying many of the skills acquired in Part 2.

A correct number is required to complete the challenge.

The correct number is the sum of 6 numbers from 5 separate data sources.
The 5 data sources include:

  1. Sequential Data Set Name
  2. Partitioned Data Set Member Name
  3. VSAM KSDS
  4. Unix File Name
  5. DB2 Table

Each number may be in any of the following 3 formats:

  1. EBCDIC
  2. ASCII
  3. Packed Decimal

You are given a data source name, record number in the data source followed by the starting and ending column number in the record. You are not given the number character encoding. You know it is numeric. You need to determine the format by viewing the hexadecimal representation.

Sum all the numeric values. The sum is the answer for completing the challenge.


Summary Information About the Challenge

You are prepared to complete the challenge based upon what you learned in previous Part 2 challenges.

What you learned in previous Part 2 challenge:

  • Edit, View, or Browse sequential data set names
  • Edit, View, or Browse partitioned data set member names
  • Edit, View, or Browse VSAM data set
  • Edit, View, or Browse unix file names
      Use Data Set List Utility panel (3.4), then enter /z/z##### ....substituting your ID for z#####
      Enter 'e', 'v', or 'b' to the left of any file to edit, view, or browse the data
  • Use ISPF primary and line commands to
      - display column ruler
      - display hexadecimal values
      - move forward, backward, right, and left in data set
  • Interpret a packed decimal format
      - packed decimal number can be positive or negative
      - a negative packed decimal number requires a subtraction operation when summing the numbers
  • Use Db2 for z/OS SQL interactively to 'select' data from a DB2 table

Challenge:

Locate, identify, and sum 6 numbers from 5 unique z/OS data sources

Character Encoding Table is available to help complete the challenge.

Enter the command below from ISPF command line to create the challenge data sources.

tso submit 'zos.public.jcl(p2final)'

REMINDER: Substitute your ID for Z#####

Sum the 6 numbers found in the specified record and column positions from the following data sources:

  • Data Set Name Z#####.HUNT1
      #1 Record 10 Column 12 to 15
  • Data Set Name Z#####.HUNT2 - member name HUNT2
      #2 Record 3 Column 1 to 2
  • VSAM Data Set Name Z#####.HUNT3
      #3 Record 1 Column 13 to 15
  • Unix File Name /z/z#####/hunt4
      #4 Record 2 Column 18 to 21
      #5 Record 5 Column 1 to 2
  • DB2 Table IBMUSER.VPHONE
      #6 Column PHONENUMBER where EMPLOYEENUMBER = '200140'

Actions to complete challenge successfully

Take the following steps to record your answer for scoring:

  1. Edit Z#####.JCL member name P2DONE
  2. Modify 0000 value located on the last line to the sum of the 6 numbers
  3. Submit JCL with the modified value

Successful complete of P2DONE writes answer to P2.OUTPUT(#15) and deletes data sources


You demonstrated the ability to locate and convert specified data fields from a variety of data formats within a variety z/OS data sources in the final challenge of Part 2.

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

Next: Completing Part 2