IBM MTM 2018: Part Three – Challenge #15: Preparation

Before I continue, the preparation phase of challenge #15 is going to be a very long wall of text and images. Probably longer than China’s wall. Be prepared or be scared.

A full code review can be found at my GitHub, it’s better to read the GitHub review and blog conclusion if you’re participating.

It’s time for some good old role-play. No, this is not a blog about Dungeons & Dragons. This is about me playing the role of an experienced z/OS technician. My assignment is to help a newbie become familiar with the z/OS environment. I have become the teacher. Worship me.

I’ll be assisting my students by explaining some system details in a report format using a combination of JCL, SDSF, SDSF commands, Rexx scripts, z/OS commands, JES2 commands and to finish the list, some TSO commands.

I’m among the small fraction of the contestants completing the last challenge, but I’m not eligible to be a winner or a honourable mention as I’m not a student. I thought I’d mention this to not keep you waiting. I know, I know… I probably would’ve won everything but hey, I have to stay humble.

This final challenge is a matter of exercising technical creativity to distinguish my ideas and work from the other contestants. I’m given a few ideas with sample Rexx code as the basis for applying my creativity. I have to say that my creativity will be limited as my job currently swallows up all my time. I do hope to finish the master the mainframe challenge but I fear I won’t.

This final challenge is a matter of creativity and quality. It’s not a matter of quantity. All my reports are ought to be a quick read and educational to someone new to the contest system.

Before I start, I’ll be reviewing some examples to help me prepare for this challenge.

Preparation

IBM Master the Mainframe Part Three – Challenge #15 Preparation

I’ll start out by grabbing a copy of the challenge #15 data sets, tso submit ‘zos.public.jcl(p3ch15)’. This should give me

  1. Z30163.CH15.JCL
  2. Z30163.CH15.OUTPUT
  3. Z30163.CH15.SOURCE

First of all apologies for the smaller screenshots, I’m taking screenshot on my 13″ mac and the emulator screen is really small. I’m working on #MTM during my commute 🙂

CH15.OUTPUT

Now I’ll check and see what CH15.OUTPUT holds. CH15.OUTPUT has members S00, S01 and TMPS00 holds system command output, S01 holds SDSF command output and TMP holds SDSF output but with some more information.

CH15.JCL

I have two partitioned members, S00JCL and S01JCL.

S00JCL is JCL used to write system command output to CH15.OUTPUT(TMP). S00JCL executes Rexx routine TRIMCOL writing new member S00. Rexx routine TRIMCOL trims unnecessary leading 45 columns writing CH15.OUTPUT(S00). 

S01JCL is JCL used to write SDSF command output to CH15.OUTPUT(TMP). S01JCL executes Rexx routine TRIMLINE writing new member S01. Rexx routine TRIMLINE removes unnecessary SDSF primary menu and blank lines writing the remaining output to CH15.OUTPUT(S01).

Rexx samples

This is going to be a long blogpost. Like… seriously long! There are 11 different REXX samples. That’s a lot of code to go through, I’ll make a summary of the code I could use to complete challenge #15.

SAMP01

Line 000002 to 000007 prompt to enter a member name. Line 9 with EXECIO * reads all lines from CH15.OUTPUT member name where rpt. is an array – rpt.1 is line 1, rpt.2 is line 2, rpt.0 is the number of line. Line 10 – 12 is a do loop writing each line to the display using Rexx say command.

The do i=1 to rpt.0 is a loop to start at 1 and stop at the last record in the rpt. array. The do loop processing has only 1 action during within the loop – to ‘say‘ the selected record from the rpt. array which happens to be rpt.i where i is the next number.

SAMP02

Line 11 includes parse var rpt.i where w1 w2 w3 w# captures each string or word in the line separated by a space.

SAMP03

Line 11 includes if pos(‘IEE254I’,rpt.i). The if condition returns a positive number for the position in the line where IEE254I is found. When IEE254I is found, then say the entire line, rpt.i.

SAMP04

Line 11 – 16 includes select when conditions. Line 20 – 28 includes labels such as iplinfo with code begin terminated by the return statement. Each return returns the control back to the do loop. Each call branches to the label to execute code following the label.

SAMP05

A system data set member is being allocated at line 1. In line 2 all lines are read into array parm. In line 3 each line is written to the display using the say Rexx command.

SAMP06

This script prompts the user to enter a member name and says some information.

SAMP07

