Getting Started
Part Three - Challenge #01

Thinking about starting Part 3?   Just Do It!

In Part 3, you will learn more about using an operating system environment that is used to control the world's most critical data. With this knowledge, you can significantly increase your career potential - just as other participants have in the past.

Challenge:

Successful completion of the challenge is allocation of hlq.P3.OUTPUT(#01) with 3 lines.

From ISPF panel

  • Enter tso part3

Execution of part3 routine allocated hlq.P3.OUTPUT and wrote a single line into member #01

The basic skills that you have acquired in Part 2 should allow you to complete the following tasks with abbreviated instructions.

Edit hlq.P3.OUTPUT(#01)
 After the first line in hlq.P3.OUTPUT(#01), copy the content from hlq.P2.OUTPUT(#01)
 The result will be 3 lines in hlq.P3.OUTPUT(#01)

You are ready for the next challenge

Next: Challenge #02

Fundamentals of Computer Programming
Part Three - Challenge #02

Background:

What Computer Programmers Do?
Computer programmers write programs in a variety of computer languages. Learning to code in a new computer language becomes increasingly easy with each new language learned. Learning your first computer language can take the most time because of the need to learn programming language fundamentals which are listed below.

Duties
Computer programmers typically do the following:

  • Write programs in a variety of computer languages
  • Update and expand existing programs
  • Test programs for errors and fix the faulty lines of computer code
  • Create and test code using integrated development environment (IDE) tool sets
  • Use code libraries, which are collections of independent lines of code, to simplify the writing

What Software Developers Do?
Software developers are the creative minds behind computer programs. Some develop the applications that allow people to do specific tasks on a computer or another device. Others develop the underlying systems that run the devices or that control networks.

Many software developers work for firms that deal in computer systems design and related services or for software publishers.

Here is some information about these job roles in the United States:

If you noticed a decline in the demand for computer programmers from the above web site, this is misleading. For example, many jobs exist that assume knowledge of and some experience with computer programming and/or software development as a prerequisite for the job - such as an IT Consultant, etc.

While you have successfully demonstrated the ability to maintain an existing COBOL computer program in the final challenge of Part 2, fundamentals of computer programming apply to all computer programming languages. Experienced computer programmers know the learning curve dramatically shinks with each new computer language because the fundamentals are the same. What is different is variations in programming language syntax and how to execute the program on the target operating system.

Fundamental to learning how to read, change, and write a computer program using a new programming language is the familiarity with the programming language syntax and the target operating system environment procedures used to execute the program.

The most effective way to begin learning any new programming language is to start with a very simple programming language construct , such as print of the literal string "Hello World". The next step is to expand your capability with the new programming language by reviewing and modifying sample code focusing on the programming language specific syntax constructs that are fundamental to most programming languages - "how to code the":

  1. Operators
      Arithmetic
      Logical
      Relational
  2. Statements
  3. Expressions
  4. Sequences
  5. Selection process
  6. Loop process
  7. Data String Manipulation
  8. General and Program Constructs
  9. Functions
  10. Program Interfaces for Data Input and Data Output


1. Operators
Arithmetic Operators are:

  • ADD +
  • SUBSTRACT -
  • MULTIPLY *
  • DIVIDE /
    Relational Operators are:
  • EQUAL =
  • LESS THAN <
  • MORE THAN >
    Logical Operators are:
  • AND &&
  • OR ||
  • NOT !

Specific programming languages will use the operator symbol, the operator english word and in some cases, the programming language will accept either.


2. Statements vs. 3. Expressions
  • A statement is the smallest standalone element of a programming language where an action is to be carried out.
  • Statements are executed. Statements do something. Statements are instructions to be followed.
     An example would be setting a variable A to a value of 5
      A = 5.
  • Expressions produce at least one value.
     An example of an expression where the value is true or false.
     Given: A = 5 and B = 10
      Is A > B
      where this expression would return a true or false value.
  • Remember the difference between statements and expressions:
      A statement is executed and will do something, while an expression evaluates something returning a value.
      A statement can act upon a value returned by an expression.
      Statements can include expressions or other statements enabling the programming languages to be highly flexible and allow for creative programming techniques.

4. Sequence
  • Sequence is one of three basic logical structures in computer programming.
  • Sequence is effectively a list of statements.
      statement1;
      statement2;
      ...
      statement9;
  • While a program could be a list of statements executed in sequential order, this is typically NOT the case.
  • A statement action or event can determine the next statement to be executed. Therefore, a program is more than just a list of statements to be executed in sequential order.

5. Selection Process
  • Selection is one of three basic logical structures in computer programming. The other two are sequence and loop.
  • Selection involves use of a conditional expression to determine next statement to execute.
  • Selection is to make a decision based upon answer to a question in the program.
     IF ()
      THEN ;
      ELSE ;
     ENDIF
     IF (A > B)
      THEN Print A + "is bigger";
      ELSE Print B + "is bigger";
     ENDIF;
  • IF/THEN/ELSE is only one programming language form for constructing program selection logic.
  • Other examples of programming language verbs for program selection logic include SELECT, WHILE, CASE, etc.

  • 6. Loop Process
    • Loop is one of three basic logical structures in computer programming.
    • do something repeatedly (a loop)
       WHILE ()
        DO ();
       ENDWHILE;

       A = 1;
       WHILE (A < 5)
        DO Print A;
         A = A + 1;
       ENDWHILE;
    • WHILE DO is only one programming language form for constructing program loop logic.
    • An example of other programming language verbs for program loops include FOR, DO UNTIL, etc.

    • 7. Data String Manipulation
      • A string is traditionally a sequence of characters, either as a literal constant or as some kind of variable.
      • A string may also denote more general arrays or other sequence (or list) data types and structures.
      • Each programming language syntax includes a set of reserved keywords and techniques for reading, redefining, evaluating and changing strings.
      • Programming language reference manuals include a section for handling strings.

      • 8. General and Program Constructs
        • Each operating system environment and each programming language may have separate ways to assign a name to the program, compile, and execute the named program.
        • Each programming language includes a set of reserved keywords for operators, statements, expressions, selection, and loops.
        • Each programming language includes a set of reserved keywords for describing various data types such as character, numeric, or packed decimal.
        • As a result, learning a new programming language requires review of documentation describing the programming language reserved keywords, etc. as well as familiarity with how to name, compile, and execute the program language within a target operating system.
        • Start learning the constructs using simple sample code and sample execution procedures.
            The next few challenges will use simple sample code along with relatively simple execution procedures.

        • 9. Functions
          • Functions are small units of programs used to carry out specific task.
          • Functions are small "self contained" modules of code that accomplish a specific task.
          • Functions usually "take in" data, process it, and return a result.
          • Once a function is written, it can be used over and over and over again.
          • While it is possible to write a specific function within a program, each programming language has many powerful built-in functions.
             Example given A = "this is a long sentence"
            length(A) where length is the programming language function that would return a value of 23.
          • Functions can be "called" from the inside of other functions
          • Different programming languages name functions differently, for example, methods, sub-routines, procedures, etc. If you come across any such terminology, then just imagine the same concept. However, be aware of the technical purists that want to explain why they are not exactly the same across the various programming languages.

          10. Program Interfaces for Data Input and Data Output
          • Programming language input and output syntax typically falls into 1 of 2 categories
              1. Reading from and writing to interactive session display
              2. Reading from and writing to operating system controlled sources of data using the operating system data access method.
          • The programming language syntax for interactive session reading and writing may be different from the the programming language verbs for reading and writing to operating system controlled data sources.
          • Learning how to use the programming language syntax for reading and writing is best accomplished by looking at sample code, then reviewing the programming language manual for the target operating system to investigate all the available input and output capability of the specific programming language.

          The next several challenges will expose you to common programming languages.

          So, about now you might be asking, "Is one programming language enough to get a computer to do what I want it to do?" Programming languages have strengths and weaknesses as well as attributes that make a programming language the best fit for a specific task in a specific operating system. The analogy is, "if you only have a hammer, then everything looks like a nail". These challenges expose you to common programming languages which are effective tools of the IT business application architecture trade.

          The above terminology and description of programming language fundamentals will be used in the challenges - such as statement, expression, sequence, selection process, loop process, function, program construct, data string manipulation, etc.

          An extremely flexible z/OS computer programming language, REXX, will be used to demonstrate the above computer programming language fundamentals. The challenge is to change the sample computer program as instructed.

          Enough preparation reading. Time to do a very simple programming language challenge.

          Challenge:

          Edit hlq.SOURCE

          s xyz to create and edit this new member name

          copy 'zos.mtm2017.public.source(xyz)'
          Note: Enter hilite rexx to hilite the rexx reserved words

          You are seeing REXX programming language code.

          F3 to return to hlq.SOURCE directory list

          Many methods exist for executing REXX program in the z/OS environment.
            Enter ex to the left of member name xyz to execute the REXX programming language code.

          The XYZ REXX program writes helpful messages to your display.

          Edit hlq.SOURCE member name xyz

          You only need to focus on REXX Program lines 2 thru 10.

          Note: Replace ? with the correct REXX programming language arithmetic operators.

          Execute the REXX program until the program writes "The program generated a valid numeric number" message to your display.

          The REXX program will write the number from the program arithmetic operations to hlq.P3.OUTPUT(#02) following that message.

          If you want a simple explanation of the basic REXX program constructs, click on the following URLs:
          Learn REXX
          REXX Programming Introduction

          Next: Challenge #03

REXX, A Popular Mainframe Scripting Language
Part Three - Challenge #03

Background:

There are many hundreds of computer programming languages. It is important to recognize that recent "hot" languages get the most attention by the programming community due to the specific programming language characteristics that make them a best fit for developing specific emerging technology.

The following is a list of computer programming languages
Many Hundreds of Computer Programming Languages

While the mainframe is capable of compiling and running the relatively new and "hot" programming languages, such as GO, SWIFT, and SCALA, the contest challenge focus is on the time tested languages that are currently pervasive in IT enterprises. These time tested mainframe computer programming languages are COBOL, Java, C/C++, Assembler, and REXX. Knowing how to read these languages can enable you to understand large IT enterprise mainframe business application programs and systems infrastructure programs which are critical to the daily operation of the enterprise.

Many highly experienced mainframe technicians use a scripting language that is unfamiliar to most in the distributed processing world even though this language is available to the other platforms. While numerous z/OS scripting languages exist, a preferred scripting language by highly experienced z/OS technicians is REXX. REXX was designed for ease of learning and reading. The capabilities of REXX went far beyond the original intent of quickly writing prototype code to writing production permanent code. While REXX started out as a scripting language, REXX can be compiled into machine instruction programs enabling increased execution speed.

If you end up in a job as a z/OS System Programmer or System Administrator in a large enterprise, the chances of encountering REXX code is very high. It is not necessary to memorize REXX syntax. REXX syntax and coding techniques are everywhere on the internet.

The previous REXX learning URLs are easiest to read. Below are more websites with more extensive details about the REXX programming language:

Having "REXX" on your resume, similar to having "COBOL" or "JCL", can be an attention getter. An employer that observes "REXX" may immediately think this is an applicant with potential to fill future mainframe System Programmer or System Administrator openings within the organization.

Challenge:

Enter the following:
tso submit 'zos.public.jcl(p3ch3)'

Part 2 challenge 13 involved capturing system command output about network traffic and reporting on differences between two time periods. A system command syntax correction was required to complete Part 2 Challenge 13. This same challenge involved a REXX program to read the before and after command output, then report the differences.

Completion of part 3 challenge 3 is to modify the REXX program used in part 2 challenge 13 to write a report on a subset of NETSTAT STATS command output between two time periods. Therefore, the modification to the REXX program is to delete the unwanted code and retain only the REXX program code necessary to write the requested report.

The report required for successful completion must include before and after values for Packets Received, Received Address Errors, and Current Established Connections.

Packets Received and Received Address Errors are in the NETSTAT STATS output twice, once for IPv4 and again for IPv6. The report must only include the values for IP Statistics (IPv4).

An example report follows:

Enter tso netstat stats a few times and observe values for:

  IP Statistics (IPv4)
  Packets Received
  Received Address Errors
 TCP Statistics
  Current Established Connections

Edit hlq.SOURCE and select s new member name NSTATS, then copy REXX program code into the new NSTATS member name

copy 'zos.mtm2017.public.clist(ch13)'

The REXX code copied into member NSTATS is the REXX code used in part 2 challenge 13.

Note: You do not need to change the code at this time. You will be instructed to edit and the change the REXX code later in the challenge. For now, just review REXX program syntax constructs.

While several REXX programming learning URLs were provided, below is a description of a few REXX program constructs in the REXX program you will modify to complete the challenge:

call -- branch to a named label in the program and execute statements until return encountered
return -- return from the named label and execute next statement in sequence
ALLOC -- allocate a data set name to read, write, or update
EXECIO -- used to input and/or output (I/O) data records
  notice the STEM run1. on the EXECIO
run1 is a variable used to store the content of each record
do i=1 to run1.0 -- a loop reading data set records where 0 in run1.0 represents the last record
run1.i -- where value of i represents the current record - an array of records
run1.1 -- is the 1st record where i = 1
run1.2 -- is the 2nd record where i = 2
run1.n -- is the nth record where i = n
parse var -- parse current record assigning variable names to each space separated field in the record

Jump to SDSF STATUS panel from the edit session by entering =sd ; st

Observe JOB P3CH3B is in a HOLD status. Enter a to the left of P3CH3B to release the JCL JOB.

JOB P3CH3B executed the 2nd NETSTAT STATS command writing output to hlq.CH13.OUTPUT(RUN3).

Edit hlq.SOURCE to display the directory of members

Enter ex to the left of NSTATS to execute the REXX program. If you have not changed the REXX code, then you executed the same REXX code used in part 2 challenge 13. The output is written to the TN3270 display. The output is identical to the part 2 challenge 13 output.

Note: Observe the Julian date in the report may not be today. The Julian date is from output captured when you completed Part 2 Challenge 13.

Edit hlq.SOURCE member name NSTATS

Observe the "ALLOC" statements on lines 10 and 58.

  • Part 2 challenge 13 processed hlq.CH13.OUTPUT members RUN1 and RUN2
  • JCL JOBs P3CH3 and P3CH3B created members RUN3 and RUN4
  • Modify the NSTATS REXX program
      change CH13.OUTPUT(RUN1) to CH13.OUTPUT(RUN3)
      change CH13.OUTPUT(RUN2) to CH13.OUTPUT(RUN4)
    f3 to exit and return to hlq.SOURCE directory list

Enter ex to the left of NSTATS and observe report when the program input is CH13.OUTPUT(RUN3) and CH13.OUTPUT(RUN4).

Modify NSTATS REXX program to report only the following:

  • Packets Received for IP Statistics (IPv4)
  • Received Address Errors for IP Statistics (IPv4)
  • Current Established Connections
  •     Reminder: Packets Received and Received Address Errors are in the NETSTAT STATS output twice, once for IPv4 and again for IPv6.
        The report must only include the values for IP Statistics (IPv4)

Again, the objective is to delete unwanted REXX code and leave the REXX code that will write the report above.

The REXX code that writes "** No change" message when network traffic values are the same must also be deleted.

f3 to save changes and return to hlq.SOURCE directory list.

The challenge is exactly the kind of task you might be asked to complete as a new hire in a mainframe technical role.

REXX code syntax:
REXX code CANNOT have line numbers on the far right.
Caution: ISPF Edit primary command RENUM will place numbers in the far right of each line.
How to eliminate lines to the far right of each line:
  enter number off
  enter c p'='  ' ' 72 80 all to remove line numbers from columns 72 thru 80.

Execute ex NSTATS again. Repeat this process until you are satisfied the report meets the requested report criteria.

Helpful Hint:
Approximately half of the NSTATS lines will be deleted.
Do not delete lines testing for IPV6, then skipping 20 records. These lines are required.
If you need to start over, delete all NSTATS lines and copy 'zos.mtm2017.public.clist(ch13)'.

Once the report meets the requested criteria, then enter
tso submit 'zos.public.jcl(p3ch3c)'

JCL job P3CH3C writes the REXX program output to the JES2 spool

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

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

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

  • Another panel is displayed enabling member #03 to be written to P3.OUTPUT as follows:
    BLKS in the Space units field is required

Successful completion will be a valid report in hlq.P3.OUTPUT(#03)

Next: Challenge #04

Application Development Using COBOL
Part Three - Challenge #04

Background:

COBOL manages some of the most critical data and business logic in the world's economy.

COBOL programming language, COBOL compiler optimization, and COBOL runtime performance have over 50 years of technology advancements that contribute to the foundation of world's economy. The core business logic of many large enterprises has decades of business improvement and tuning embedded in COBOL programs.

The point is - whatever you read or hear about COBOL, be very skeptical. If you have the opportunity to work directly with someone involved in writing or maintaining critical business logic using COBOL, you will 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 the decades of changes implemented in COBOL programs. The answer to "How does this business actually work?" can be found in COBOL programs.

Add the following to your awareness of COBOL. It is an absolute myth that you must be at least 50 years old to be good with COBOL. COBOL is incredibly easy to learn and understand. One of the many reasons financial institutions like COBOL, is the fact that it is not necessary to be a programmer to read and understand the logic. This is important because critical business logic code is subject to audit. Auditors are not programmers. However, auditors are responsible for insuring the business financial statements are presented fairly. It is COBOL processing that frequently result in the business ledger updates and subsequent financial statements.

Now for a real world lesson. 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.

It's no secret that lots of banks still run millions of lines of COBOL on mainframes. They probably want to replace that at some point. So why haven't they? Most banks have been around long enough to still feel the pain from the ~1960's Software Crisis. After spending enormous amounts of money, and time, on developing their computer systems, they finally ended up with a fully functional, well-tested, stable COBOL core system.

Speaking with people that have actually worked on such systems, nowadays they have Java front ends and wrappers which add functionality or more modern interfaces, they run the application on virtualized replicated servers, but in the end, everything runs through that single core logic. And that core logic is rarely touched or changed, unless absolutely necessary.

From a software engineering perspective, that even makes sense. Rewrites are always more expensive than planned, and always take longer than planned (ok, probably not always. But often.). Never change a running system etc.., unless very good technical and business reasons exist.

That is real world!

While Part 2 exposed you to COBOL, this challenge will reenforce awareness of COBOL that could prove valuable during your career.

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

The challenge involves 3 COBOL programs with COBOL syntax constructs used by experienced COBOL programmers. Remember the Flour, Sugar, Oil Company? Each of the 3 COBOL programs read 565 Flour, Sugar, Oil Company client profile records. The program objective is to read a different input source that has only the unique customer number and locate the matching detail record from the 565 client profile records.

The 1st COBOL program reads a single customer number, then begins reading the 565 client profile records until finding a match on the customer number. The 2nd COBOL program reads the 565 client profile records and writes all 565 records into an in memory table where each record can be repeatedly searched. The 3rd COBOL program is designed for online interaction to accept a customer's number and return customer details.

The challenge will be to fix a COBOL construct syntax problem in each program and display requested information from the client profile record.

Challenge:

Enter the following to copy the 3 COBOL programs to hlq.SOURCE:
tso submit 'zos.public.jcl(p3ch4)'

Take a few minutes and quickly browse these excellent URLs to help with this challenge

1st COBOL program, FSOC050

Edit hlq.SOURCE member name FSOC050 and observe the following:

  • COBOL program is input to JCL stream that compiles and executes program
  • FILE CONTROL and FILE SECTION describes the program input
  • WORKING-STORAGE describes program variables
  • PROCEDURE DIVISION is the execution logic
  • ACCEPT is a COBOL read statement
  • DISPLAY is a COBOL write statement
  • PERFORM is the COBOL construct for statement sequencing and optionally loop logic
  • READ is the COBOL statement for reading records described by FILE CONTROL and FILE SECTION
  • IF is one of numerous COBOL selection statements
While in edit on hlq.SOURCE(FSOC050), enter the following:
sub; =sd; st

  1. View FSOC050 output
  2. Identify compile problem
  3. Edit hlq.SOURCE(FSOC050)
  4. Correct COBOL syntax problem
  5. Submit
  6. Validate COBOL syntax problem is resolved

2nd COBOL program, FSOC051

Edit hlq.SOURCE member name FSOC051 and observe the following:

  • Review COBOL syntax structure under comment 'CREATE TABLE AND LOAD IN MEMORY'
  • Review COBOL syntax structure under comment 'SEARCH TABLE FOR SPECIFIC CLIENT NUMBER'
      Observe the SET and SEARCH COBOL statements
      Observe ENTRIES variable described in WORKING-STORAGE SECTION
While in edit on hlq.SOURCE(FSOC051), enter the following:
sub; =sd; st

  1. View FSOC051 output
  2. Identify compile problem
  3. Edit hlq.SOURCE(FSOC051)
  4. Correct COBOL syntax problem
  5. Submit
  6. Validate COBOL syntax problem is resolved

After successfully fixing the COBOL syntax problem, then modify the FSOC051 COBOL program to display the following fields from the table for each customer number input. Display the fields in the order listed.

CUSTOMER NUMBER =
CUSTOMER NAME =
CREDIT CARD TYPE =
CREDIT CARD EXPIRATION MONTH =
CREDIT CARD EXPIRATION YEAR =

3rd COBOL program, FSOC052

Edit hlq.SOURCE member name FSOC052 and observe the following:

  • Observe statements under PERFORM UNTIL CUST-NO-SRCH = 'QUIT' loop logic that enable interactive conversation
While in edit on hlq.SOURCE(FSOC052), enter the following:
sub; =sd; st

  1. View FSOC052 output
  2. Identify compile problem
  3. Edit hlq.SOURCE(FSOC052)
  4. Correct COBOL syntax problem
  5. Submit
  6. Validate COBOL syntax problem is resolved

You can validate FSOC052 successful interactive conversation execution as follows:

  1. Jump to ISPF Command Shell panel, =6
  2. Enter ALLOC DA('FSO.CLIENT.PROFILE') FILE(CUSTPROF) SHR REUSE
  3. Enter call load(fsoc052)
  4. Enter 6 digit customer number from 000001 to 000565

After successfully fixing the COBOL syntax problem, then modify the FSOC052 COBOL program to display the following fields from the table for each customer number input. Display the fields in the order listed.

CUSTOMER NAME =

Once the 3 COBOL programs successfully execute with requested modifications, then enter:
tso submit 'zos.public.jcl(p3ch4c)'

If the 3 COBOL programs successfully execute with the requested modifications, then the JCL job, p3ch4c, write output from the execution of the 3 COBOL programs into hlq.P3.OUTPUT(#04)

Next: Challenge #05

Application Development Using Java
Part Three - Challenge #05

Background:

The IBM Z hardware architecture is the best performing environment for Java.

These capabilities include

  • zIIP - dedicated processors for Java workload
  • SIMD - Single Instruction, Multiple Data
  • SIMT - Single Instruction, Multiple Threads
  • SMT - Simulatenous Multithreading
  • CPACF - CP Assist for Cryptographic Function

Java 8 exploits IBM Z new SIMD vector hardware instructions for the Java libraries and numerous frequently used functions. Benchmarks exploiting SIMD vector hardware instructions improved by between 2X and 60X.

In the z/OS environment, the unix shell, JCL, and middleware such as CICS is available to execute Java where Java APIs exist to read from and write to any combination of z/OS data sources.

Java can read and write any z/OS data source. The challenge explores the very powerful Java SQL API and its ability to select, insert and update relational database tables.

A Java driver (JDBC - Java Database Connectivity) enables relational database connectivity capability.

Java program execution requires a JVM, or Java Virtual Machine. The JVM enables java program execution on any operating system without a recompile. The executable java program used in the challenge could be binary transferred to your workstation. Successful workstation execution which returns the result set from the remote relational database to the workstation requires the JDBC driver in the workstation CLASSPATH. If you want to try it, db2jcc.jar, db2jcc_license_cisuz.jar, and favorite.class must be binary transferred to your workstation. The workstation path containing favorite.class and the jar files must be made accessible by the workstation JVM using the CLASSPATH variable. Also, Java must be installed on the workstation.

You are given Java language code to compile. The program connects to z/OS relational database table and processes a SQL statement to count the number of records in the DB2 relational database table.

If you participated in 2016 Master the Mainframe Part 3, you may remember the table used in the challenge. The table required each contestant to insert a record with their favorite color, month, and time of day, dusk or dawn.

Java language constructs:

  • // is a comment line
      comments are helpful
  • { } curly braces identifies a "section" of code with a limited scope
      { some_code }
      { statements }
      { content of a java class }
      { method bodies }
  • ( ) parentheses have 2 purposes:
      control order of operations in an expression
      supply parameters to a constructor or method
  • [ ] square brackets are used to index into an array

Challenge:

Completion of the challenge requires more virtual storage for the TSO session:

  • Re logon to TSO, =x, logon
    when prompted, enter your ID
  • Modify the Size value on TSO/E LOGON panel
      Old
      Size ===> 32786
      New
      Size ===> 327686
Copy java source code from a partitioned data set to a unix file
  ** Be sure to replace z99999 below with your personal ID
  Jump to ISPF Command Shell panel =6 and enter:

oputx 'zos.mtm2017.public.source(favorite)' /z/z99999/favorite.java mode(700)

Start a z/OS Unix shell, enter:
omvs

From the z/OS Unix shell prompt enter:
ls
The favorite.java file should be listed

Edit favorite.java unix file as follows:
oedit favorite.java

Quickly review the Java source, then exit edit session
f3

Compile favorite.java as follows:
javac favorite.java

Compile of favorite.java creates favorite.class, a JVM executable.
Invoke the JVM environment and execute favorite.class as follows:
java favorite
Note: You may need to press enter key a 2nd time for results to be written to display

The Java program displays the following:
Total number of records = 1061

Completion of the challenge is to modify favorite.java to display each specific color total using a SQL statement operand
WHERE COLOR = 'the specific color'.

The display format with a total count for each color must be as follows:

Total number of records = 1061
Total number of red     = 
Total number of blue    = 
Total number of green   = 
Total number of purple  = 
Total number of orange  = 
Total number of yellow  =
Total number of white   =
Total number of black   = 

Hints:

  • Observe java while loop statement following the SQL statement is returning each line from the SQL statement execution.
  • Execution of additional SQL SELECT statements can be accomplished by replicating a "section" of java code.
  • Variables rs1 and sql1 are used for SQL statement execution and storing the result set from table MTM2017.FAVORITE.
  • Use different variables, such as rs2 and sql2, to execute, store, and print additional result sets.
  • Include rs#.close() for each new SQL query before }catch(SQLExpection se),
  • Try getting result set for one color first, then the other colors.
Once the java program displays the requested report, then enter the following to execute the java program and redirect the output to a unix file with file name result:
java favorite > result

Copy the result unix file name to hlq.P3.OUTPUT(#05) as follows:
cp result "//p3.output(#05)"
exit, then enter to return to ISPF panels.

Review of hlq.P3.OUTPUT(#05) should contain the requested output.

Note: The output record format only needs 1 space between each word, the = symbol, and the total to get credit.

Next: Challenge #06

In the event an original copy of favorite.java is needed to start over:

Copy java source code from a partitioned data set to a unix file
  ** Be sure to replace z99999 below with your personal ID
  Jump to ISPF Command Shell panel =6 and enter:

oputx 'zos.mtm2017.public.source(favorite)' /z/z99999/favorite.java mode(700)
Application Development Using C/C++
Part Three - Challenge #06

Background:

C and C++ can be compiled and executed using either JCL or Unix System Services shell. C and C++ in the z/OS environment can read, write, and update any of the z/OS data sources. The IBM z/Architecture enables z/OS XL C/C++ development of high-performing business applications.

The challenge is designed to demonstrate z/OS flexibility with C and C++ programs.

Your participation in Part 3 enables you to claim z/OS experience. A detail of claiming z/OS experience is the ability to locate the professional documentation related to any specific z/OS technical discipline. Below is the URL for the IBM z/OS XL C/C++ professional documentation.

z/OS XL C/C++ Professional Documentation

Challenge:

Review the C program source code in the wikipedia URL that follows:
wikipedia C program example

The C program source was pasted into a z/OS data set member to be used in the challenge.

Brief description of the example C program syntax
  • #include stdio.h includes functions involving file input and output
    stdio.h
    fopen, fclose, fputs, getc used in the program is available from header, stdio.h
  • #include stdlib.h includes functions involving memory allocation, process control, conversions, etc.
    stdlib.h
    int used in the program is available from header, stdlib.h
  • char buffer[5] allocate memory for a character array of 5
  • for loop is getting 5 characters, getc, and writing each character to buffer[i]
      where the i in buffer[i] is 1 thru 5
  • printf writes the hexadecimal, %x, value for each character in the respective buffer[ ] array

The challenge will compile the C program into a unix file executable, then again compile the C program into an MVS data set member executable. Just wanted you to know that z/OS flexibility makes it possible to copy the executable between unix and MVS data sets without the need to recompile.

FYI - It is possible to cut and paste the commands in most cases.

Review hlq.P3.OUTPUT(#06) to verify C1 output exists.

If struggling with compile errors:

Next: Challenge #07

Application Development Using Assembler
Part Three - Challenge #07

Background:

Assembler = Speed.

There are a number of cases in large enterprises where speed is paramount over ease of programming. There may not be many assembler programs. However, any assembler program supporting large enterprise business applications are most likely extremely critical to the enterprise.

Learning assembler language programming is not easy and requires lots of practice. However, if you like the technical details of how computers really work and you want a technical skill that can separate you from other computer technicians, then developing assembler skills provides both.

The challenge will expose you to assembler language in the IBM Z environment. A subsequent challenge will provide a bit more detail about assembler in the IBM Z environment.

Challenge:

Upon successful execution, assembler code compile and execution prints "Hi! I can count fast", then will loop 10 times adding 1 to a total and printing each new total value.

  1. Edit hlq.SOURCE
  2. Select member asmpgm - s asmpgm
  3. copy 'zos.mtm2017.public.source(asmpgm)'
  4. sub; =sd; st

Review of JCL job output shows reason for compile failure and subsequent execution failure.

The compile fails with a minor syntax problem. You do not need to be an experienced assembler language programmer to correct the compile problem. Correction requires review of the source code pattern to identify a mismatch where the issue is a matter of a misspelling. The compiler output error message, ASMA044E, will provide a big hint. Focus on the assembler label associated with "Hi! I can count fast" near the bottom of the source on a DC (Define Constant) instruction. Then look for an MVC, Move Character, instruction which moves those characters to an area that is printed using an assembler PUT statement.

What is an "assembler program label"?

An assembler program label is a programmer selected name starting in column 1. When the program is compiled the label is translated into an address referencing that location in the code, also known as the program "offset" from the beginning of the program instructions.

Once the minor assembler code problem is fixed, then P3.OUTPUT(#07) will write:
Hi! I can count very fast.
00000001 
00000002 
00000003 
00000004 
00000005 
00000006 
00000007 
00000008 
00000009 
00000010 			

edit source(asmpgm) and modify the in-stream source code to successfully compile and execute.
  enter hilite asm to hilite assembler reserved words

submit and review JCL job output and P3.OUTPUT(#07) for success.

Next: Challenge #08

z/OS Storage Administration
Part Three - Challenge #08

Background:

An enterprise z/OS environment has thousands of disk volumes and thousands of tape volumes. These thousands of disk volumes and tape volumes are capable of storing millions of data sets.

A critical z/OS base component is DFSMS, Data Facility Storage Management Subsystem. The contest challenge will only scratch the surface of DFSMS. The fact that you are even aware of DFSMS as a critical z/OS component would impress any perspective employer.

DFSMS is a very broad category of data management technology that far exceeds data management services in other operating systems.

The Storage Management Subsystem (SMS) is part of DFSMS. SMS changes the storage management approach from user-managed volumes to SMS-managed data sets residing in SMS-managed storage groups. The system, rather than the user, determines data placement and handles data backup, movement, space, and security.

SMS provides the following storage classes and groups, which are customized by the storage administrator to fit the system environments and policies:

  • Data class: A list of allocation attributes that the system uses for the creation of data sets.
  • Storage class: A list of storage performance and availability service requests.
  • Management class: A list of data set migration, backup, and retention attributes that DFSMShsm uses to manage storage at the data set level.
  • Storage group: A list of real DASD volumes, or a list of serial numbers of volumes that no longer reside on a system but that end users continue to refer to in their JCL.

Storage administrators also customize SMS automatic class selection (ACS) routines, which automatically assign the SMS classes and storage groups to data sets. This allows the user to create data sets by providing only a small amount of information through ISMF panels.

ISMF, Interactive Storage Management Facility, are panels available to a storage administrator to assist with managing and monitoring disk storage capacity. ISMF is a manadatory skill for z/OS Storage Administrators.

This challenge exposes you to Storage Management Subsystem (SMS). This knowledge will begin to qualify you as a disk administrator candidate. If you were to interview for a large enterprise disk storage administrator position, the hiring authority would be impressed that you would have this knowledge.

SMS significantly simplifies JCL through implemented standards. An example is system customization that has data set name rules for new data set allocations. The challenge demonstrates system implemention of data set name rules for newly allocated data sets that ONLY require data set name and disposition of new on the JCL DD statement. The system customization results in determining data set volume placement, data set attributes, and data set space. Without this SMS customization, a newly allocated data set requires volume, attributes, and space values on the JCL DD statement.

Challenge:

  1. Edit hlq.JCL
  2. Select new member name, p3ch8
  3. Copy JCL into empty member name
  4. Observe the member has 2 JCL jobs that are nearly identical with data set name exception
    Submit the 2 JCL jobs and jump to SDSF to review output
  5. Review the JCL job output
  6. Observe JCL job P3CH8A messages in JESYSMSG about failure to allocate data set with 2nd data set qualifier of NEWDS
  7. F3 to return to SDSF ST panel, ? P3CH8B, and select JESYSMSLG
    Observe JCL job P3CH8B messages in JESYSMSG that successfully allocated data set with 2nd data set qualifier of SEQ
  8. The above output has message IGD101I which means this new allocation was handled by Storage Management Subsystem (SMS).
      The message referenced STORCLAS(MTMSEQ) and DATACLAS(MTMSEQ) - whatever that means
      The message referenced a disk volume where the data set was placed, MTM004
      Explanation follows

SMS is configured, customized, and maintained by the Storage Administrator. The configuration and customization are agreed upon storage rules which would be documented and shared with the IT staff for their use. A storage rule on this system is that any data set name with a 2nd data set name qualifier of SEQ is assigned data set attributes, data set space, and a volume where the data set will be allocated.

z/OS data set allocation processing rules enforced by SMS configuration and customization consist of control data sets and processing logic. The control data sets are VSAM data sets used to define resources such as MTMSEQ associated with data set attributes and space. The processing logic is known as the SMS Automatic Class Selection (ACS) routines. The logic is interpretitive script language stored in partitioned data set members.

SMS Control Data Sets sections include:

  1. Data Class definitions
  2. Storage Class definitions
  3. Management Class definitions
  4. Storage Group definitions

SMS Control Data Sets also store the partition data set names and member names of the ACS routine processing logic.

Automatic Class Selection (ACS) routine processing logic includes:

  1. Data Class processing logic
  2. Storage Class processing logic
  3. Management Class processing logic
  4. Storage Group processing logic

ISMF, Interactive Storage Management Facility, panels are available to review the SMS Control Data Set defintions and Automatic Class Selection (ACS) routines which is the processing logic.

  1. Select ISMF panels from ISPF Primary Option Panel
  2. Select Option 4 - Data Class
  3. 'ACTIVE' CDS name, Control Data Set, are DATA CLASS definitions actively used by the system.
    The asterisk (*) is to list all Data Class definition entries.
    ENTER to proceed through ISMF panels.
  4. The list of DATA CLASS entries includes many columns with the defined attributes for the entry.
    Observe the Data Class definition for MTMSEQ with RECFM (FB), LRECL (80), AVGREC (K) and AVG VALUE (1)
    Enter view command below to include only columns 4 5 12 26 and 46.
  5. Observe the MTMSEQ DATA CLASS definition with the blank DATA SET NAME TYPE.
      Blank defaults to a sequential data set name type.
      OVERRIDE SPACE value of YES means SMS discards any JCL DD SPACE value and SPACE is determined ONLY by what is in this DATA CLASS definition.
      F3 until back at the ISMF PRIMARY OPTION MENU.
  6. Select 0 - ISMF PROFLE
  7. Select 0 - User Mode Selection
  8. Change User Mode from 1 (End User) to 2 (Storage Administrator)
      ENTER after typing in the mode change
      F3 until back to ISPF Primary Option Menu - required for setting to take effect
  9. Again, select ISMF panels from ISPF Primary Option Panel
  10. Observe more options now that User Mode was changed to Storage Administrator
      Select option 7 - Automatic Class Selection
  11. Select 5 to Display data set name and member names of the ACS processing logic
  12. Observe:
      ZOS.PUBLIC.SMS.ROUTINES is the "source" data set name for the ACS routines
      ACSSTORD is the member with DATACLAS processing logic
      ACSSTORC is the member with STORCLAS processing logic
      ACSSTORG is the member with STORGRP processing logic
      F3 until back to the ISPF Primary Option Menu
  13. Jump to Data Set List Utility panel
  14. Enter data set name where ACS processing logic members are located
  15. Browse b the partitioned data set with the ACS processing logic members
  16. Select s each member to see the ACS processing logic
  17. This is what SMS Automatic Class Selection processing logic looks like
    F3 to move on to the next selected member
  18. DATA CLASS ACS routine, ACSSTORD, and the DATA CLASS definition, MTMSEQ, is the reason why newly allocated hlq.SEQ.TEST only required the data set name and the disposition of new, catalog on the JCL DD statement when hlq.NEWDS.TEST failed to allocate

    Observe IF &DSN(2) = 'SEQ' THEN SET &DATACLAS='MTMSEQ'

    SMS saw the data set name 2nd level qualifier, SEQ, and applied the data set attributes from the SMS DATA CLASS definition, MTMSEQ

    Previously panels displayed MTMSEQ DATA CLASS definition as a sequential data set type with other data set attributes such as space, etc.

    F3 to proceed to next ACS member
  19. ACSSTORG, Storage Group, ACS processing logic assigns the physical volumes for allocation.   MTM is a STORAGE CLASS definition that has disk volumes labels to be used for all allocations assigned to STORGRP 'MTM'.

    F3 until back to ISPF Primary Option Menu.

You just completed a review of SMS and ISMF that IT professionals attend a several day professional training class to acquire knowledge on. You are prepared to work with an experienced z/OS Storage Administrator armed with comprehension of SMS and ISMF.

The details you just reviewed has the technicals details to accomplish a simple task to complete this challenge.

  • Edit hlq.JCL member name P3CH8
  • Delete lines 4 to 7
  • Change line 3 data set name middle level qualifier from NEWDS to a middle level qualifier that will be processed by SMS environment to allocate a new partitioned data set with only the DSN=data_set_name and DISP=(NEW,CATLG) in the the JCL DD statement
  • Submit and review output until successful new partitioned data set is allocated with only the data set name and DISP=(NEW,CATLG)

Once the above is completed, then tso submit 'zos.public.jcl(p3ch8x)' to write a list of your data set names into P3.OUTPUT(#08) which includes the newly allocated partitioned data set name.

Next: Challenge #09

z/OS Security Administration
Part Three - Challenge #09

Background:

Security Administration roles and security best practices have always been critical. The internet and subsequent self serve capabilities enabled the public's indirect access to critical data sources, such as a bank account. As a result, the intense focus around security has increased. Audit functions and automated monitoring with the ability to take action based upon suspect behavior are also critical. The security administrator will typically conduct audit functions in an attempt to find and address issues. Official auditors conduct regularly scheduled reviews.

IBM Z mainframes have security and data encryption capability beyond other servers. The most significant security issue is sloppy procedures, practices, and inadequate audit reviews.

z/OS is not difficult to understand. However, the vast majority of z/OS technical capabilities in most production environments are nearly impossible to understand as a result of security policies. High z/OS security is a matter of need to know to complete responsibilities. Therefore, access is only permitted to resources that an employee must have and no more. The reason is to mitigate risk where the insiders cannot be trusted as a general practice.

z/OS Resource Security covers data, program execution, transaction execution, network traffic, and more. RACF, Resource Access Control Facility, is available to provide z/OS Resource Security.

The challenge involves:

  1. Allocation of 3 protected data set names
  2. RACF command to list data set name RACF protection information
  3. RACF command to add a fully qualified generic data set name profile with a universal access of none
  4. RACF command to add a fully qualified generic data set name profile with a universal access of read
  5. RACF command to permit a single ID to read fully qualified generic data set name profiles with a universal access of none
  6. RACF command to list RACF protection modifications to the 3 newly allocated data set names

Terminology:

  • RACF Generic data set profile - includes generic characters (%,*,**)
  • RACF Discrete data set profile - is the full data set name without any generic characters
  • RACF Fully qualified generic data set profile - is the full data set name without any generic characters and using the GENERIC keyword on RACF commands

Use of fully qualified generic data set profiles are a best practice over discrete data set profiles because a discrete data profile is deleted when the data set is deleted. A fully qualified generic data set profile is retained when the data set is deleted. If the identical data set name is allocated, then protection characteristics of the existing fully qualified generic data set profile are applied.

RACF commands used in the challenge are:

  1. LISTDSD (LD) - list RACF data set profile
  2.     Finding out how a data set is protected
  3. ADDSD (AD) - add RACF data set profile
  4.     ADDSD (Add data set profile)
  5. PERMIT (PE) - modification of RACF data set profile
  6.     Permit (Maintain resource access lists)
        Permitting an individual or a group to use a data set
  7. DELDSD (DD) - delete RACF data set profile (if needed)
  8.    DELDSD (Delete data set profile)

Challenge

Jump to ISPF Command Shell panel, =6

Enter ld da(**) all
  The output of the above command is equivalent to ld da('hlq.**') all where hlq is the high level qualifier - your ID
  All your personal data sets are protected by this generic data set profile
  Observe your generic data set profile has a UNIVERSAL ACCESS of NONE
  This means ACCESS authority to your data sets is NONE, except the owner, you

submit 'zos.public.jcl(p3ch9)'

Review the output for successful completion

P3CH9 allocated 3 new data sets:

  • hlq.SEQ.HIGH.PRIVACY
  • hlq.SEQ.SEMI.PRIVACY
  • hlq.SEQ.PUBLIC

From the ISPF Command Shell, =6

  1. ADD a fully qualified generic data set profile with universal access (none), warning, and notify for hlq.SEQ.SEMI.PRIVACY
  2. PERMIT ID AUDIT01 read access to hlq.SEQ.SEMI.PRIVACY
  3. ADD a fully qualified generic data set profile with universal access (read), warning, and notify for hlq.SEQ.PUBLIC

For example, you can list any of your RACF data set profiles using the following:
ld da(dataset_profile) all
or for a simple list
search mask(z#####) class(dataset)
  where your id should replace z#####

Once you successfully created the 2 RACF fully qualified generic data set profiles according to above instructions, then
submit 'zos.public.jcl(p3ch9x)'
The above writes your RACF data set profiles to P3.OUTPUT(#09)

If you need to delete a fully qualified generic data set profile -
dd 'fully.qualified_data_set_profile'
However, DO NOT delete your generic data set profile, hlq.**

If you accidently delete your generic data set profile -
ad ** uacc(none)

Next: Challenge #10

Relational Database Administration (DB2 for z/OS)
Part Three - Challenge #10

Background:

Relational Database Management Systems (RDBMS) are used to manage a massive amount of data being simultaneously accessed by thousands of people, devices, and other applications.

Structured Query Language (SQL) is the common relational database programming language. Once you have learned to use SQL, the knowledge directly applies to other relational database management systems.

Understanding SQL is the foundation for learning any relational database management system.

A popular z/OS RDBMS is DB2

There are 4 categories of SQL:

  1. DML -- Data Manipulation Language
    • SELECT, UPDATE, INSERT and DELETE (CRUD applications)
  2. DDL -- Data Definition Language
    • CREATE, ALTER and DROP data base structures (DB architecture)
  3. DCL -- Data Control Language
    • GRANT and REVOKE privileges (security)
  4. TCL -- Transaction Control Language
    • COMMIT and ROLLBACK work

While DML and TCL are the primary SQL categories used by developers, DDL and DCL are the primary SQL categories used by the Database Administrator, DBA.

Here are some excellent sources to learn the capabilities of SQL applied to all relational database management systems:

DB2 for z/OS SQL can be executed a variety of ways:

  • Programming Language APIs
  • ISPF panels
  • JCL
  • A variety of eclipsed based GUI tools
  • FTP

You might recall using JAVA programming language API to access the DB2 for z/OS favorites table in a previous challenge.

The z/OS DB2 DBA has numerous responsibilities which include:

  • Knowledge of DB2 features and functionality
  • Tasks related to database design and implementation
  • Tasks related to operation and recovery
  • Security and auditing
  • Performance
  • Installation and migration/upgrades specific to the z/OS operating system

A DB2 for z/OS DBA needs specialized knowledge about z/OS learned in previous challanges such as VSAM, Virtual Storage Access Method, SMS, Storage Management Subsystem, and the System Catalog.

DB2 for z/OS Data Structures:

  1. Storagegroup - a name associated with a collection disk volumes
  2. Database - a name associated with a collection of DB2 tablespaces and indexspaces
  3. Tablespace - VSAM Linear Data Set formatted to contain DB2 tables
  4. Table - a name to reference the rows and columns of DB2 controlled data in a tablespace
  5. Indexspace - VSAM Linear Data Set formatted to contain an index for a DB2 table
  6. Index - a name to reference the indexed data for DB2 table access

The following is a diagram of DB2 for z/OS Data Structures.

A few potentially confusing DB2 for z/OS words are Storage Group and Catalog.

  • SMS can define storage group names where the SMS storage group name is a collection of disk volumes labels for new data set allocations.
  • DB2 can create storage group names where the DB2 storage group name is a collection of disk volume labels exclusively for new DB2 tablespace and indexspace allocations without any dependency on SMS.
  • If a DB2 storage group name volume label is asterisk *, then DB2 is told that SMS ACS routine will manage new allocations and use SMS storage group defined volume labels for new DB2 tablespace and indexspace allocations.
  • z/OS has a Master Catalog and numerous User Catalogs containing data set names and a disk volume label for each data set name.
  • DB2 has its own Catalog. The DB2 Catalog is a manifest of the DB2 controlled resources, e.g. metadata which is data about data such as connecting DB2 table name with a DB2 tablespace name and finally a z/OS VSAM data set name.
  • However, DB2 uses the z/OS Master Catalog and User Catalogs for locating the VSAM data set names that are DB2 controlled tablespaces and DB2 indexspaces.

Relationship between DB2 and VSAM data set names

  • A DB2 DDL CREATE TABLESPACE statement results in new allocation of a VSAM Linear Data Set (LDS).
  • The DB2 formatted VSAM LDS name has a specific data set name pattern.
    1st DSN qualifier , a.k.a High Level Qualifier (HLQ), is determined by a VCAT operand on a DB2 DDL create statement.
    2nd DSN qualifier for the VSAM cluster is always DSNDBC.
    3rd DSN qualifier for the VSAM cluster is the DB2 data base name. The DB2 database name is just a name that represents a collection of tables in tablespaces.
    4th DSN qualifier for the VSAM cluster is an abbreviated 8 characters associated with a tablespace name or indexspace name. The DB2 Catalog keeps a cross reference of the abbreviated 8 characters in the VSAM cluster data set name and the full tablespace or indexspace name.

DDL steps used by a DBA to create a DB2 database table follows:

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

Submit JCL to allocate hlq.SQL data set with members and copy member DB2LOAD into hlq.JCL as follows:

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

DDL illustrating the above steps is available in the References drop down with title of DB2 Example. The document includes JCL to run a DB2 utility to load data into a newly allocated DB2 table, then a series of DB2 SELECT statements to extract result sets from the data loaded in the DB2 table.

The DB2 Example in the References drop down is a model for accomplishing the challenge.

Challenge:

  1. Create a tablespace using an existing DB2 storage group name (MTM2017), database name (MTM2017), and VCAT name (MTM2017)
      While unnecessary, for convenience MTM2017 was used for all 3 names as seen in example
  2. Create a table in tablespace previously created
  3. Create an indexspace and index for the table previously created
  4. Use DB2 utility to load data into the new DB2 table and index
  5. Use DML SELECT statements to verify new table and index
  6. Locate the z/OS VSAM LDS cluster names associated with the newly created tablespace and indexspace

DB2 Example in References drop down walks you through learning the steps necessary to complete the challenge.

The challenge is to create a tablespace, table, indexspace, index, then load the new table and index using a different data using challenge details that follow.

Challenge Details:
  • Client data is from the Flour, Sugar, Oil Company located in data set name FSO.CLIENT.PROFILE
  • Use S##### as the tablespace name - where ##### is 5 numeric digits of your ID
  • Use T##### as the table name - where ##### is 5 numeric digits of your ID
  • Use X##### as the indexspace name - where ##### is 5 numeric digits of your ID
    NOTE: You must DROP TABLESPACE S##### if you previously used that name while executing the example instructions.
      See line 1 and 2 in SQL(STEP2)
  • Browse b FSO.CLIENT.PROFILE and enter cols to see column ruler to verify the following:
      New table layout where table column names are in UPPERCASE in parenthesis:
      1) Column 1-6 .....unique client number (CID) and the DB2 primary key for the index
      2) Column 7-41 ....client name (CLIENT)
      3) Column 42-66 ...client street address (STREET)
      4) Column 67-77 ...client city (CITY)
      5) Column 78-79 ...client state abbreviation (STATE)
      6) Column 80-83 ...client credit card type used for payment (CARD)
      7) Column 84-85 ...client credit card expiration month (MO)
      8) Column 86-87 ...client credit card expiration year (YR)
      9) Column 88-106 ..client credit card primary account number (PAN)
    CID is the DB2 table Primary Key
    All the above columns are data type of CHAR with column attribute NOT NULL

Modifications to SQL members STEP2, DB2LOAD JCL member, and SQL member STEP4 can be used to complete the challenge.

Last step to get full credit for completing challenge 10:

  1. Edit JCL data set
  2. Select new member name p3ch10x
  3. Copy 'zos.public.jcl(p3ch10x)' into new member p3ch10x
  4. Modify JCL embedded SQL SELECT statements using COUNT function to:
    • Count total number of records in your table
    • Count total number of records WHERE the CARD is VISA
    • Count total number of records WHERE the CARD is MSTR
    • Count total number of records WHERE the CARD is AMEX
    Note: Each SELECT statement in the JCL must terminate with a semi-colon (;)
  5. Submit JCL(P3CH10X) to write requested result sets from your new DB2 table to P3.OUTPUT(#10)

Browse or View P3.OUTPUT(#10) and verify information you expected, then move on to the next challenge!

Next: Challenge #11

System Programming (Application Development Procedures)
Part Three - Challenge #11

Background:

A System Programmer does not know it all. However, they get very good at knowing which professional manuals to reference and figuring things out. The more they are required to figure out, the more effective they are in their System Programmer role.

DevOps is a popular clipped compound that emphasizes the collaboration and communication between business application developers and other IT professionals where Dev represents development and Ops represents other IT professionals that setup up and maintain the environment used by development. The other IT professionals include z/OS System Programmers. This relationship has existed for many decades in the mainframe environment, long before the DevOps clipped compound was introduced. An objective of DevOps is a standard way for all organizations to approach the plan, build, and run, of the development process with standardized procedures, practices, and tool sets. The primary objective of DevOps is to speed up delivery of applications and new application features through continuous integration (CI) and continous delivery (CD).

DevOps tool sets are software products based upon "Eclipse IDE, Integrated Development Environment" which is a workstation GUI, Graphical User Interface. IBM Z DevOps tool set is IDZ, IBM Developer for Z (formerly call RDz, Rational Developer for z). Prior to the GUI tool sets used by developers to interface with z/OS, the TN3270 TSO/ISPF environment was the primary development interface. The GUI interface makes the underlying mechanics of navigating z/OS transparent to the developers while meeting the objective of DevOps. However, someone must understand and maintain the underlying mechanics critical to the DevOps GUI tool sets.

Developers (Dev) are dependent upon procedures created and maintained by System Programmers (Ops) when the target system of development is z/OS. An example would be an IDE graphical user interface with a click selection to compile a COBOL program using a DB2 table as a data source. All the developer knows is how to make a GUI click selection where the result is the z/OS executable program to test.

The z/OS technical plumbing to build the z/OS executable program needs to be developed. A z/OS System Programmer would create and support the technical plumbing enabling a simple GUI selection. What occurs as a result of the GUI selection is totally tranparent to the developer.

The challenge explores the technical plumbing to make a developers job easier, enabling the developer to deliver applications quicker.

Challenge:

Things you currently know as the System Programmer to accomplish the challenge:

  • IDE GUI selection to compile COBOL source with DB2 table data source executes a JCL procedure to build the program executable
  • Sample JCL PROCs are provided by IBM. Local customization of the JCL PROCs were completed and successfully being used by the developers
  • The JCL PROC is in a Production JCL procedure library, VENDOR.PROCLIB, and the member name is CBLDB2

A developer reports a problem with the following details:

  • No program executable is available to test following selection to build executable
  • IDE GUI reports no COBOL syntax errors prior to selection to build executable

A System Programmer learns to get as many details as possible from the person reporting the problem, then applies knowledge of the z/OS environment that might be related to the problem to begin to define the real problem based upon the known symptoms.

The developer reports, "my computer did everything correctly. Your computer must have a problem with what my computer requested to be done". That is the extent of the developers technical knowledge to help you.

You ask the developer to select the compile from the IDE GUI for you to observe z/OS activity and problem symptoms.
You looked at the z/OS system log for activity as a result of the developer workstation request to compile.
For this challenge, you only need to review the steps the System Programmer took to isolate the problem. No action is needed by you until instructed.
The following actions were taken by the System Programmer:

Review of the z/OS System Log from SDSF in Figure 1. shows CBLDB2 JCL job submitted as a result of the developer, Z99999, requesting a COBOL compile from the IDE
Figure 1.
The system programmer, you, has the authority to view all JCL job output. Observe SDSF settings in Figure 2.
Figure 2.
CBLDB2 JCL job is selected to view output in Figure 3.
Figure 3.
CBLDB2 JCL job shows the LKED PROCSTEP with RC of 08 in Figure 4.
Figure 4.
? shows CBLDB2 DDNAMEs and ProcSteps
Figure 5.
Select of DDNAME SYSPRINT ProcStep LKED to see more details about RC 08
Figure 6.
Figure 7 shows the error. CLRSCN is unresolved - whatever that really means
Figure 7.
Figure 8. selects COBOL compile output view the source code
Figure 8.
Figure 9. show a find for CLRSCN anywhere in the COBOL compile listing
Figure 9.
Figure 10. finds a COBOL CALL of module "CLRSCN". This is a very significant problem symptom that resulted in the RC 12. You, the System Programmer, have information about this module "CLRSCN" that will be explained later.
Figure 10.
Figure 11. is a select of the CBLDB2 JESJCL to see exactly what was executed
Figure 11.
Figure 12. shows JCL job CBLDB2 is executing a JCL PROC, EXEC CBLDB2, that has the same name as the JCL job
Figure 12.
Figure 13. JESYSMSG shows JCL PROC library where CBLDB2 JCL procedure was found
Figure 13.
Figure 14. shows the JCL procedure, CBLDB2 was found in VENDOR.PROCLIB
Figure 14.

VENDOR.PROCLIB member CBLDB2 is one of the most complex JCL procedures.
Figure 15. is a diagram of the JCL CBLDB2 PROC which you are not expected to understand to complete the challenge.
However, references will be made to Figure 15.

Figure 15.

More things you know as the System Programmer

  • Developers were given executable module names to be called to provide local functions
  • CLRSCN was one those modules. CLRSCN will clear a screen during interactive processing
  • CLRSCN executable module is in data set name LVL0.LINKLIB
  • The Linkedit step in JCL PROC CBLDB2 is responsible for finding a "called" module
  • Linkedit step result was RC 12 due to failure to find CLRSCN
  • CBLDB2 JCL PROC linkedit step has JCL stepname of LKED
  • SYSLIB DDNAME concatenation in CBLDB2 LKED step must include LVL0.LINKLIB to resolve the problem

Take the following actions to recreate the problem using a private copy of the source, JCL, and JCL PROC:

  1. tso submit 'zos.public.jcl(dbrmlib)'
      Above JCL allocates a personal DBRM Module library as seen in Figure 15.
  2. Edit hlq.SOURCE data set
  3. Select s new member name db2fso
  4. Copy 'zos.mtm2017.public.source(db2fso)'
  5. Learning System IDs Only (AU0####), click on link below for special instructions.
    Learning System ID special instructions for this challenge.
  6. Change c all occurrences of ##### to last 5 digits of your ID
  7. F3 to save and exit
  8. Edit hlq.JCL data set
  9. Select s new member name CBLDB2
  10. Copy 'vendor.proclib(cbldb2)'
  11. F3 to save and exit
  12. Select s new member name CBLDB2J
  13. Copy 'zos.public.jcl(cbldb2)'
  14. Modify the JCL to reference the private JCL PROC previously copied into hlq.JCL member CBLDB2
    Insert line and enter the JCLLIB statement as seen below
    The reason is for EXEC CBLDB2 to reference private JCL PROC library to load CBLDB2 JCL PROC from your personal JCL library
  15. Submit, jump to SDSF status panel
  16. Select the CBLDB2 JCL job you just submitted
  17. The output shows your just recreated the RC 08 problem in LKED step
  18. Edit hlq.JCL
  19. Select the JCL PROC, CBLDB2
  20. Find the LKED step in the JCL PROC
  21. If done correctly, the action here will fix the problem
      Observe line 53 is the SYSLIB DDNAME
      All DD statements following SYSLIB DDNAME without any DDNAME belongs to the SYSLIB DDNAME concatentation
      The SYSLIB DDNAME concatention is searched for "called" modules
      LVL0.LINKLIB must be added to the SYSLIB DDNAME concatention
      Insert a line immediately after line 55
      Add data set name LVL0.LINKLIB in the SYSLIB DDNAME concatenation
      Remember to include DISP=SHR on the DD statement - mandatory for successful completion
      F3 to save and exit
  22. Submit the CBLDB2J JCL job located in hlq.JCL to test the change to the CBLDB2 JCL PROC
  23. Use SDSF to select the output of JCL job just submitted
  24. If CBLDB2 JCL PROC fix was successful, then LKED show RC 00
      BIND PROCSTEP of RC 04 is ok and expected
      If the JCL job fails, then correct hlq.JCL(CBLDB2) JCL PROC and try again
  25. A double check to verify success is to execute the compile program
      Jump to the the ISPF Command Shell =6
    dsn system(dbbg) starts a DB2 interface environment
  26. Once in the DB2 (DSN) environment
      Enter run prog(db2fso) lib(load) plan(z#####a) where ##### is your 5 digit ID number
      If you review Figure 15. Run box, that is what is being done below
  27. The successfully compiled program DB2FSO, begins execution
  28. Enter a valid 6 digit client number such as 000222
  29. The client number 000222 company name and credit payment information is displayed
  30. Enter 000000 to stop the program, then enter end to terminate the DB2 environment

The DB2FSO program could easily be a service for authorized employees to retrieve this information on their smartphone and to invoice the client immediately upon the delivery of the flours, sugars, and oils that were previously ordered by the client.

To get credit for the competion of challenge 11, submit the following:
tso submit 'zos.public.jcl(p3ch11)'
The JCL job writes information to P3.OUTPUT(#11) proving the challenge was completed.

Next: Challenge #12

Systems Programming (SMP/E)
Part Three - Challenge #12

Background:

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

A systems 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 systems programmer:

  • develops operational procedures
  • develops systems administration procedures
  • develops application development procedures
  • assists systems 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

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 Systems 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 Systems 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 Systems Programmer.

Overview of SMP/E Terminology

  • LMOD
      SMP/E terminology for load module
      Load modules are created by combining one or more object modules and processing them with a link-edit utility
  • 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 and called SYSMOD by SMP/E
      Note: Other SMP/E elements exist, but understanding MAC, MOD, and LMOD will make learning about the other SMP/E elements pretty easy.
      The challenge is limited to SMP/E elements, MAC, MOD, and LMOD
  • 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 software "received"
  • APPLY
      SMP/E command to update SMP/E CSI data sets with SYSMODs previously received
    Target Zone stores information about software "applied"
    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 software "accepted"
    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


  • 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
  • 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
  • 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
  • USERMOD
      Customer modification to the z/OS environment such as local system exit
  • 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

The challenge uses ISPF print screen. Therefore, you need to modify your ISPF defaults as follows:

From Log/List drop down, select 2 - List Data set defaults

Select 4 to Keep data set and allocate new data set

From Log/List drop down, select 3 - List Data set characteristics

Select 1 - Record Format FBA, then Logical record length 80 and Line length 80

Challenge:

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

The 2016 Master the Mainframe Contest SMP/E challenge used JCL only to locate information about an active system module. 2017 challenge will use interactive panels only. The point is that either JCL or panels can be used to interact with the SMP/E Consolidated Software Inventory, CSI, environment.

Challenge situation - a system problem just came to your attention

A system element, BPXFSMKN, was involved with a reported system issue. You need to find out more about BPXFSMKN. The challenge is to use the SMP/E Dialog Panels to learn more information about this element.

The challenge does NOT provide any screen shots. Follow the instructions below to complete the challenge.

  1. Enter SM from ISPF Primary Option Menu to display the SMP/E Dialog Panels
      F3, exit, the initial tutorial
  2. Tab to SMPCSI DATA SET field, type 'MVS.GLOBAL.CSI', tab back to top command input, enter 3 (Query)
      IEC331I and IEC251I messages can be ignored
      Reason for messages are the CSI data sets are READ ONLY
  3. Enter 1 (CSI Query)
      If you want to learn a lot more about SMP/E, F1 (Help) on this panel
  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
      BPXFSMKN is the ENTRY NAME
  5. CSI QUERY - SELECT TYPE panel display the found ENTRY TYPE
      Select s the ENTRY TYPE
  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
      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
      Enter print to print screen to data set
      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
      Observe location of LMOD is LINKLIB (which is SYS1.LINKLIB)
  9. Enter L on the command line to display link-edit data
      Observe module has numberous alias names
      Enter print to print screen to data set
  10. Enter =x to return to ISPF Primary Option Menu
      Enter x to exit ISPF session
    Note message - hlq.S0W1.SPF#.LIST has been kept. - where # is a system selected number
  11. Enter ispf
      Enter 3.4
      Enter hlq.S0W1.SPF#.LIST in the Dsname level field
  12. Edit hlq.S0W1.SPF#.LIST
      type c999 on line 1 and enter create p3.output(#12)

You just completed the challenge. Feel free to browse P3.OUTPUT(#12) for the print screens.

Next: Challenge #13

IBM Z Hardware Has 5 Unique Operating Systems
Part Three - Challenge #13

Background:

Challenge 13 is a quick, easy, and educational challenge.

The contest z/OS system is one of many operating systems running on the contest IBM Z hardware.

IBM Z hardware can run 5 unique operating systems:

  1. z/OS - IBM Z flagship operating system used for this contest
  2. z/VM - hipervisor operating system
  3. Linux - operates the same as other platforms
  4. z/TPF - Transaction Processing Facility
  5. z/VSE - similar to z/OS with less features and functions

If you want to read more about these operating systems, visit:
IBM Z

Communication between the operating systems in the IBM Z frame eliminates the requirement for extra cables. In addition, the response is near zero because the communication path can be configured to remain within the IBM Z frame.

IBM Z can be hardware partitioned. The hardware partitioning is called LPAR. This LPAR hardware hipervisor is assigned CPU's, Memory, and Peripheral Devices such as disk, network, tape, etc, from the total available resource pool.

Any of the 5 operating systems can run in an LPAR. A single IBM Z is capable or running up to 85 LPARs.

When z/VM is running in an LPAR, then 'guest' operating systems can run under the control of z/VM. z/VM is a software hipervisor. Any of the above 5 operating systems can be hosted as a virtual machine with the z/VM environment.

It is common to use z/VM hypervisor to run 100's and even 1000's of Linux operating systems. Running 8,000 virtual servers on a single system with near zero network delay between the operating systems is a fantastic industrial strength architecture.

The challenge will give you the opportunity to interface with the z/VM that is controlling the contest z/OS.

A routine exists to enter z/VM commands from your TSO/ISPF session.

Challenge:

Enter =6 to display ISPF Command Shell panel.

Enter the following commands to display z/VM information related to this z/OS guest operating systems:

  • Q USERID
  • Q PRIVCLASS
  • Q CPUID
  • Q CPUS
  • Q STORAGE
  • Q CPLEVEL
  • Q USERS
  • Q LAN ALL
  • Q NIC ALL
  • Q LAN NAME ####### DETAIL

where ####### is the VSWITCH name available from 'Q LAN ALL' and 'Q NIC ALL'

Note: Q is abbreviation for z/VM QUERY command

Checking your results:
While commands return output to your screen, it also writes output to P3.OUTPUT(#13)
Therefore, the output from the last z/VM Q command is stored in P3.OUTPUT(#13)
Success is when P3.OUTPUT(#13) contain LAN DETAILS from the VSWITCH name.

Next: Challenge #14

IBM Z Machine Instructions
Part Three - Challenge #14

Background:

The challenge exposes you to IBM Z Assembler. Learning to be an assembler programmer takes significant time and repetition.

Learning assembler is harder than learning other programming languages.
The reason is that assembler requires the programmer to learn about the machine specific:

  • Assembler instructions
  • Assembler directives
  • Assembler macros
  • Hardware architecture

IBM Z Assembler coding and debugging requires:

  • Decimal/Hexadecimal conversion
  • Hexadecimal arithmetic applied to memory addressibility
  • Binary format representation and binary arithmetic such as two's complement

There are employers that want and need technicians with IBM Z Assembler skills.
  A humorous youtube video related to the above statement follows:
  "The code I write runs on the mainframe."

A deceptively simple assembler program will be used and explained. The deceptively simple assembler program includes many technical elements of IBM Z Assembler.

Figure 1. is assembler source code. Outlined in red are the assembler instruction mnemonics responsible for "standard linkage", a way in which data and control are passed from the calling program to this called program.

The first red outline is an assembler coding technique to save register content of the program that gives execution control to this assembler program. One exception is the USING statement which is an assembler directive as is the END statement at the bottom.

The second red outline restores register content of the program that gave control to this assembler program.

The third red outline gives control back to the program that originally gave control to this assembler program.
Figure 1.
Figure 2. is the same assembler source code. Outlined in red are the assembler instruction mnemonics to be executed. This is the program body which is only 3 assembler mnemonics (LH, A, ST) and 1 assembler macro (WTO).
Figure 2.
Figure 3. is the same assembler source code. Outlined in red are the assembler program declared storage areas (DC - Define Constant).
Figure 3.
  1. Compile assembler program source code
    tso submit 'zos.public.jcl(ch14)'

  2. Screen shots of the compile output follow focusing on machine instructions and assembler mnemonics.

    Figure 4. Outlined in red on the right side are the assembler mnemonics.
    Outlined in red on the left side are the corresponding machine instructions.
    An example is the left side x'90' that is the machine instruction for assembler mnemonic STM on the right side.
    Figure 4.
  3. Screen shots of the compile output follow focusing on program instruction memory address locations.

  4. Figure 5. Outlined in red on the left side are the program relative address locations.
    Relative address locations range from x'00000' to x'00009E' which is also the length of the program, CH14.
    Figure 5.
  5. Screen shots of the compile output follow focusing on assembler directives and macros.

  6. Figure 6. Outlined in red are assembler directives (CSECT, USING, END).
    Also, outlined in red is an assembler macro (WTO).
    Outlined in red 16+ to 22+ are statements included in the program as a result of the macro.
    Assembler macros are reusable code.
    Figure 6.
  7. Screen shots of the compile output follow focusing on assembler program defined storage areas.

  8. Figure 7. Outlined in red are assembler program defined storage areas (DC - Define Constant).
    Each storage area has an address location and a label.
    The assembler mnemonics can use either labels or relative address locations of storage areas. Writing an assembler program using labels is much easier. The compiler translates the labels into relative address locations.
    Figure 7.
  9. Screen shots of how to use the TSO TEST facility.

  10. Figure 8. A TSO facility (TEST) is available to view program execution.
    TEST can list program execution registers and storage locations.
    Use the TEST facility on the executable program (CH14) as follows:

    Get a TSO Ready prompt by terminating the ISPF session.

    =x

    Start the TSO TEST facility as shown below - replacing Z99999 with your ID

    Figure 8.

    In the above display - observe the following:

    • list +0 length(158) displays relative address location +0 for a length of 158 which is the machine instructions and storage areas in the program.
        The program length is x'9E' which is equivalent to decimal 158.
        As mentioned before, the need to convert between hexadecimal and decimal is required because of instances where a value is decimal when the operating system is working in hexadecimal.
      Hexadecimal/Decimal Converter - try converting x'9E' to a decimal value
    • The hexadecimal values between +0 and +9E map directly to the compile object code (machine instructions) in Figure 7.
    • list 0r:15r displays the content of the 16 program execution registers, 0-15.
        TEST initializes registers 2 through 12 with X'FFFFFFFF' to allow you to see register content changes during the program execution.
  11. Try what you see in Figure 10. below using TSO TEST facility to:
  12.    List instruction located at +0, the beginning of program execution
       List instruction located at +14
       List storage area located at +92 for a length of decimal 7
       List storage area located at +92 for a length of decimal 7 in character format

    Figure 10.
  13. The TEST facility program has control at the moment and register 15 contains an address where CH14 program is loaded in memory.
    Try what you see in Figure 11. to:
  14.    Ask where (the address location) is program CH14
       List of all registers which includes register 15 with the address of program CH14 to be loaded for execution
    NOTE: Enter end to exit the TSO test facility

    Figure 11.
  15. The TEST facility program can set break points to stop program execution for the purpose of listing registers and storage address content at that point in time of the program execution. Reference Figure 5. as you proceed through this preparation exercise. Try what you see in Figure 12. below to:
    • Set break points at specific the program execution address locations
    • List of all registers at each break point
    • The first go loads and begins to execute CH14
    • at +14 is LH 3,HALFCON where the result will be to load register 3 with value from storage location HALFCON
    • The stop at +18 shows register 3 changed as a result of go to continue with execution of machine instruction at +14.
    • HALFCON is DC H'32'. However, HALFCON storage address (+90) shows x'20' - one those hex/dec conversion things
    • at +18 is A 3,FULLCON where the result will be to ADD to register 3 the value from storage location FULLCON
    • The stop at +1C shows register 3 changed as a result of go to continue with execution of machine instruction at +18.
    • FULLCON value is -1. Adding x'20' to -1 resulted in x'1F'
          * Where FULLCON at +88 is a hexadecimal full binary word x'FFFFFFFF'
          * Confused-normal-it is two's complement arithmetic.
          * Understanding is not necessary to complete the challenge
          * If you want to understand, start with following youtube
            "Two's Complement Explained"
    • While at +1C, list content at storage address +8C, associate with label HEXCON.
          * Instruction ST 3,HEXCON is at +1C, waiting to be executed on next go at bottom of Figure 12.

    Figure 12.
  16. Figure 13. below is at the beginning of +20 in CH14 program execution
    • The assembler code ST 3,HEXCON located at +1C was executed.
    • The content at +8C, HEXCON was changed from x'0000FD38' to x'0000001F'.
    • The assembler ST instruction stores content of register 3 into storage memory location at +8C, HEXCON

    • Figure 13.
    • END terminates TSO TEST facility execution returning to TSO Ready.

Challenge:

Modify CH14 assembler program as instructed below.

  1. Edit hlq.SOURCE member name CH14
  2. Change the A 3,FULLCON assembler statement to a statement that will subtract register 2 from itself.
  3.   -- Note: Internet search "z assembler subtract register instruction" for the assembler syntax
  4. Change the ST 3,HEXCON assembler statement to store register 2 into HEXCON.
  5. Submit ; =sd; st and review CH14 output for successful compile and execution.
  6.   -- If compile and execution is successful, proceed to 5.
      -- If compile and execution is unsuccessful, then identify and correct the error
  7. Use TSO TEST to validate the successful assembler changes and debug as needed.
  8.   -- Subtract register instruction has a shorter instruction length than the add instruction
        ** Carefully review compile output for changes in program address locations
      -- Register 2 should be x'00000000'
      -- Storage location associated with label HEXCON, should be x'00000000'
  9. If register 2 is NOT x'00000000' or HEXCON is NOT x'00000000', then correct CH14 source code.
  10. If register 2 is x'00000000' and HEXCON is x'00000000', then
    submit 'zos.public.jcl(ch14x)'
  11.   -- JCL job ch14x writes output to hlq.P3.OUTPUT(#14)

Congratulations! You are most likely in a fraction of the contestants advancing to the last challenge in Part 3.
Completing all Part 3 challenges qualifies you to be among the group judged and selected as the Part 3 contest winners.
Best of luck with the final challenge.

Next: Challenge #15

The challenge idea is from an IBM professional manual, TSO/E Programming Guide.
The last chapter is presented in a tutorial form.
Chapter 17. A Tutorial Using the TEST Command

Flours, Sugars, Oils Application Services
Part Three - Challenge #15

Background:

The challenge has neither a right or wrong answer. The challenge requires development of data processing services for the Flours, Sugars, and Oils Company.

COBOL source code and 2 DB2 tables are provided along with a minimum requirement to complete the challenge. The minimum requirement is a matter of following the instructions enabling interative execution of the COBOL program without any COBOL programming source code modifications.

Develop business helpful application services beyond the minimum requirement to distinguish your application from other contestants during the judging process. The quality and usefulness of your business application services will contribute to your chances of being a top place winner.

Judges will execute each contestant challenge 15 COBOL program checking for:
1) Successful program execution
2) Successful program execution of SQL

and essential to be selected as a top place winner:
3) Program enhancements that distinguish your application services from the others

You are at liberty to change any or all of the program.

Learning System IDs Only (AU0####), click on link below for special instructions.
Learning System ID special instructions for this challenge.
Recommendations:
Use your existing DB2 table, T#####, with the client profile data
If you decide to create one or more additional DB2 tables, each table needs a unique table name
  Each new DB2 table can be uniquely identified as follows:
A#####, B#####, C##### - where ##### is the 5 digits of your ID

If you decide to create a new DB2 table, DCLGEN instructions are provided to generate the COBOL source code variables declaring the new DB2 table in the program.

JCL is provided to precompile the COBOL source expanding the EXEC SQL statements, create the executable module, and bind the DBRM module into a required DB2 plan. The DB2 plan name and the COBOL executable program name is required to execute the program.

JCL Diagram

Summary of previous challenges that can help you complete the final challenge:

  1. COBOL programming language
  2. COBOL access to Flours, Sugars, Oils Company sequential data set
  3. COBOL DB2 API to Flours, Sugars, and Oils company DB2 table
  4. Your ID was GRANTed CREATETS, CREATETAB, LOAD ON DATABASE MTM2017
  5. You created a DB2 table and loaded FSO.CLIENT.PROFILE into your DB2 table
  6. A COBOL program, DB2FSO, was provided to interact with your DB2 table
  7. JCL procedure to build COBOL program executable and a DB2 Plan
  8. Interactive execution of COBOL program using DB2 table as a data source

Challenge:

Instructions to meet minimum requirements:

Copy the COBOL source code into your source data set as follows:
Figure 1.
Figure 2.
Figure 3.
Change all occurrences of ##### to 5 numeric digits of your ID for the COBOL source code to reference your personal DB2 table with client data as follows:
Figure 4.
Create executable module and DB2 plan as follows:
Figure 5.
Verify successful completion of compile and DB2 plan bind as follows:
Figure 6.
Figure 7.
Figure 8.
Figure 9.
Observe in the output is the name of DB2 plan which should be z#####b, where the ##### is 5 numeric digits of your ID. This DB2 plan name is required for execution step.
Figure 10.
Figure 11.
Jump to ISPF Command Shell (=6) and enter dsn system(dbbg) to start a DB2 command shell environment. The DSN prompt is the DB2 command shell. From DSN command shell, enter:
run prog(fso) lib(load) plan(z#####b)
Figure 12.
Try a Client Record Lookup and a Product Record Lookup to validate the program successfully executes SQL for each of the DB2 tables declared in the FSO COBOL source code.
Figure 13.
If your FSO COBOL program successfully executed SQL for each of the DB2 tables, then you successfully met the minimum requirement to consider this final challenge complete. Enter stop to terminate the program execution, then enter end to exit DB2 command shell and return to ISPF Command Shell.
Figure 14.
If you want to pursue top place status, continue with instructions that follow.

Upon review of the COBOL source code, hlq.SOURCE(FSO), you will see the code uses 2 DB2 tables. Your client table, T#####, is select/update/insert capable, The FSO.FSOSKU table, asis, is only select capable.

The FSO.FSOSKU table only has 3 product records with SKU identifiers, F1001, S1001, and Q1001. The column names with respective data types can be found in the FSO COBOL source code.

If you decide to create another data source for reading, writing, or updating, it can be any data set type, SEQ, PDS, VSAM, Unix file, or DB2 table.

If you decide to create another DB2 table, copy hlq.SQL member STEP2 to a new member name, then modify to create the new tablespace, table, and optional unique index. Careful here. Comment the drop S##### tablespace statement to avoid deleting your T##### client profile table unless you really mean to drop your existing tablespace and table as a part of a redesign of your new application services program.

Many SQL educational websites explain the SQL DML insert and update statements.
Figure 94. is a simple diagram of the insert statement syntax.

Figure 94.
What follows is an explanation of how to use the interactive DCLGEN, declarations generator, process. The DCLGEN example below inputs the DB2 table you created in a previous challenge. The same process can be used for any new DB2 table. The generated COBOL source can be copied into the FSO COBOL program source eliminating need to type the declarations into the source code.
Figure 95.
Figure 96.
Figure 97.
Figure 98.
Figure 99.
In the event you select to design a new DB2 table as a part of your application services program modification, the URL below can be helpful in designing the column data types.

DB2 for z/OS Data Types

Competing in the final challenge demonstated your ability to be a z/OS application developer. Your completion of Part 3 demonstrates your willingness and capability to be hired by employers needing those attributes to learn from senior IBM Z technicians supporting some of the most critical systems responsible for the day to day business transactions.

Next: Completing Part 3

Scoring & 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. Additionally, the last challenge is very open ended for the purpose of distinguishing yourself from other contestants by developing a needed business service for the Flours, Sugars, and Oils company beyond the minimum requirements.

The judge's scores are averaged to select the winners.