The SCL Debugger |
Syntax | |
Details | |
Examples |
Syntax |
IF expression THEN clause <; ELSE clause> |
contains a condition to be evaluated before one or more commands are executed.
contains either a single debugger command or a debugger DO list.
Details |
The IF command immediately evaluates an expression and conditionally executes one or more debugger commands. The expression will contain dot notation because it resolves to a numeric variable. Character variables are converted.
The IF command must contain a THEN clause with one or more commands to execute if the expression is true. It can also contain an ELSE clause with one or more commands to execute if the expression is false. The ELSE clause must be separated from the THEN clause with a semicolon, and the ELSE clause cannot be entered separately.
Examples |
Examine the variable X if X contains a value that is greater than 0:
DEBUG> if x > 0 then e x
Examine the variable X if X is greater than 0, or examine the value of the variable Y if X is less than or equal to 0:
DEBUG> if (x>0) then e x; else e y
Execute the following actions if the value of variable X is less than variable Y and if Y is less than variable Z:
Execute the following actions if the value of the variable X is 1:
Set a breakpoint at line 15 of the program. Whenever the execution suspends at line 15, if the value of the variable DIVISOR is greater than 3, execute the STEP command; otherwise, examine the value of the variable DIVIDEND.
DEBUG> b 15 do; if divisor>3 then st; else e dividend; end;
Examine the variable X if the attribute attrValue on object1 is greater than 10:
if object1.attrValue > 10 then e x
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.