Getting Started
Part Three - Challenge #01

Thinking about starting Part 3? Just Do It!

Part 3 is not a race. You have until December 31, 2019 to participate and complete

Many students decide to work on Part 3 as time permits.

Review of all Part 3 submissions are reviewed after close of the contest in December 31.

Part 3 results and badge awards are available in January 2020, following review of all Part 3 submissions.

Many student winners completed Part 3 during semester break during last 2 weeks in December.

Part 3 is your opportunity to learn using the guided challenge instructions or deviate and explore.

If you are an educator, many educators teaching computer technology subjects, permit extra credit for contest partipation and for levels of contest completion.


Part 3 assumes you know how to:

Part 1 and Part 2 participation provided you with the "know how to":

  • Edit MVS data sets and Unix files
  • Submit JCL
  • Review JCL job output in the JES spool using SDSF
  • Identify and correct simple JCL syntax errors

The Future of IBM Z

The IBM Z was built from the ground up to hande massive amounts of data where security and performance is paramount. A single IBM Z can host thousands of operating systems. While IBM Z can host other operating systems such as Linux, Part 3 will focus on the flagship operating system, z/OS.


z/OS manages a vast majority data for the world's most critical financial services, insurance, government, and retail applications. IBM Z modernization enables many new business opportunities associated with machine learning, predictive analytics, modern Application Program Interfaces (APIs) that communicate seemlessly with Internet of Things (IoT) such as mobile phones and the increasingly electronically instrumented society. z/OS has both time tested and trusted business applications and more recent modernization advancements.


.... place holder for September 2019 announcements...


5 "best practices" applied to large enterprise application program development, technical services, and support.

  1. Keep it simple
  2. Become familiar with system utilities
  3. Do not write a program when a system utility can accomplish the task
  4. Scripting languages are an excellent way to develop program process logic
  5. Compile programs into machine executables when performance is a high priority

Challenge:

How to get started

From ISPF panel

  • Enter tso sub 'zos.public.jcl(part3)'

JCL job 'zos.public.jcl(part3)' resulted in the following:

  1. Delete Z#####.SOURCE - if present
  2. Delete Z#####.REXX - if present
  3. Delete Z#####.P3.OUTPUT - if present
  4. Delete Z#####.LOAD - if present
  5. Create Z#####.SOURCE - an empty data set name
  6. Create Z#####.REXX - an empty data set name
  7. Create Z#####.P3.OUTPUT - an empty data set name
  8. Create Z#####.LOAD - an empty data set name

Substitute your ID for Z##### above

All part 3 challenges are designed to start over. If you want to start all of part 3 over, then
tso sub 'zos.public.jcl(part3)' which deletes all part 3 data sets and part 3 work previously completed.


Exposure to REXX, the z/OS all purpose scripting language
  1. Create a new member hello in Z#####.REXX --- remember to substitute Z##### with your ID
  2. There are a number of ways to do this, you can find some of them in Option 3 of ISPF.
  3. Copy in lines from 'zos.mtm2019.public.rexx(hello)'
  4. F3 or save;end to return to your REXX partitioned data set directory of members
  5. A single member exists, hello
  6. Enter ex to the left of member hello to execute the routine
      The result is 3 lines written to Z#####.P3.OUTPUT(#01)
    dslist p3.output, then view or browse member #01 to see the 3 lines

Execute modified REXX

The objective is to write userid, date, and time on a single line.

REXX comment lines begin with /* and end with */

  1. Edit Z#####.REXX --- remember to substitute Z##### with your ID
  2. Change lines 9, 10, and 11 to be comments
  3. Change lines 13, 14, 15, and 16 to execute - remove comment markers
  4. F3 or save;end to return to your REXX partitioned data set directory of members
  5. Enter ex to the left of member hello to execute the routine
      The result is a single line is written to Z#####.P3.OUTPUT(#01)
    dslist p3.output, then view or browse member #01 to see the single line

You broke the ice on Part 3 and you are ready for the next challenge

Next: Challenge #02

REXX Language Syntax
Part Three - Challenge #02

Background:

REXX is a program language swiss army knife for z/OS System Programmers and System Administrators

Many large enterprises using z/OS for critical applications will have many internal processes using REXX. Many one time tasks involving a lot of data are commonly accomplished using REXX.

While REXX can be executed interpretively, REXX can be compiled into native machine executable to achieve greater performance for high volume and high frequency requirements. Some application developers discovered REXX and write business applications in REXX.


Best way to become familiar with REXX syntax

Similar to all programming languages, the best way to become familiar with REXX programming language syntax is by using and modifying sample code. The internet and IBM web sites are loaded with REXX code examples. Internet search for 'learn rexx' or 'sample rexx code' will return excellent sources of information. Whenever trying or exploring specific REXX syntax new to you, internet search 'REXX example' the specific REXX syntax or 'how to do .... using REXX'.


REXX Slot Machine

A simulated slot machine written in REXX code is used to expose you to REXX syntax. Each enter changes three windows with a name of a fruit. If the same fruit is in all 3 windows, you win.

  1. You will observe the last window does not have a fruit but displays FRUIT.? which never changes. A problem exists in the REXX code. FRUIT.? is intended to be a variable in the REXX code which should change with each enter. However, FRUIT.? never changes. You will be instructed what to look for in the REXX code to correct the problem.
  2. After correcting the problem related to FRUIT.?, a win results in a problem acknowledging you won. Again, you will be instructed what to look for in the REXX code to correct the second problem.
  3. After correcting the second problem, a message is displayed WINNER !!! - $1,000,000. Your $1,000,000 is to be deposited in a safe. However, you must enter safe box 5 digit safe key number which you do not have. The 5 digit safe key is in the REXX code. To complete the challenge, you must enter the correct 5 digit safe key number.

Challenge:

Get the SLOTS REXX code
  1. dslist rexx
  2. edit rexx partitioned data set
  3. s slots - a new empty member
  4. copy 'zos.mtm2019.public.rexx(slots)'
  5. F3 or save;end
  6. Enter ex to the left of slots to execute the REXX code
    It may be necessary press PA1 function, or Esc key or Alt-Ins to terminate

REXX sources of syntax information

Modify SLOTS REXX code enabling FRUIT.? variable to contain a fruit value
  • Edit member SLOTS in your REXX partitioned data set
  • Line 20 start a do loop
  • Line 24, 26, and 28 sets a VIEW.# variable with a random fruit name value
  • Line 28 fails to follow the REXX code pattern
  • Line 28 requires a modification to correct the problem
  • Once REXX code is modified, execute ex the SLOTS code to validate the correction

Modify SLOTS REXX code to acknowledge a win
  • SLOTS execute displays an error on line 73
  • An additional message is displayed about line 73 with what was expected
  • The problem is a matter of a misspelled REXX action command
  • Edit member SLOTS in REXX
  • Line 73 requires a modification to correct the problem
  • Once REXX code is modified, execute ex the SLOTS code to validate the correction

Review SLOTS REXX code to determine the 5 digit safe deposit box key
  • Edit member SLOTS in REXX
  • Lines 63 thru 78 calculate the correct key
  • If you are able to discipher the REXX arithmetic operations, you have the correct key
  • If you really struggle with the REXX arithmetic operations to determine correct key, look at line 81
  • Execute ex the SLOTS code providing the correct 5 digit key to collect winnings
  • View p3.output member #02 for winnings deposited


By the way, if you're having trouble with the REXX arithmetic, we have Jeanne Glass from VirtualZ Computing with a hint.


You have some familiarity with REXX, a swiss army knife program language used by many z/OS System Programmers and System Administrators.

Next: Challenge #03

System Log, SYSLOG
Part Three - Challenge #03

Background:

What is in the z/OS System Log, SYSLOG?

The z/OS System Log, SYSLOG, is a chronological listing of messages from the operating system and applications using operating system services.

Informational, warning, and error messages are written to the SYSLOG. The SYSLOG is frequently the first place experienced technicians look when system problems or abnormal behavior is reported. Data center automation and real time visual dashboards rely upon information from the SYSLOG. An example would be to automate command input at various intervals to check on the status of various system resources where the command response updates a visual dashboard.

