Tracing Results; Exercises - Using The Trace Instruction - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

Tracing Expressions with the TRACE Instruction

Tracing Results

To trace only the final result of an expression, use the TRACE R (TRACE Results)
form of the TRACE instruction. All expressions that follow the instruction are
analyzed and the results are displayed as:
If you changed the TRACE instruction operand in the previous example from an I to
an R, you would see the following results.
In addition to tracing operations and results, the TRACE instruction offers other
types of tracing. For information about the other types of tracing with the TRACE
instruction, see z/OS TSO/E REXX Reference.

Exercises - Using the TRACE Instruction

Write an exec with a complex expression, such as:
IF (A > B) | (C < 2 * D) THEN ...
Define A, B, C, and D in the exec and use the TRACE I instruction.
ANSWER
When this exec is run, you see the following:
38
z/OS V1R1.0 TSO/E REXX User's Guide
>>>
Final result of an expression
9 *-* IF x + 1 > 5 * y
>>>
"0"
Possible Solution
/****************************** REXX *******************************/
/* This exec uses the TRACE instruction to show how an expression */
/* is evaluated, operation by operation.
/*******************************************************************/
A = 1
B = 2
C = 3
D = 4
TRACE I
IF (A > B) | (C < 2 * D) THEN
SAY 'At least one expression was true.'
ELSE
SAY 'Neither expression was true.'
*/

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents