13 May, 2012
How to write a simple REXX program?
Posted In: Mainframes
- Start with Keyword REXX in comments
- Comments are enclosed between /* and */
- /* REXX */ in the first line of REXX Exec makes the command processor (TSO) invoke the REXX interpreter.
- ; To Separate two Instructions (optional)
- , To Continue an Instruction (optional)
- SAY and PULL are two basic commands in REXX.
- SAY – To Display the text on the Terminal
- PULL – To Accept the input from the user in upper case
REXX Routine: (save the below code in a PDS member)
SAY 'ENTER TWO NUMBERS'; PULL NUM1 NUM2
SUM = NUM1 + NUM2
SAY 'THE SUM OF THE’,
'TWO NUMBERS IS'
Execute the Routine by giving the below TSO Command
TSO EXEC <PDS NAME>(<MEMBER NAME>)
ENTER TWO NUMBERS
THE SUM OF THE TWO NUMBERS IS
Note: You can expect more Mainframe related stuffs in my future blog posts'