SYSLOG also includes:

  • System command input and command responses
  • Start and stop of Batch jobs
  • Start and stop of TSO sessions
  • Start and stop of Started Tasks
  • Security messages and warnings
  • Resource exhaustion messages
  • Device messages (disk, network, removable media, printers, etc.)
  • Outstanding messages requiring an action/decision reply from an automated process or operator

SYSLOG basics and challenge preparation actions

SYSLOG records are 131 characters in length.

TN3270 display size is 80 characters in length by default.


Optional:

ISPF and TN3270 settings allow for greater than 80 characters across by taking the following actions:
  • ISPF Setting (0) Screen Format 3 - Max
  • TN3270 configuration setting - model type 5 (27x132)

From SDSF enter LOG to access the z/OS SYSLOG:
  1. Enter top to be at top of system log
  2. Enter bottom to be at bottom of system log
      the most recent messages written to the SYSLOG are at the bottom
  3. Enter right to shift display view right
  4. Enter left to shift display view left
  5. Cursor Scroll values such as csr, page, and max are available
  6. Enter cols to display a column ruler
  7. Find f is available to search for character strings
      Find is from current record toward bottom
      Find previous (prev) is needed to search from current record toward top
      Find string all is available

Optional:

If you are interested in SYSLOG record details understood by highly experienced z/OS technicians,
then spend 9 minutes watching the following video presentation:
z/OS Introduction - Components, Messages, and the System Log

Challenge Description

You will be instructed to activate a user log (ulog) to capture SYSLOG output only related to your specific actions in the SYSLOG, print the user log content, then write the printed user log content to member #03 in partitioned data set p3.output.


Challenge:

Activate user log (ULOG)
  1. From SDSF enter ulog
  2. Display upper left area will read SDSF ULOG CONSOLE
  3. Terminate and purge previous ulog content, enter ulog close
  4. Press F3 or enter end to exit the ULOG panel

Note: SDSF command log displays content of the currently active SYSLOG


Capture SYSLOG output only related to your specific actions
Substitute your ID for z#####
  1. From SDSF enter ulog
  2. Enter command /d ts,z######
  3. Enter command /d m=cpu
  4. Enter command /d iplinfo
  5. Enter ulog again to display content of current ulog

Print the user log content

The following actions require you to be in the SDSF environment.

  1. From SDSF enter print
  2. Upper right of display will read LINES PRINTED

It possible for SDSF to print lines from the SYSLOG or the ULOG to a data set name. When printing without giving a data set name, the printed output is written to your TSO session ID output located in the JES spool.


Write the user log content to p3.output(#03)
Substitute your ID for z#####
  1. From SDSF enter owner z##### ; prefix z##### ; st
  2. Enter ? to the left of your ID
  3. A DDNAME beginning with SYS is in the list
  4. Select s the DDNAME beginning with SYS
      The content from ulog print should be displayed
  5. Enter end to return to JES spool listing of your ID
  6. Enter xdc to the left of the DDNAME with content from ulog print
  7. SDSF Open Print Data Set panel is displayed
  8. Tab to Data set name field
  9. Type (but do not hit enter yet) p3.output into Data set name field
  10. Tab to Member to use field
  11. Type (but do not hit enter yet) #03 into the Member to use field
  12. Tab to Dispostion field
  13. Type (but do not hit enter yet) SHR into the Disposition field
  14. Now enter tor write the content

Note: Failing to include "Member to use" and "Disposition" could overwrite all of p3.output resulting in loss of previous challenge output


Feel free to view your p3.output member #03 for content you would expect. When viewing #03 you might notice everything after column 80 is missing. That is perfectly OK.

The z/OS SYSLOG is in your collection of z/OS skills.

Next: Challenge #04

Application Development - Procedural Programming Languages
Part Three - Challenge #04

Background:

Computer Programming Languages

All programming languages have the same purpose - control the behavior of the machine or computer. Thousands of programming languages exist and new ones are created every year. All programming languages have strengths and weaknesses. A 'popular' programming language can be the wrong programming language for specific requirements.

z/OS supports and hosts many popular languages in addition to the time tested, trusted, and high performing languages.

Part 3 exposes you to several widely used z/OS programming languages. The objective is not to make you proficient in any specific programming language, but to have you recognize syntax structure of various programming languages, how to compile, and how to execute those programming languages.


What does C and COBOL programming languages have in common?
Both programming languages are:
  1. 50+ years old
  2. not typically listed as the "most popular" languages
  3. used to maintain many important computer applications still running today
  4. procedural languages - orderly flow control
    Based upon structure programming aimed at improving the clarity, quality, and development time of a computer program by making extensive use of the structured control flow constructs of selection (if/then/else)
    See Diagram under headings Elements (Control Structures)

Bottom line: These procedural languages are important now and will be far into the forseeable future.


COBOL - wrongly maligned with an under estimated learning value

COBOL, Common Business-Oriented Language, manages some of the most critical data and business logic in the world's economy. Many reasons exist for why COBOL is a computer language with incredible longevity.

COBOL is absent from nearly all the lists of 'popular' programming languages. COBOL is too verbish for the likes of some programmers. However, COBOL is respective and trusted by those that have many years in the industy. And COBOL can be easier to maintain than other languages as a result of being verbish.

COBOL programming language benefits from over 50 years of advancements, such as, COBOL compiler optimization, and COBOL runtime performance.

The core business logic of many large enterprises has decades of business process improvements embedded in COBOL programs.

The point is - whatever you read or hear about COBOL, be very skeptical. The opportunity to work directly with someone involved in writing or maintaining critical business logic using COBOL is an opportunity to learn about the operation of the core business. Business managers, business analysts, and decision makers come and go. The sum of all good business decisions can frequently be found in COBOL programs. The answer to "How does this business actually work?" can be found in COBOL programs.

COBOL is incredibly easy to learn and understand. Auditors are not programmers. However, auditors are responsible for insuring the business financial statements are presented fairly. COBOL processing frequently results in business ledger updates and subsequent financial statements requiring code review by auditors.

A comment recently made in a well known business journal by someone with a suspect agenda was quoted as saying, "COBOL is a computing language used in business and finance. It was first designed in 1959 and is pretty old and slow." A highly experienced business technology person knows the only true part of that last sentence was that COBOL was first designed in 1959. "Slow" is absolutely incorrect. The opposite is true.

It's no secret many banks have millions of lines of COBOL on mainframes. COBOL is at the core of how many banks handle the daily money transactions totally transparent to the smart phones involved with initiating those banking transactions.

COBOL is an attention getter on resumes. Hiring authorities and hiring influencers in large organizations running mission critical applications written in COBOL are more likely to spend more time reading a resume after spotting COBOL.

That is real world!

COBOL that runs in the z/OS Environment is called Enterprise COBOL.


You will learn to recognize C and COBOL source code

You can complete this challenge without any experience with C or COBOL.

C and COBOL source code is provided. The C and COBOL source code is compiled into an executable modules, then executed.


Optional: C and COBOL for Beginners

Below are a few recommended references for those with a desire to advance their skill level with C and COBOL.


Practice Preparation

Assumption moving forward is that you know how to locate and edit your various data sets for the purpose of copying in text from another data set.

Assumption moving forward is that you know how submit JCL providing a unique character for the generated JCL JOB statement, then locate and review JCL job output using SDSF.

  1. Copy 'zos.mtm2019.public.p3.source(cblhello)' into your SOURCE data set as new member name cblhello
  2. Observe the simple COBOL source syntax
  3. Copy 'zos.mtm2019.public.p3.source(chello)' into your SOURCE data set as new member name chello
  4. Observe the simple C source syntax
  5. Copy 'zos.mtm2019.public.p3.jcl(hello)' into your JCL data set as new member name hello
  6. Description of the JCL:
     Line 1
     Executes a JCL procedure reading CBLHELLO source to create an executable module
     Line 3
     Executes the CBLHELLO executable module
     Line 4
     Instructs the system where to find CBLHELLO executable module
     Line 6
     Executes a JCL procedure reading CHELLO source to create an executable module
     Line 8
     Executes the CHELLO executable module
     Line 9
     Instructs the system where to find CHELLO executable module
  7. Enter sub ; =sd ; st to submit the JCL and review the output
     Output has 2 Hello! messages, 1 from COBOL execution and 1 from C execution

The COBOL and C executable modules are in your LOAD partitioned data set.

From the ISPF command line enter tso call load(cblhello)

From the ISPF command line enter tso call load(chello)

Executable modules, regardless of the programming language, can be executed using JCL in the background or executed interactively in the foreground.


Challenge:

Get and review COBOL program source code.
  1. Copy 'zos.mtm2019.public.p3.source(zcobol)' into your SOURCE partitioned data set as member zcobol
  2. COBOL programming language includes:
      4 Divisions
        1 - Identification
        2 - Environment
        3 - Data
        4 - Procedure
      > COBOL verbs are English like
      > Asterisk in column 7 results in the line treated as a comment
      > Procedure Division is the execution logic
  3. Find the RECIN and RECOUT file names in the source code
  4. Enter F3 or save;return to save and return

Get and review C program source code
  1. Copy 'zos.mtm2019.public.p3.source(zc)' into your SOURCE partitioned data set as member zc
  2. C programming language includes:
    #include directive imports various functions with associated variables
    int main() where int will return an integer number and main is the program logic
    { } Braces ("curly braces") are used to group statements and declarations
      Class content or interface are enclosed in braces
      Method bodies and constructor bodies are enclosed in braces
      Braces are used to group the statements in an
      if statement, a loop, or other control structures
    [ ] Brackets ("square brackets") are used to index into an array
    ( ) Parentheses are used to:
      control the order of operations in an expression
      supply parameters to a constructor or method
  3. Find the RECIN and RECOUT file names in the source code
  4. Enter F3 or save;return to save and return

Get and review program compile and execution JCL
  1. Copy 'zos.mtm2019.public.p3.jcl(rwrecord)' into your JCL partitioned data set as member rwrecord
  2. Description of the JCL:
     Line 1
     Executes a JCL procedure reading ZC source to create an executable module
     Line 5
     Executes the ZC executable module
     Line 6
     Instructs the system where to find ZC executable module
     Line 7
     ZC file name RECIN input
     Line 8
     ZC program file name RECOUT output
     Line 12
     Executes a JCL procedure reading ZCOBOL source to create an executable module
     Line 16
     Executes the ZCOBOL executable module
     Line 17
     Instructs the system where to find ZCOBOL executable module
     Line 18 and 19
     ZCOBOL file name RECIN input
     Line 20
     ZCOBOL program file name RECOUT output

Program inputs and outputs

C program input (RECIN) is ZOS.MTM2019.PUBLIC.SHARED.DATA(MSG1)

ZOS.MTM2019.PUBLIC.SHARED.DATA(MSG1) has a single record with text:
 Replace ### farms with ??? ? and save a fortune in data center costs.

C program output (RECOUT) is P3.OUTPUT(#04)

P3.OUTPUT(#04) has as single record with text:
 Replace x86 farms with ??? ? and save a fortune in data center costs.

The C program changed string ### to x86.

COBOL program input (RECIN) reads 2 data sets:
ZOS.MTM2019.PUBLIC.SHARED.DATA(MSG2)
P3.OUTPUT(#04) the single record previously written by the C program

ZOS.MTM2019.PUBLIC.SHARED.DATA(MSG2) has 2 records with text:
 A single ??? ? can host thousands of operating systems resulting
 in massive reduction in power cost and floor space.

P3.OUTPUT(#04) has a single record with text:
 Replace x86 farms with ??? ? and save a fortune in data center costs.

Result will be P3.OUTPUT(#04) with 3 records:
 A single ??? ? can host thousands of operating systems resulting
 in massive reduction in power cost and floor space.
 Replace x86 farms with ??? ? and save a fortune in data center costs.


Execute C and COBOL programs
  1. Submit JCL to compile and execute C and COBOL source code, then review the output
    tso submit jcl(rwrecord)
  2. dslist p3.output and view member #04

Result is P3.OUTPUT(#04) with 3 records:
 A single ??? ? can host thousands of operating systems resulting
 in massive reduction in power cost and floor space.
 Replace x86 farms with ??? ? and save a fortune in data center costs.


The message needs a correction to complete the challenge

The COBOL program (ZCOBOL) needs to be modified to inspect the RECIN input records, replacing any occurrence of ??? ? with IBM Z before the RECOUT output records are written.

Modify ZCOBOL to replace all occurrences of ??? ? with IBM Z, and re-run JCL(rwrecord).

Edit p3.output(#04)

If C and COBOL programs produced the 3 records with the requested string modifications, then copy source(zcobol) after a line 3.

The final p3.output(#04) should contain the 3 records followed by the COBOL source code used to modify the records.


If you are new to C and COBOL, you can now at least recognize the C and COBOL program language syntax.

Next: Challenge #05

Java - A popular programming language
Part Three - Challenge #05

Background:

z/OS includes many of the popular programming languages

The usual suspects (Java, Javascript (node.js), Scala, Python, PHP, Perl, Swift, C++, Go, etc.) frequenting the popular programming lists are all available in the z/OS environment. Any programming language can be ported to the z/OS environment.

A strong preference for any programming language is like claiming to all your friends that you have a best friend. You are likely most familiar with your best friend through years of a positive relationship. While I have many programming language friends, my best friend is REXX. And I know I share my best friend with many others in the industry even though REXX never makes any programming language popularity list.


The challenge situation involves Java - best friend to many

z/OS has many 'modernization' advancements based upon Java and Javascript. The challenge objective is to demonstrate the basics of using Java applied to the z/OS environment.

What you will learn during the next 3 challenges:

  • Java compile using Unix shell prompt
  • Java JVM execution from Unix shell prompt
  • Java compile using JCL
  • Java JVM execution using JCL
  • Java read/write of Unix files
  • Java read/write of MVS data sets
  • Java SQL API

Challenge Description

Many alternatives exist to work with Java in the z/OS environment. Challenge 5 exposes you to a few methods for working with Java. Be aware may ways exist to accomplish the same tasks demonstrated in the challenge.

The challenge will make you aware of a few environmental requirements associated with Java on z/OS. If you have experience with Java in other operating systems, then you are aware Java environmental requirements exist in all operating systems.

Java source can copied between MVS data sets and Unix files using

  • TSO/ISPF commands
  • ISPF Editor
  • Unix commands
  • JCL and System Utilities

Java source edit is possible using

  • ISPF editor
  • OMVS oedit
  • SSH vi
  • Unix sed command

Java compile is possible using

  • Unix commands
  • JCL and System Utilities

Java execution is possible using

  • Unix commands
  • JCL and System Utilities

Java execution can

  • Read and write to MVS data sets
  • Read and write to Unix files
  • Use SQL to read and write to relational DB tables

Challenge:

Copy Java program to MVS partitioned data set member and Unix file
  1. dslist source
  2. edit source
  3. select new empty member using name pgmjava
  4. copy 'ZOS.MTM2019.PUBLIC.P3.SOURCE(PGMJAVA)'
  5. Observe Java source, then F3 or end;return
  6. Enter TSO OMVS to get Unix shell prompt
  7. Enter oedit pgmjava.java - an empty file
  8. copy source(pgmjava)
  9. Enter F3 or end;return - returning you to the Unix shell prompt

Compile and execute Java program using Unix shell prompt

If you do not have a Unix shell prompt, from ISPF command line, enter TSO OMVS. The Unix shell prompt places you in your home directory.

  1. Enter javac pgmjava.java
    Error messages state "not enough storage is available to load DLL"
    TSO OMVS, by default, tries to operate using very few system resources. This is usually not a problem, but as you can see, additional storage is required for this task.
    We can solve this by increasing the storage allocated at login time, but we can also get around this problem by using another connection method, SSH.
  2. Use SSH to access the contest z/OS to compile and execute
      Use SSH workstation client software
       or
      From workstation command prompt, enter ssh z#####@192.86.32.91
      -- Substitute your ID for z#####
      Authenticate with your existing password in lowercase
  3. Enter javac pgmjava.java
      Absence of messages is success
  4. Enter java pgmjava to execute the Java program from the shell prompt

Execute the Java program using JCL
  1. dslist jcl
  2. edit jcl
  3. select new empty member using name pgmjava
  4. copy 'ZOS.MTM2019.PUBLIC.P3.JCL(PGMJAVA)'
  5. Observe JCL, then submit ; =sd ; st to execute JCL and review output

Last task to get full credit for the challenge
  1. dslist jcl
  2. edit jcl member pgmjava
      Java program is writing to JCL DDNAME //STDOUT
      JCL DDNAME //STDOUT redirects output to the JES spool using SYSOUT=*

STDOUT needs to be redirected to write the output message to member #05 in to your P3.OUTPUT partitioned data set.

Change jcl member pgmjava for //STDOUT redirect output to member #05 in to your P3.OUTPUT partitioned data set.

FYI - Score routine can detect the difference between the Java program writing the output vs. you typing the output message into member #05

Need help? Review the JCL from the previous challenge.


What did you just learn?

You are aware Java is able to take advantage of the broad z/OS environment flexibility.

You will learn more in the following challenges.


Next: Challenge #06

JZOS Toolkit API for Java
Part Three - Challenge #06

Background:

Java on z/OS includes a rich 'Toolkit'

The JZOS Toolkit consists of classes in package com.ibm.jzos, which is distributed with the IBM Java SDKs for z/OS.

JZOS Toolkit capability includes:

  • High performance interface for reading and writing sequential data sets in record mode
  • An interface for various z/OS native functions
  • BufferedReader, BufferedWriter, InputStream, or OutputStream on a text file or a MVS dataset
  • An interface to the MVS Operator console and job log
  • A thin wrapper for many of the z/OS C library I/O functions
  • Sample programs

If you are an experienced Java programmer and want JZOS Toolkit package syntax:

Overview (IBM JZOS Toolkit API)

Challenge Situation

A Java program "imports" the JZOS Toolkit to use the toolkit features.

A Java source code compile problem is reported. The reported problem is related to a simple Java syntax error. The Java syntax problem can be identified without being a Java programmer. The Java compile error message provides information needed to resolve the problem.


Challenge Description

You will copy Java source code to a file in your Unix directory. JCL is used to compile and execute the source code. The output of the Java program is written to member #06 in your P3.OUTPUT partitioned data set upon successful resolving the compile and execution issues.


Challenge:

Copy Java source to your Unix directory

Yet another way to copy between MVS data sets and Unix filesystems:

  • From ISPF, enter =6 to jump to the ISPF Command Shell panel
      You can enter TSO commands from the ISPF Command Shell panel
  • Enter oput 'zos.mtm2019.public.p3.source(zjava)' 'zjava.java'

View the Java source in your Unix subdirectory

Yet another way to edit Unix files:

  • Enter oedit
      Your Unix subdirectory with file names is displayed
  • Edit e to the left of zjava.java to view the Java source code
  • Line 1 imports the IBM JZOS Toolkit
  • Line 7 shows the data to be read is from JCL DDNAME //RECIN
  • Line 10 declares variable nRead as an integer
     nRead declared variable is significant in resolving syntax error during compile
  • Line 12 reads a text line into string variable rec
  • Line 13 replaces Who said this   with Albert Einstein
  • Line 13 variable newRec has the modified text
  • Line 14 writes the content of newRec
  • Line 15 results in reading the next text line

Submit JCL to compile and execute Java source program

From the Unix file edit session, submitting JCL and jumping to SDSF is possible.

  • Enter tso sub 'zos.public.jcl(zjava)' ; =sd ;st

Identify and correct Java compile error

DDNAME STDERR output from JCL job ZJAVA includes an error message.

What was the name of integer value declared early in the Java program?

A mark exists just below the source line flagging the location of the error found by the compiler.

  • enter tso oedit
  • edit zjava.java
  • correct the syntax error
  • enter tso sub 'zos.public.jcl(zjava)' ; =sd ;st
  • view the output

If compiled was unsuccessful, then edit the source again to identify and correct the problem.

If compile was successful, proceed to the next part of the challenge.


What did you just learn?

You identified and corrected a Java source code syntax error reported by the compiler.


Feel free to check your P3.OUTPUT(#06) which should contain the following quote:
"I have no special talent. I am only passionately curious."

Next: Challenge #07

More Java using JZOS Toolkit
Part Three - Challenge #07

Background

A weird problem exists resulting from previous challenge Java program execution

Below is a repeat of what you read in challenge 6. However, it is worth reading a second time. Even an experienced Java programmer would have a very difficult time completing the challenge because the syntax is compiler acceptable and the logic 'appears' to be perfect. You will learn appearances can sometime be misleading.

  • Enter oedit
      Your Unix subdirectory with file names is displayed
  • Edit e to the left of zjava.java to view the Java source code
  • Line 1 imports the IBM JZOS Toolkit
  • Line 7 shows the data to be read is from JCL DDNAME //RECIN
  • Line 10 declares variable nRead as an integer
     nRead declared variable is significant in resolving syntax error during compile
  • Line 12 reads a text line into string variable rec
  • Line 13 replaces Who said this   with Albert Einstein
  • Line 13 variable newRec has the modified text
  • Line 14 writes the content of newRec
  • Line 15 results in reading the next text line

Challenge Situation

The Java program reads text, parses the text looking for text string 'Who said this ', then replaces it with text string 'Albert Einstein'. However, the Java execution did not replace the string. 'Who said this '.

View of member #06 in P3.OUTPUT will show the string replacement did not occur.

You will find the issue is not the program logic but involves the specific string of data being replaced.

Remember what you learned about hexadecimal values. You will need it.


Challenge Description

You will be guided to why the Java program did not replace the sting. You will need to make a modification to the Java source code to correct the problem. You will compile and execute the Java program using JCL to prove the old string was replaced by the new string,


Challenge:

Use Java program to replace old string of text with a new string of text
  • Enter oedit
      Your Unix subdirectory with file names is displayed
  • Edit e to the left of zjava.java to view the Java source code
  • Enter hex on
  • Very carefully look at the hex values associated with the old string "Who said this "
  • From ISPF Command Shell panel =6, enter obrowse '/z/public'
  • View v file quote
  • Enter hex on and carefully look at hex values associated with the second line
  • The java program is reading '/z/public/quote'

Carefully reviewing old string hex values is the key to solving the problem

You do not need to be Java programmer or a programmer to identify the problem.

Hint - Make the string in the Java program match the string in '/z/public/quote'


Get new copy of JCL to compile and execute modified Java source code
  • dslist jcl
  • Select s new member name zjava
  • copy 'zos.public.jcl(zjava)'
  • change //STDOUT to write output to member #07 in p3.output

Last task to get full credit

NOTE: Remember copy and paste is available to help eliminate typing mistakes.

  • dslist p3.output
  • edit e member name #07
  • copy '/z/z#####/zjava.java' after the last line in member #07
      Substitute your ID for z##### on the above copy command
  • Press F3 or enter end;return

What did you just learn?

Programs process data. Problems can exist as a result of making assumptions about the data.


Next: Challenge #08

Java and Db2 API, Application Program Interface
Part Three - Challenge #08

Background:

Java and Db2 relational database table

JDBC stands for Java Database Connectivity.

JDBC is a Java API to connect and execute relational data base SQL queries.

JDBC API uses JDBC drivers to connect with the database.


Challenge Situation

You will compile and execute Java source to SELECT data from a Db2 for z/OS table. A Java source code issue requires identification and modification to successfully execute.


Challenge Description

You are given Java source code using SQL to SELECT data records from a Db2 table. The Java source code loads a JDBC driver to connect to a Db2 data source. A Java JDBC url is embedded in the code with all the necessary information to establish a connection.

A Db2 connection problem occurs during execution. STDERR identifies the connection problem.

A Java source code modification to the embedded JDBC url is required to successfully connect.


Challenge:

Copy Java source coded to your Unix directory
  • From ISPF Command Shell panel =6,
    enter oput 'zos.mtm2019.public.p3.source(db2java)' 'db2java.java'

Submit JCL to compile and execute the Java program
  • From ISPF Command Shell panel =6,
    enter sub 'zos.public.jcl(db2java)' ; =sd ; st

Review the db2java JCL job output
  • From SDSF enter ? to the left of db2java JCL job output
  • STDERR DDNAME output includes description of the error
    Continue to scoll to right to see the entire message by pressing f11 or entering right
  • What is 'invalid'?

Modify, compile, and execute the DB2JAVA program
  • From ISPF, enter TSO OEDIT
    A list of Unix files appears
  • Select s file db2java.java
  • Remember what was 'invalid'?
    Look through the Java code to find it and fix it
  • Once db2java.java source code is modified, then enter save
  • Enter tso sub 'zos.public.jcl(db2java)' ; =sd ; st
  • View member #08 in P3.OUTPUT for valid SQL result set

What did you just learn?
Java drivers exist to connect to data sources such as Db2 for z/OS.

Next: Challenge #09

Java SQL
Part Three - Challenge #09

Background:

Modify previous challenge Java program

Challenge #09 assumes you successfully completed challenge #08.

The Java program from the previous challenge, db2java.java, has a SQL statement used to return a result set into p3.output(#08).

Completion of challenge 9 involves a modification to the Java program to return a different result set.


Challenge Situation

The Java program, db2java.java result set returns a phone number for a specific employee. The Java program SQL must be modified according to instructions, successfully compiled and executed.


Challenge Description

Modify, compile, and execute Java program, db2java.java to return a result set of employee number or employee numbers associated with a single phone number.

The challenge has sparse instructions. The sparse instructions is a part of the challenge demonstrating skills acquired from the previous challenges.


Challenge:

Get JCL necessary to complete challenge
  1. Copy 'zos.public.jcl(db2java)' to member db2java in your JCL data set
  2. Modify db2java in your JCL data set to write output to member #09
    in your p3.output data set
  3. Save the modified JCL member db2java
  4. Submit db2java
  5. Review JCL output for success
  6. Review p3.output(#09)
    Member #09 should be identical to member #08

Modify, compile, and execute Java program
Modify db2java.java as follows:
  1. Select only employeenumber column from table ibmuser.vphone where the phonenumber is 2167
  2. Modify Java source to read the employeenumber string from the Db2 table and output the employeenumber string preceeded by Employee Number:
  3. Submit db2java JCL from your JCL data set
    Be sure to save db2java.java changes before submitting JCL to pick up your changes
  4. Review JCL output for success
  5. Review p3.output(#09)
  6. The p3.output(#09) should now include employee number or employee numbers with phone number 2167

What did you just learn?

You just successfully modified, compiled, and executed Java source code that reads a relational database table and outputs a selected result set.


Next: Challenge #10

  1. Edit SOURCE(ASMHELLO)
  2. Locate line ASMA044E reported as a compile error
  3. Review the assembler source code program references
  4. Compare program references to the failing assembler mnemonic to identify the problem
  5. Correct the assembler program source error
  6. submit; =sd ; st
  7. Review JCL jobname is ASMHELLO in JES spool output for successful compile
IBM Z Assembler
Part Three - Challenge #10

Background:

The challenge exposes you to IBM Z Assembler Language

Some large companies need programmers that understand assembler language.

These technical positions pay well and lead to promotions in the technical ranks.

Familiarity with IBM Z assembler on a resume is a major attention getter for securing an interview.

You can say you have familiarity with IBM Z assembler as a result of completing the challenge.


Challenge Situation

An assembler program compile fails. The compile output identifies the problem. You must modify the assembler source program for compile to succeed.

It is possible to identify and correct the problem without assembler experience. Problem identification and resolution is a matter of pattern recognition and applied problem analysis.


Challenge Description

Submit JCL to compile an assembler program.

Review the JCL job compile output to identify the reason compile was unsuccessful.

Correct the assembler program error.

Upon successful compile, execute the program interactively to see program output.

Once satisfied the program is executing properly, then submit JCL to execute the program in batch that will write the program output to member #10 in your part 3 output data set.


Challenge:

Copy assembler program source code
  1. Use edit to create a new member name, asmhello, in your SOURCE data set
  2. Copy 'zos.mtm2019.public.p3.source(asmhello)' into your SOURCE data set

Observe asmhello assembler program is wrapped in JCL to compile the source code


Submit JCL to compile assembler program source code

While in edit on member asmhello in your SOURCE data set:

  • submit; =sd ; st
  • JCL jobname is ASMHELLO in JES spool output owned by your ID

Identify reason assembler program compile was unsuccessful

ASMHELLO JCL job output includes:

  • JESMSGLG DDNAME with RC of 08 in STEPNAME C, abbreviation for compile step
  • SYSPRINT DDNAME associated with StepName C is the assembler program source code compile output
  • Review SYSPRINT DDNAME output
  • Page down until you recognize the source program with Stmt 2 reading HELLO CSECT
  • Page down until you recognize ASMA044E, an assembler compile error message
  • The compile failed as a result of the assembler mnemonic just before ASMA044E

Take note of the text associated with ASMA044E


Correct assember program source code error and re-compile
  1. Edit SOURCE(ASMHELLO)
  2. Locate line ASMA044E reported as a compile error
  3. Review the assembler source code program references
  4. Compare program references to the failing assembler mnemonic to identify the problem
  5. Correct the assembler program source error
  6. submit; =sd ; st
  7. Review JCL jobname output, ASMHELLO, for a successful compile

Execute successfully compiled assember program interactively

From ISPF Command Shell panel =6 enter the following:

  1. allocate dataset(*) file(recdd) shr
      Assembler program writes to RECDD file name
      The above allocates RECDD file name to the display, *
  2. call 'z#####.load(asmhello)' - substitute your ID for z######
  3. Successfull execution writes two messages to the display

Submit JCL job to execute successfully compiled assember program
  • tso submit 'zos.public.jcl(p3ch10)'

The above JCL job executes your modified ASMHELLO assembler program and writes the output to member #10 in your P3.OUTPUT partitioned data set.


What did you just learn?

You can recognize IBM Z assembler program source code.

You successfully identified and corrected a minor IBM Z assembler program source code error.


Browse or View P3.OUTPUT(#10) to verify the two lines are present, then move on to the next challenge!

Next: Challenge #11

Z Assembler Mnemonic Instructions and Macros
Part Three - Challenge #11

Background:

Learning to be an assembler programmer takes significant time and repetition.

Learning assembler is more difficult than learning other programming languages.

Assembler requires a programmer to learn about:

  • Assembler mnemonics
  • Machine instructions
  • Assembler directives
  • Assembler macros
  • Hardware architecture

Years are spent learning to recognize and apply assembler language coding techniques.


Challenge Situation

The same assembler program, ASMHELLO, from challenge 10 is used to complete challenge 11.

You will learn about the difference between assembler mnemonic instructions and assembler macros.


Challenge Description

Modify ASMHELLO to write a 3rd message:
"High level languages hide complexity of assembler".

You will add 3 assembler mnemonic instructions and 2 assembler macros to complete the challenge.

Compile and execute the modified program interactively to see program output.

Once satisfied the program is executing properly, then submit JCL to execute the program in batch that will write the program output to member #11 in your part 3 output data set.


Challenge:

Review ASMHELLO in your SOURCE partitioned data set
Description of ASMHELLO assembler source code:
  1. Comment on line 7 describes reason for the assembler instructions on lines 9, 10, and 11
  2. Lines 15 to 20 is the body of the assembler program which consists of:
    OPEN - an assembler macro that expands into assembler instructions
    MVC - an assembler instruction, Move Characters
    PUT - an assembler macro that expands into assembler instructions
    CLOSE - an assembler macro that expands into assembler instructions
  3. Lines 30 to 33 are assembler program reference definitions which consists of:
    DC - an assembler instruction, Define Constant
    DS - an assembler instruction, Define Storage
    DCB - an assembler macro that expands into assembler instructions
Description of ASMHELLO assembler program execution:
  1. DC is an area of storage with an assigned label to hold data constants
  2. DS is an area of storage with an assigned label to be modified
  3. DCB is a macro to define a program file name for program input and/or output
  4. MVC is an operation to move static data characters to a storage area capable of being modified
  5. PUT is a macro that writes to the target DCB

Assembler program modification

Modify ASMHELLO to write a 3rd message:
"High level languages hide complexity of system assembler".

A 3rd message can be written using:

  • A new DC assembler mnemonic instruction
  • A new MVC assembler mnemonic instruction
  • A new PUT assembler mnemonic instruction

Submit JCL to compile assembler program source code

While in edit on member asmhello in your SOURCE data set:

  • submit; =sd ; st
  • JCL jobname is ASMHELLO in JES spool output owned by your ID
  • If compile is unsuccessful, then correct errors

Execute successfully compiled assember program interactively

From ISPF Command Shell panel =6 enter the following:

  1. allocate dataset(*) file(recdd) shr
      Assembler program writes to RECDD file name
      The above allocates RECDD file name to the display, *
  2. call 'z#####.load(asmhello) - substitute your ID for z######
  3. Successfull execution writes three messages to the display

Submit JCL job to execute successfully compiled assember program
  • tso submit 'zos.public.jcl(p3ch11)'

The above JCL job executes your modified ASMHELLO assembler program and writes the output to member #11 in your P3.OUTPUT partitioned data set.


What did you just learn?

You can recognize IBM Z assembler program source code.

You successfully modified an IBM Z assembler program.


Browse or View P3.OUTPUT(#11) to verify the three lines are present, then move on to the next challenge!

Next: Challenge #12

System Programmer and SMP/E
Part Three - Challenge #12

Background:

System Programmer Responsibilities

In a mainframe IT organization, the System Programmer plays a central role with a diverse set of technical skills.

A System Programmer is responsible for maintaining a fully operational environment and resolving problems quickly. Responsibilities of the job include technical services, support, and consultation to the entire IT organization. The system programmer installs, customizes, and maintains the operating system, and installs or upgrades other software products that run on the system.

A highly experienced System Programmer:

  • develops operational procedures
  • develops systems administration procedures
  • develops application development procedures
  • assists system administration staff with issues involving operating system services
  • assists development staff with issues involving operating system services
  • provides on-call support for any escalated issue beyond the technical capability of other groups

What is SMP/E?

A software tool exists to install z/OS and z/OS software products. The software tool tracks all modifications to z/OS and z/OS software products. The software tool is Systems Modification Program/Extended (SMP/E)

When an operating system problem is encountered and the failing component appears to be an IBM owned component, the System Programmer contacts IBM with the error messages. IBM will request information about the maintenance level applied to various components of the operating system. SMP/E is used to quickly answer those questions. An understanding of SMP/E is required to work with IBM to resolve problems.

SMP/E is a repository of details about the highly advanced IBM Z flagship operating system, z/OS, and the IBM products added to the z/OS environment, such as DB2 and COBOL.

Learning SMP/E is an exercise in comprehending terminology. The specialized SMP/E skill is expected of any z/OS System Programmer position.

z/OS system might appear to be one large block of code. Actually, z/OS is a complex system comprising of many different smaller blocks of code. Each of those smaller blocks of code perform a specific function within the system.

Each system function is composed of one or more load modules. In a z/OS environment, a load module represents the basic unit of machine-readable, executable code.

The following terminology will be referred to in the challenge. You are not expected to memorize any of the terminology. Awareness of the terminology puts you on the learning path to be a skilled System Programmer.


SMP/E - LMOD, MOD, and MAC
  • LMOD
      SMP/E terminology for load module, executable code
      Load modules are created by combining one or more object modules
  • MOD
      SMP/E terminology for an object module, used to create a load module, LMOD
    LMOD can consist of one or many MODs
  • MAC
      Macro source code
      While MODs are shipped as object modules, in some cases a MOD is required to be assembled by SMP/E
      because a z/OS distributed MAC, macro, source code changed
    These building blocks, MAC, MOD, LMOD, are called elements by SMP/E.

    A change to an element is a system modification,SYSMOD.

    Note: Other SMP/E elements exist, but understanding MAC, MOD, and LMOD will make learning about the other SMP/E elements pretty easy.


SMP/E - CSI, RECEIVE, APPLY, ACCEPT, and RESTORE
  • CSI
      Consolidated Software Inventory
      A related group of SMP/E data sets with information about the elements
  • RECEIVE
      SMP/E command to read SYSMODs into SMP/E CSI data sets
    Global Zone stores information about "received" software
  • APPLY
      SMP/E command to update SMP/E CSI data sets with SYSMODs previously received
    Target Zone stores information about "applied" software
    Target Libraries stores the software used by running system
  • ACCEPT
      SMP/E command to update SMP/E CSI data sets accepting SYSMODs as permanent
    Distribution Zone store information about "accepted" software
    Distribution Libraries stores the initial installation software and "accepted" software
      used in the event a backout ("restore") is necessary
  • RESTORE
      SMP/E command to update SMP/E CSI data sets backing out previously applied SYSMOD

SMP/E - SYSMOD

There are 4 types of SYSMOD

  1. FUNCTION SYSMOD
      Entire operating system or product consisting of many components
    FMID unique 7 digit alphanumeric value used to identify various FUNCTION SYSMODs
      FMID - Function Management IDentifier, example HBB77A0
  2. PTF SYSMOD
      Fix for operating system component or product component
    RMID unique 7 digit alphanumeric value is used to identify various PTF SYSMODs
      RMID - Replacement Management IDentifier, example UA12345
  3. APAR SYSMOD
      Fix for operating system component or product component (NOT FULLY TESTED)
    RMID unique 7 digit alphanumeric value is used to identify various APAR SYSMODs
      RMID - Replacement Management IDentifier, example OA12345
  4. USERMOD
      Customer modification to the z/OS environment such as local system exit

A collection of PTF SYSMODs are distributed as:

  • PUT
      Program Update Tape
      Collection of PTF SYSMODs(fixes) routinely published to keep software maintenance current
  • RSU
      Recommended Service Update
      Collection of PTF SYSMODs (fixes) routinely published to keep software maintenance current

SMP/E SYSMOD Processing

Challenge situation

A system problem just came to your attention.

A system element, EZAFTPCU, was involved with a reported system issue.

You need to find out maintenance details about EZAFTPCU such as when was EZAFTPCU last changed, etc.


Challenge:

Retrieve z/OS module maintenance information using SMP/E panels

SMP/E panels will be used to retrieve information about the system module.

When using SMP/E panels, IEC331I and IEC251I messsage might appear - ignore them and enter to proceed.

  1. Enter SM from ISPF Primary Option Menu to display the SMP/E Dialog Panels
      Press F3 or enter end to exit from the initial Welcome! tutorial panel
  2. Tab to SMPCSI DATA SET field, type 'MVS.GLOBAL.CSI',
      tab back to top command input,
      enter 3 (Query)
  3. Enter 1 (CSI Query)
  4. Information for the CSI Query panel follows:
      MVST is the ZONE NAME
      You do not have information on the ENTRY TYPE - leave it blank
      EZAFTPCU is the ENTRY NAME
  5. On the CSI QUERY - SELECT TYPE panel, the ENTRY TYPE is displayed
      Tab to the left of the displayed ENTRY TYPE. then enter s to select
  6. CSI QUERY panel displayed the found ENTRY TYPE
    RMID name is visible in the display
    LMOD name is visible in the display
      You need RMID and LMOD names to complete the challenge
      Press F3 twice will return to CSI QUERY panel
  7. From CSI QUERY panel:
    MVST is ZONE NAME
    SYSMOD is ENTRY TYPE
      Type the RMID name in the ENTRY NAME field, then enter
      Observe -
        Type of SYSMOD is PTF
        Date/Time maintenance was applied to the element
      Press F3 to CSI QUERY panel
  8. From CSI QUERY panel:
    MVST is ZONE NAME
    LMOD is ENTRY TYPE
      Type the LMOD name in the ENTRY NAME field, then enter
    LMOD entry included executable location identified by the SYSLIB entry
    You need the SYSLIB name to complete the challenge

Submit JCL to execute SMP/E utility program

What you know is the problem situation implicated a named MOD. The MOD is a part of a named LMOD. The MOD was changed by a SYSMOD type PTF, identified by a unique RMID number.

A JCL job will be used to write the information about the MOD, LMOD, and PTF SYSMOD into your p3.output data set as member #12.

  1. Create new member SMP in your JCL data set
  2. Copy 'zos.mtm2019.public.jcl(smp)' into your JCL(SMP)
  3. Replace AAAA with the target zone name
  4. Replace BBBBBBBB with the MOD name
  5. Replace CCCCCCCC with the LMOD name
  6. Replace DDDDDDDD with the RMID or SYSMOD PTF unique number
  7. Replace EEEEEEEE with the SYSLIB system library data set identifier
  8. Submit the JCL and review JCL job output

If everything was done correctly, then the information found using the SMP panels, was written to member #12 in your p3.output data set.


You now have exposure to few System Programmer responsibilities and day to day tasks using SMP/E.

Next: Challenge #13

Advanced REXX Programming Interface
Part Three - Challenge #13
field names and values from SYS
]

Background:

Deep z/OS skill development

Part 3 was started by advancing your exposure to REXX, SDSF, and the System Log (SYSLOG). Each are technologies used daily by z/OS System Programmers, System Administrators, and Operations staff.

Modernization frequently use these technologies to package easy to use front end graphical user interfaces (GUIs) such as z/OSMF, IBM z/OS Management Facility. While z/OSMF is designed to simplify, streamline, and automate tasks, a mastery of underlying technologies is required of the highly experienced technicians that are the "go to" people when issues exist beyond the scope of the modernization GUIs and the skill level of those that use modernization GUIs. The final challenges of Part 3 is an opportunity to use REXX, SDSF, and SYSLOG understood by the highly experienced z/OS technicians.

The challenge includes terminology that will be new such as the linklist, LNK or LNKLIST which requires you to research the meaning and purpose. In z/OS the linklist is a list of partitioned data sets with executable modules. When a program is requested, the linklist is one of several places the systems looks to find the program or executable module


Challenge Situation

SDSF Menu includes a rich collection information which is useful to the highly experienced z/OS technicians supporting critical systems. The challenge exposes you to the real time rich collection of information and how to collect information using REXX. REXX can be executed using JCL to produce a history useful in recognizing abnormal system activity and behavior when compared to a history of normal system activity and behavior.

In some cases, quick one-off REXX routines can be created to help isolate problems when all that is available are problem symptoms. Reading system dumps is a last resort to resolving reported problems on critical systems. Why? It takes too long and action to resolve or avoid system problems must be immediate. IBM Z Mainframe system problems impact thousands of people immediately with financial impact to the company.

A reference is the optional short video you may or may not have viewed in the contest preparation section on opening day of the contest.

What data is handled by IBM Z?
Listen to Lecture 1


Challenge Description

SDSF real time information is explored followed by using REXX programming language to capture point-in-time snap shot of information.

Completing challenge 13 and 14 is a matter of following instructions and recognizing REXX code patterns available to collect information. However, challenges include a need to review professional documentation to assist in challenge completion.

The final challenge is to modify available REXX code to develop a useful routines to help train z/OS System Programmers new hires who are learning the deep z/OS knowledge from senior z/OS System Programmers.

The challenge references documentation about system and special variables. Taking time to familiarize yourself with these variables will prove valuable in the final challenge.


Challenge:

Explore SDSF real time system information

SDSF Menu consists of the following informational areas for you to quickly try:

  1. LNK
  2. LPA
  3. APF
  4. PARM
  5. PROC
  6. SYM
  7. ENQ
  8. SYS
  9. AS
  10. DYNX
  11. SSI
  12. VMAP
  13. SMSG
  14. SMSV
  15. FS
  16. CSR
  17. CK

From SDSF Menu, try each of the above SDSF commands taking the following action with each:

  1. Press F1 or enter help in each of the above SDSF panel displays
  2. From the HELP: display for each SDSF panel, enter 1 to get a brief description

While these details might seem technically deep, it is the tip of the iceberg for the highly experienced z/OS System Programmer. An example of going even deeper:

  1. Enter SDSF command AS for Address Spaces
  2. Enter slash / to the left of any listed address space to see all the columns in a vertical view
      You need to exit panels to enter other panels
  3. Enter JD to the left of any listed address space to see associated allocated devices and data sets
    Enter slash / to the left of JD entry figuring it outto get detail value
  4. Enter JT to the left of any listed address space to see associated system tasks and modules
    Enter slash / to the left of JT entry to get detail value
  5. Enter JM to the left of any listed address space to see associated system memory
    Enter slash / to the left of JM entry to get detail value
  6. Enter JC to the left of any listed address space to see list of loaded modules
    Enter slash / to the left of JC entry to get detail values about any module

Copy, review, and execute REXX code that gathers system information
  1. Copy 'zos.mtm2019.public.rexx(zperf)' to your REXX data set as member zperf
  2. Enter hilite rexx to hilite the REXX reserved words
  3. Save, then enter ex to the left of member zperf to execute the REXX routine
  4. REXX zperf writes messages to the display and write messages to member #13 in your p3.output data set
  5. Take time to review the REXX code pattern used to write to the display and write to member #13 in your p3.output data set

Modify REXX code and observe differences

Note: REXX comment line is slash asterisk to asterisk slash
/* is a REXX comment line */

The REXX say commands writes to the display

Modify zperf as follows:
  1. Comment lines 9, 10, and 11
  2. Uncomment lines 13, 14, 15, and 16
  3. Uncomment line 36 - Comment line 36 line before creating final report
  4. Save and execute to observe differences

Description of the challenge ZPERF REXX code

The

  • Line 2, 3, and 4
    say is a REXX reserved word to write to the display
    userid(), date(), time() are functions to produce values
  • Line 6 thru 18
    allocate and execio enables data set read and write
      Reference dropdown REXX Documentation
      Specifically review Understanding EXECIO read and write capability
  • Line 19
    isfcalls('ON') enables interface to SDSF
      Reference dropdown REXX Documentation
      Specifically review Using SDSF with the REXX programming language
  • Line 28, 31, 34, 35
    isfcols and isfrows are special variables with column and row field names
      Reference dropdown REXX Documentation
      Specifically review Using SDSF with REXX - Special variables reference
  • Line 23
    ISFEXEC SYS access to the SYS panel
      Reference dropdown REXX Documentation
      Specifically review ISFEXEC in Using SDSF with the REXX programming language
      Specifically review System Panel (SYS) in Using SDSF with REXX - Columns on the SDSF panels
  • Line 36
      Temporarily uncomment to display all the SYS column names and values
      Comment line when not needed - keep final report uncluttered with all that detail
      The column name and values are documented in the professional documentation
  • Line 37 thru 107
    col field names and values from SYS
      Reference dropdown REXX Documentation
      Specifically review Using SDSF with REXX - System Panel (SYS) columns on the SDSF panels
  • Line 31, 34, 37, 40, 83, 111, 117
    do, select/when. call REXX verbs
      Reference dropdown REXX Documentation
      Specifically review REXX program logic flow

Modify REXX code to produce customize performance report

A need exists for a quick z/OS processing performance report.

Remember to comment line 36 to keep the report uncluttered.

In addition to the existing lines written, the report must include:

  1. CPU percent busy for the system
  2. High unreferenced interval count
  3. Real storage available frame count
  4. Number of active started tasks
  5. Number of active TSO users
  6. Number of active batch jobs

The information above is available from the SDSF SYS column fields.
Review the Select When REXX logic in the zperf program to include the required information the report.

The previous information in the challenge instructions and using REXX zperf code as a guide, you have everything you need to complete the challenge. Have fun piecing the coding solution together.

Execution of the modified zperf REXX routine writes a report to member #13 in p3.output.


What did you just learn?

You just learned how to use REXX to quickly collect a series of point-in-time reports to help isolate a problem where problem symptoms are random complaints about response time. Each time the help desk receives a call about poor response, they could run the report. The collection of reports would be reviewed by support staff to help isolate the sporadic poor response complaints.


Next: Challenge #14

z/OS System Log
Part Three - Challenge #14

Background:

System Log (SYSLOG)

What is the System Log (SYSLOG)?

The system log (SYSLOG) is a chronological listing of messages about z/OS system activity and other major middleware software products using z/OS services.

When an unexpected system problem occurs, the SYSLOG is the first place to look to gather information about the problem.

System log includes:

  • Informational, Warning, Error and Action messages
  • System commands entered
  • System command responses

Challenge Situation

REXX code is available to read the active system log looking for a specific string.

Each found string is written to member #14 in your p3.output data set.

Only selected parts of each system log record are written. The selected parts are:

  1. log date
  2. log time
  3. message text


Challenge:

Get and execute LOGLOOK REXX code

Copy 'zos.mtm2019.public.rexx(loglook)' into your REXX partitioned data set as a new member named loglook.

Press F3 or enter save;end

Execute LOGLOOK REXX code by entering ex to the left of the member name.

The result of execution is:

isfmsg is: NO SYS1 SYSLOG FOUND
isfmsg2.1 is: ISF754I
Command 'SET DATE MMDDYYYY /'
generated from associated variable ISFDATE.

isfmsg2.2 is: ISF754I
Command 'SYSID SYS1' generated from associated variable ISFSYSID.
isfmsg2.3 is: ISF766I Request completed, status: NO SYS1 SYSLOG FOUND.

What is in bold is key. What is the contest system name?


Special variables for use with the ISFLOG command

Revisit the SYSLOG and gather needed information
  1. Enter =sd;log
  2. Enter SYM to list the system symbolics
      The system ID is synonomous with sysname
  3. Press F3 or enter end to returnt to SDSF menu
  4. Enter 'top' to position cursor at top of the syslog
  5. Enter f z###### substituting your ID for z######
  6. Press F5 or enter rfind to repeat the find command
      Find is limited to 5,000 lines
      If not found in first 5,000 lines, then press F5 or rfind again

Modify LOGLOOK REXX code

REXX code that reads the SYSLOG is provided.

You will modify the REXX code as follows:

  • Provide the correct system ID
  • Provide a search string which needs to be your ID

Modify the LOGLOOK REXX code search the contest system name log for all occurrences of a search string that is your ID.

Successful execution is records containing:

  1. log date
  2. log time
  3. message text where message text includes your id

What did you just learn?

You just learned you can search system logs for any character string and write the report output to a data set. It is possible to automatically run the routine at different intervals then the various reports can be reviewed.


Next: Challenge #15

Learning and using z/OS creatively
Part Three - Challenge #15

The Final Challenge!

Good Luck! Remember, Part 3 is not a race. You have until December 31.

You will learn what the new to z/OS technicians frequently take several years to figure out.

Why? It is common to underestimate the value of carefully reading 'Introduction' sections of technical documentation.

The ability to read and interpret messages is an important skill within any operating system environment.

z/OS messages follow a format which enables an experienced technician to quickly identify what software component wrote the message and why the software component wrote the message.

Messages provide the ability to quickly assess the status of the operating system, optional software products and business applications.

Storyline - The role you are now playing is a role of an experienced z/OS technician. Your assignment as an experienced z/OS technician is to help a newbie become familiar with the z/OS environment. How you are going to assist a newbie become familiar with z/OS is by creating customized reports that read and format SYSLOG messages.

You are among a small fraction of the enrolled contestants completing the last challenge with hopes of being in the winner circle or in the honorable mention circle. It is possible for several contestants to be tied going into the final challenge. Therefore, your creativity applied to the final challenge is used to break ties, determine the winners, and determine who is in the honorable mention circle.

The final challenge has no correct or incorrect answer.

The final challenge is a matter of exercising technical creativity to distinguish your ideas and work from the other contestants. You are given a few ideas with sample Rexx code as the basis for applying creativity.

Background:

Quality can win over quantity
  • Final challenge creativity is a matter of quality over quantity
  • Achieving quality can take a lot of work and be the result trimming quantity to what you feel is best

Challenge Situation

The challenge is for you to enhance a system utility which generates point-in-time system activity reports. The system utility uses REXX and the SDSF interfaces to generate reports. Consider all SDSF Menu selections as the SDSF interfaces.

You already created 2 reports -

  1. Challenge 13 reported on the relationship between real memory, cpu consumption, and number of active workloads
  2. Challenge 14 reported on all occurrences of a specific string found in the system log (SYSLOG)

Challenge Description

Reports can be from any of the SDSF interfaces.

At least 1 report you write must demonstrate ability to parse SYSLOG records.

A report on all occurrences of a message ID is provided as a guide for additional reports demonstrating your ability to parse SYSLOG records and your knowledge of z/OS messages in the SYSLOG.

Familiarity with z/OS Message Format is needed to demonstrate you ability to parse SYSLOG records and create a report. A review of Chapter 1. Introduction in the z/OS Messages and Codes professional manual is a description of the z/OS Message Format and the records found in the SYSLOG.

When reviewing Chapter 1. Introduction, skip the information about Routing codes. The contest system is NOT a production environment with all the functional areas normally found in a large production environment. Therefore, the Routing codes are meaningless in the contest z/OS.

If you are in an interview for a z/OS technical position and you explain what you learned and accomplished in the final challenge, the person interviewing you will be impressed - assuming they know something about z/OS.


Challenge:

Start the Final Challenge

Submit JCL job to allocate needed Part 3 partitioned data sets with sample REXX code.

  • tso submit 'zos.public.jcl(p3ch15)'

JCL p3ch15 did the following:

  1. Deleted data sets ch15.clist and ch15.output (if they existed)
      Submitting the JCL a second time will wipe out previous challenge 15 work
      - to be used to start over
  2. Allocated new data sets -
    ch15.clist containing REXX templates to be used to complete the challenge
    ch15.output is the report output data set for all challenge 15 reports
  3. Wrote a timestamp into p3.output(#15)
      The timestamp does NOT influence winner selection
      The timestamp is only to inform judges that you did begin the final challenge
  4. Created member REXXJCL in your JCL partitioned data set
      Used to execute new REXX code to avoid tying up your workstation during execution

System Activity Utility

REXX template code is available as a guide to complete challenge 15.

From ISPF Command Shell panel =6 try the following:
  1. Enter ex ch15(get)
  2. Enter 1 to select 'Report specific message identifier found in SYSLOG'
  3. When prompted to enter message id, enter ich408i
  4. The SYSLOG records are read looking for all records related to z/OS message id ich408i
  5. All ich408i related SYSLOG records are written to the display
  6. All ich408i related SYSLOG records are written to ch15.output(msgid)

z/OS Message Format
Message sent to hardcopy log in JES2 system

MVS System Message - Volume 1 - Chapter 1. Introduction

Format of the message body

Message Directory

Explanation:
ICH408I message is issued when RACF, IBM z/OS Security product, detects an unauthorized request (a violation) made by a user or job. The user and group that is indicated in the first line of the ICH408I message are the execution user ID and group ID under which the job was to run.


Judging criteria of final challenge

Your ch15(get) will be executed to view the various reports.

The final challenge has no correct or incorrect answer.

The final challenge is a matter of exercising technical creativity to distinguish your ideas and work from the other contestants. You are given a few ideas with sample Rexx code as the basis for applying creativity.

You have the freedom to do what you want. The judges are looking for technical acumen applied to z/OS. Impress the judges with your best reports that show your acquired z/OS knowledge. The REXX code template provided is a good start. You are not required to use the REXX code template. If you choose to not use the REXX code templates, then execution of ch15(get) needs to guide the judges what action must be taken to review your work.


Next: Completing Part 3

Scoring and Selecting Winners
Part Three - Complete

Congratulations!

Completing Part 3 makes it highly probable your name and school will be posted in Part 3 Wall of Fame. This is a distinguished and relatively short list. You will be in this list at least as an Honorable Mention and possibly as a top place winner.

How can I know if I have everything 100% accurate?

Bottom line: You cannot.
  No routine is provided to score the answers you submitted.
  The last challenge is very open ended for the purpose of distinguishing yourself from other contestants.

The final challenge scores from judges are averaged for each contestant, then added to the point count
associated with challenges 1 to 14 to determine winners.

Part 3 results and badge awards are available in January 2020, following review of all Part 3 submissions.

Many student winners completed Part 3 during semester break during last 2 weeks in December.