Tracing Expressions with the TRACE Instruction
You can use the TRACE instruction to display how the language processor
evaluates each operation of an expression as it reads it, or to display the final result
of an expression. These two types of tracing are useful for debugging execs.
Tracing Operations
To trace operations within an expression, use the TRACE I (TRACE Intermediates)
form of the TRACE instruction. All expressions that follow the instruction are then
broken down by operation and analyzed as:
>V>
-
V
ariable value - The data traced is the contents
of a variable.
>L>
-
L
iteral value - The data traced is a literal
(string, uninitialized variable, or constant).
>O>
-
O
peration result - The data traced is the result
of an operation on two terms.
The following example uses the TRACE I instruction.
EDIT ---- USERID.REXX.EXEC(SAMPLE) ---------------------- COLUMNS 009 080
COMMAND ===>
SCROLL ===> HALF
******* ************************** TOP OFDATA ****************************
000001 /************************* REXX *****************************/
000002 /* This exec uses the TRACE instruction to show how an
*/
000003 /* expression is evaluated, operation by operation.
*/
000004 /********************************************************* */
000005 x = 9
000006 y = 2
000007 TRACE I
000008
000009 IF x + 1 > 5 * y THEN
000010
SAY 'x is big enough.'
000011 ELSE NOP
/* No operation on the ELSE path */
******* ********************** BOTTOM OFDATA *****************************
When you run the example, you see on your screen:
9 *-* IF x + 1 > 5 * y
>V>
"9"
>L>
"1"
>O>
"10"
>L>
"5"
>V>
"2"
>O>
"10"
>O>
"0"
First you see the line number
(9 *-*)
followed by the expression. Then the
expression is broken down by operation as follows:
>V>
"9"
(value of variable x)
>L>
"1"
(value of literal 1)
>O>
"10"
(result of operation x + 1)
>L>
"5"
(value of literal 5)
>V>
"2"
(value of variable y)
>O>
"10"
(result of operation 5 * y)
>O>
"0"
(result of final operation 10 > 10 is false)
Tracing Expressions with the TRACE Instruction
Chapter 3. Using Variables and Expressions
37
Содержание TSO/E REXX
Страница 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 2: ......
Страница 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Страница 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Страница 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Страница 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 241: ......