Tracing Operations

About this task

To trace operations within an expression, use the TRACE I (TRACE Intermediates) form of the TRACE instruction. The language processor breaks down all expressions that follow the instruction and analyzes them as:
>V>   - Variable value - The data traced is the contents
        of a variable.
>L>   - Literal value - The data traced is a literal
        (string, uninitialized variable, or constant).
>O>   - Operation result - The data traced is the result
        of an operation on two terms.
The following example uses the TRACE I instruction. (The line numbers are not part of the program. They facilitate the discussion of the example that follows it.)
Figure 1. TRACE Shows How REXX Evaluates an Expression
 1 /************************* REXX ***************************/
 2 /*  This program uses the TRACE instruction to show how   */
 3 /*  an expression is evaluated, operation by operation.   */
 4 /**********************************************************/
 5  a = 9
 6  y = 2
 7  TRACE I
 8
 9  IF a + 1 > 5 * y THEN
10     SAY 'a is big enough.'
11  ELSE NOP                /* No operation on the ELSE path */
When you run the example, the SAY instruction produces:
9 *-* IF a + 1 > 5 * y
  >V>   "9"
  >L>   "1"
  >O>   "10"
  >L>   "5"
  >V>   "2"
  >O>   "10"
  >O>   "0"

The 9 is the line number. The *-* indicates that what follows is the data from the program, IF a + 1 < 5 * y. The remaining lines break down all the expressions.


Task Task

Feedback


Timestamp icon Last updated: Tuesday, 7 January 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.rexx.doc//dfhrx/dfhrx00038.html