EasyManuals Logo
Home>IBM>Computer Hardware>TSO/E REXX

IBM TSO/E REXX User Manual

IBM TSO/E REXX
242 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #55 background imageLoading...
Page #55 background image
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> - 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.
EDIT ---- USERID.REXX.EXEC(SAMPLE) ---------------------- COLUMNS 009 080
COMMAND ===> SCROLL ===> HALF
******* ************************** TOP OF DATA ****************************
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*yTHEN
000010 SAY 'x is big enough.'
000011 ELSE NOP /* No operation on the ELSE path */
******* ********************** BOTTOM OF DATA *****************************
When you run the example, you see on your screen:
9*-*IFx+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 operationx+1)
>L> "5" (value of literal 5)
>V> "2" (value of variable y)
>O> "10" (result of operation5*y)
>O> "0" (result of final operation 10 > 10 is false)
Tracing Expressions with the TRACE Instruction
Chapter 3. Using Variables and Expressions 37

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM TSO/E REXX and is the answer not in the manual?

IBM TSO/E REXX Specifications

General IconGeneral
BrandIBM
ModelTSO/E REXX
CategoryComputer Hardware
LanguageEnglish

Related product manuals