Again the user is required to enter a member name, to test we enter S00IPL stands for initial program load.

S00

This piece of code again prompts to enter a data set member name and then calls several functions that say information.

S00#15

This code does the same as S00 but with only one difference, instead of saying the information it prints it to P3.OUTPUT(#15). This is a very important piece of code. Yes, the red is more like orange; the default red is headache inducing.

TRIMCOL

This piece of Rexx code reads from member TMP from CH15.OUTPUT. In this case the logic ultimately removes 43 unnecessary columns from TMP. The behaviour of substring is as follows: it returns the input string its value from position 44 up to and including 77. So the first 43 characters of the input string are lost.

TRIMLINE

This again reads member TMP and removes SDSF primary menu and blanks from TMP. ‘removes SDSF primary menu’ means it just removes the first 60  lines from TMP where the comments and stuff would be. Then it copies all the lines after line 60 where the line j its length is longer than zero.

That’s it.

REALLY, IS THAT ALL YOU’VE GOT IBM?! I’m kidding, that’s a lot, that’s more than about 500 lines of code. Hmmm… wait… my typical JavaScript files are larger than 1k lines. I guess I can’t complain. However this is very new and isn’t as flexible.

Minimum requirements – Apply the golden rule of MVP

Use JCL to process system commands which writes the command output to 1 or more members in CH15.OUTPUT
  Example: CH15.JCL(S00JCL)

Write a Rexx routine to read the 1 or more members from CH15.OUTPUT, then write a report to P3.OUTPUT(#15)
  Example: CH15.SOURCE(S00#15)

Report written to P3.OUTPUT(#15) should include brief headings or statements helping to explain report details to reader
  Example: Your role is the experienced z/OS tech teaching a newbie (a judge) about the z/OS contest system
  Under consideration - we might have selected z/OS newbies to help judge final report and optional additional reports
  NOTE: "optional additional reports" - see Evaluation twisty below

Report written to P3.OUTPUT(#15) needs to include a single line that informs reader/judges the name of the Rexx routine used to create the P3.OUTPUT(#15) report -
  Example: Report created by Rexx routine - ????? - where ????? could be R00#15 in CH15.SOURCE

The golden rule I was talking about? Minimum viable product. Let’s first try to get an MVP and then expand if there’s enough time. I personally can’t reach the wall of fame or be an honorable mention as I’m not a student. That doesn’t mean I shouldn’t do my utter best, but that also means that it doesn’t really matter to which extent I develop this challenge’s solution.

Full code review

I’ve reviewed all code of challenge #15 on my GitHub a bit more in-depth than I’ve done here. I’ve also included all source files for you to view in your favorite IDE. I might update this post to the GitHub code but I’m running low on time folks.

What’s your favorite IDE?

8 thoughts on “IBM MTM 2018: Part Three – Challenge #15: Preparation

  1. Hello Kevin,

    I am sure about the turn of you not having SDSF after entering the command below:
    S0W1 2019219 15:42:27.52 ISF045W Unable to open table library ISFTABL, number of saved commands may be limited.
    S0W1 2019219 15:42:36.38 ISF031I CONSOLE Z##### ACTIVATED

  2. Hi, Kevin!

    Did you have such a mistake, when wrote a report to P3.OUTPUT(#15) using S00#15?

    System abend code 013, reason code 00000024.
    Abend in host command execio or address environment routine TSO.
    EXECIO error while trying to GET or PUT a record.

    1. Hi Anna

      Can you give me a little more details? Perhaps some screenshots? I have never had this issue before, but some user on Slack has commented the following: “It asks for the “output”, but meant is the input for REXX coming as “output” from the batch JCL processed before. Simply type in that existing name and it will work. The new member to create is coded in the REXX.” Does this make sense?

      I would like to check myself, but unfortunately I’m locked out of the system.

      Kind regards
      -Kevin

      1. Really, the problem was that I entered a name that does not exist.
        I changed MBR to TMP in the file name and it worked.
        read_rpt:
        “allocate dataset(ch15.output(“TMP”)) fi(rpt) shr reuse”
        “execio * diskr rpt (stem rpt. finis)”

    1. Hi Retno! Welcome!

      This blog post show how I have prepared for IBM’s Master the Mainframe final challenge. Its purpose is to show other contestants or enthusiasts how I have solved the problem.

      Kind regards
      – Kevin

Leave a Reply

Your email address will not be published. Name, email and website not required.