IBM MTM: Part Three – Challenge #14

Today I’m tackling the last real exercise of IBM’s Master the Mainframe contest. This will mark completion of all #MTM2018 its challenges. The cherry on top is a challenge about the Rexx scripting language.

Rexx is used to create routines that automate many tasks. What makes Rexx so accessible is that the language itself is very simple to understand and that any programming language can execute compiled Rexx.

The Rexx code supports 4 types of statements:

  1. Functions
  2. Instructions
  3. Built-in functions provided by the specific processing facility
    See chapters 3 and 4.
  4. Commands available to the specific processing facility
    See chapter 10.

Some more resources on Rexx:

  1. Basic Syntax
  2. Strings
  3. Arrays

There are many other excellent internet sources of information for Rexx such an introduction from a small company in UK and Introductory Rexx Tutorial.

Get Rexx Code

IBM Master the Mainframe Part Three – Challenge #14

Let’s begin! I need to finish this so I can start working on challenge #15. I’ll navigate to Z30163.SOURCE and s slots. After creating a new member I’ll just copy ‘zos.mtm2018.public.source(slots)’ and save it.

There it is! Let’s go! Now let’s execute slots using the ex line command. There’ll be errors! Prepare your lifeboat!

40 +++ f = randum(1,4) 
16 +++ call play 
Error running SLOTS, line 40: Routine not found

Hmm… routine not found at line 40. I found the error, it’s pretty simple. Let’s edit and execute again.

Huh? Cherry, VIEW.2 and Cherry. Which one is the odd one out? Let’s fix that! Now where can I find view?

I’ve spotted the mistake. Hmm… Once you win, you will be instructed to read the slots Rexx code to complete the challenge successfully. Can’t I just read the source code and see what needs to be done? Guess not.

Blistering barnacles! I’ll have to play again and actually do maths… Noooo! I’ll have to read the REXX code and find 5 numbers. What if I just modify the code and make it say the numbers? But hey, for the sake of this challenge, I won’t ruin it 🙂

I’ve got the numbers 4232 in P3.OUTPUT(#14). Didn’t I need 5 numbers? Huh.

They have an array called ky and add keys 1 to 5 to it. Not to and including? Each ky array key has a random value between 111 and 999. Then they do something interesting at line 000088 to 000090.

That’s all I needed to know. I’ll go ahead and tso ch14 mynumbers.

I won! I’m expecting my $1,000,000.00 to come any day now. Have you won any money recently?

Share this:

Leave a Reply

Your email address will not be published.