After completing this chapter, you will be able to describe the various methods of executing a REXX exec.
There are two ways to execute the REXX exec.
Executing Explicitly
Executing Implicitly
To execute explicitly, we have to use EXEC command followed by the data set name, which is done as follows
TSO EX 'RACFID.SOURCE.EXEC(SAMPLE)' where 'RACFID.SOURCE.EXEC' is the PDS name and 'SAMPLE' is the REXX exec name.
The implicit execution is done as follows:
TSO SAMPLE where SAMPLE is the exec name
Implicit execution can be done only if the PDS containing REXX programs has allocated to the system files (SYSEXEC or SYSPROC) using the TSO alloc command or the PDS is allocated to an application CLIST or EXEC using TSO ALTLIB command.
/*******REXX**********/ Say 'This is the sample REXX exec' TSO EX 'RACFID.SOURCE.EXEC(SAMPLE)' EX – EXECUTING EXPLICITLY TSO SAMPLE – EXECUTING IMPLICITLY SAMPLE OUTPUT: This is the sample REXX exec |
REXX program which uses the basics of REXX, so far we explained.
/* REXX */ SAY 'ENTER THE FIRST NUMBER:' PULL NUMBER1 SAY 'ENTER THE SECOND NUMBER:' PULL NUMBER2 SAY 'ENTER THE THIRD NUMBER:' PULL NUMBER3 GREAT = VALUES (NUMBER1, NUMBER2, NUMBER3) SAY 'GREATEST NUMBER IS:' GREAT EXIT 0 VALUES: IF NUMBER1 > NUMBER2 THEN IF NUMBER1 > NUMBER3 THEN XE=NUMBER1 ELSE XE=NUMBER3 ELSE IF NUMBER2 > NUMBER3 THEN XE=NUMBER2 ELSE XE=NUMBER3 RETURN XE |
This exec will get the input of three numbers from the user.
And displays the greatest of three numbers.
Coding standards that needs to be followed.
Provide proper comments as needed.
Indent the code, since REXX instructions can begin in any column.
REXX program can be explicitly executed through TSO command.
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!