Hello Hello Hello
Today I’m doing the very last challenge of the IBM Master the Mainframe 2019 contest. It has been a long 4 months and we’ve finally reached the finish line.Now let’s take some time to finish this exercise.
Originally I wrote “exercise” wrong, but then I Googled it and corrected it. JUST. FOR. YOU. Isn’t that lovely? (heart emoji thing) Also, the WordPress spelling corrector underlined that word red and it triggered me very hard. You see, UX helps!
So, just to be able to finish before the 31st of December I’ll do a minimum viable product approach. That means I’ll do the absolute minimum to pass (i hope).
Also my apologies to everyone. I have 20 to 30 comments waiting for help and a ton of e-mails still waiting for a reply. I can’t keep up with the demand! Work, holidays, family and partying is taking up most of my time. Goodluck to everyone!
Learning and using z/OS creatively
Start the Final Challenge
Let’s start by getting the required data sets. We can do this by issuing tso submit ‘zos.public.jcl(p3ch15)’ from the ISPF Primary Option Menu.
The first time you do this it will allocate new data sets. The second time you do this it will delete and reset some data sets. BE WARNED!
It made the following data sets:
It also wrote a timestamp into p3.output(#15) and created REXXJCL member in our JCL data set.
System Activity Utility
From the ISPF Command Shell Panel (=6) I’ll issue the command ex ch15(get) to execute our challenge 15 code.
I’ll enter 1 to select ‘Report specific message identifier found in SYSLOG’.
If prompted for a message id enter ich408i.
This is the result.
Solving this challenge
Don’t take my word for it. Don’t automatically assume I’m right. I don’t exactly have an answer sheet 😉
But what needs to be done?
- The challenge is for you to enhance a system utility which generates point-in-time system activity reports.
- At least 1 report you write must demonstrate ability to parse SYSLOG records.
- Information requested has options 1-6 constructed, option 7 is blank.
So does this mean that I need to make option 7? And make it output whatever I want/can? There needs to be at least 1 report that parses SYSLOG records.
Is this the absolute minimum? I assume so. Great!
Step 1: REXXJCL
I just noticed the ID needs to be filled in in our Z#####.JCL(REXXJCL). I’ll do that first. GETSTRG does not exist in my CH15.CLIST data set. Do I need to create that member? Do I even need to do this? (I didn’t)
Warning: don’t do this just because I do!
Step 2: Explore CH15.CLIST
For the most part I’ll let you figure this out yourself. I’ll only write about the most interesting parts.
These are the challenge files we’re working with.
When we do ex ch15(get) we actually execute this rexx code.
So… IBM has left us with a few options and ideas. We can just code the ones they suggest or we can invent a new option at option 7.
For the MVP principle, I’ll delete 3 options and only do one, the fourth one. As I’m part of the learner program I have about 9 months more to expand. My apologies to the people that thought I would make something impressive!
I just want to provide an example during the last days the students have available.
Step 3: The Plan
The easiest one in my opinion is getting the TSO logons, unsuccessfull or successfull. ICH70001I is the code that gets logged when a user has logged on. Shortly after that code, the username is displayed along with some timestamps.
I just need to grab those entries and print them to the screen. I can basically use the code of report 1, remove the input prompts, sanitize the data and then it should be ok!
Let me test my theory.
My theory is correct! I’ll delete the other options and make it clear to IBM which option they need to pick.
I have removed the excess options and added the exec ch15(custom) command. Now I’ll go ahead and code my custom option. My custom option will also use the custom file in the clist data set.
Step 4: Coding
Unfortunately, I’m not allowed to share my code. But you should be fine on your own! I have used code bits from https://www.tutorialspoint.com/rexx/rexx_parsing.htm and https://www.rosettacode.org/wiki/Remove_duplicate_elements#REXX to write the solution.
This is the menu that is now generated.
Then after that we get the following output:
So this is an unique list of all the users that have logged on. I’m happy with my MVP approach. I believe these are the logons from today? I’m not 100% sure.
Have I missed something? What have you come up with?
I feel like I have though. Although, I have at least 1 report that demonstrates ability to parse SYSLOG records and I have enhanced a system utility. Is this enough?