REXX, a Popular Mainframe Scripting Language
Part Two - Challenge #15


Many highly experienced mainframe technicians use a scripting language that is unfamiliar to others in the non-mainframe world even though this language can be installed on the other platforms. Just like all workstations have a variety of shell scripting languages, the powerful mainframe scripting language is REXX.

REstructured eXtended eXecutor (REXX), was designed for ease of learning and reading, even though its full name sounds like quasi rocket science stuff.

If you end up in a job as a z/OS System Programmer or System Administrator in a large enterprise, the chances of quickly running into REXX code is very high. The good news is that it is true that while this scripting language is very powerful, it is also easy to learn and use. It is not necessary to memorize all the REXX commands, functions, and capabilities because references and example code are everywhere on the internet.

Here are some websites you can reference when working with REXX:

Having "REXX" on your resume, similar to having "COBOL" or "JCL", can be an attention grabber. An employer that observes "REXX" on a resume will immediately think this is a potential mainframe System Programmer or System Administrator.

Your challenge:

It is time to have some fun!

Enter the ISPF command TSO XTBL, and within the running program, try entering joke, then help, then try all.

Remember: The source code for this program is located in CC#####.REXX.CLIST(XTBL). Reviewing this code as an example of correct REXX syntax along with internet searching can be helpful in completing this challenge.

Now you will evaluate REXX code that has a problem for you to correct. Jump to the data set list utility panel (=3.4) and edit CC#####.REXX.CLIST. Observe that there are a number of members here.

Enter EX to the left of XTBL to execute the REXX program. This is the same program you ran before with the TSO command. Use the end command to exit XTBL.

Enter EX to the left of HOROSCOP to execute the REXX program. This program has several problems that must be corrected.

The second screen immediately shows a problem:

COMMAND SA NOT FOUND 16 *-* sa 'When where your born? ' +++ RC(-3) +++

However, the routine continued to function.

Enter 1 and observe another problem. This one causes the program to abend.

Execute the HOROSCOP program again. This time enter 13. Yes, there's a third problem.

Execute the HOROSCOP program again. Choose option 4 and observe yet another problem. Go ahead and end the HOROSCOP program now.

Edit the HOROSCOP member and correct all the problems. REXX syntax is easy to understand, take your time and read the source code carefully. Do not forget the reference links we gave you at the start of this challenge, and you can use the XTBL program as a reference as well.

Each time you attempt a correction, use F3 to save the HOROSCOP member and return to the directory listing. Then enter EX next to HOROSCOP to try out your modification.

Once you have corrected all the problems, observe the horoscope for selection 1 and 2 are identical. This is another problem to correct. A hint to help you debug your REXX code can be found in the 2 lines of selection 1 output.

Note: In the event you want to restore HOROSCOP to it's original state, you can find a copy in 'ZOS.PUBLIC.P2.REXX.CLIST(HOROSCOP)'. Feel free to take a copy!

Once these problems are corrected, enter TSO SUBMIT JCL(HOROSCOP). This JCL will execute your HOROSCOP program in batch and create P2.OUTPUT(#15). Upon successful execution, member #15 will have the Aquarius and Taurus horoscopes contained within.

Helpful Hint #1: Close examination of the REXX routine shows that the Horoscope text message are PDS members in 'ZOS.PUBLIC.DATA'. This is significant to correcting the the problem with TAURUS horoscope. Do NOT edit 'ZOS.PUBLIC.DATA' - Only view or browse 'ZOS.PUBLIC.DATA'. The system will not permit any changes to this data set.
Helpful Hint #2: REXX return statement is significant to execution flow.

Just one more challenge to go! Stay frosty!

Next: Challenge #16