Chapter Contents |
Previous |
Next |
IF |
Syntax | |
Details | |
Examples |
Syntax |
IF expression THEN clause <; ELSE clause> |
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 |
DEBUG> if x > 0 then e x
DEBUG> if (x>0) then e x; else e y
DEBUG> if ((x<y) & (y<z)) then do; d b _all_; b test2.scl\;g;end;
If the value of X is not 1, then execute these actions:
DEBUG> if x=1 then do; e a; b 5; end; else do; e b; b 15; end;
DEBUG> b 15 do; if divisor>3 then st; else e dividend; end;
if object1.attrValue > 10 then e x
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.