Tracing Results; Exercises - Using The Trace Instruction - IBM SC34-5764-01 Manual

Cics transaction server for vse/esa
Table of Contents

Advertisement

Using Variables and Expressions
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
Figure 15. TRACE Shows How REXX Evaluates an Expression
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.

Tracing Results

To trace only the final result of an expression, use the TRACE R (TRACE Results) form of the TRACE
instruction. The language processor analyzes all expressions that follow the instruction as follows:
>>>
Final result of an expression
If you changed the TRACE instruction operand in the previous example from an I to an R, you would see
the following results.
9 *-* IF a + 1 > 5 * y
>>>
"0"
In addition to tracing operations and results, the TRACE instruction offers other types of tracing, see
section "TRACE" on page 166.

Exercises - Using the TRACE Instruction

Write a program with a complex expression, such as:
IF (a > z) | (c < 2 * d) THEN ....
Define a, z, c, and d in the program and use the TRACE I instruction.
ANSWER
30
CICS TS for VSE/ESA: REXX Guide
/* No operation on the ELSE path */
*/
*/

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rexx

Table of Contents