Suspends program execution at an executable statement
|
BREAK <location <AFTER
count> <WHEN clause | DO list>>
|
|
- location
- specifies where to set a breakpoint (the
current line, by default):
- _ALL_
- sets a breakpoint at every executable statement.
- ENTRY
- sets a breakpoint at the first executable
statement in all entries in the application catalog that contain a program.
- entry-name\
- specifies a catalog entry. A breakpoint
is set at the first executable statement in the program in the specified entry.
If the entry resides in the current catalog, then entry-name can be a one-level name. If the entry resides in a different
catalog, then entry-name must be a four-level
name, and the entry must already be loaded into the application's execution
stack. A backslash must follow the entry name.
- label
- specifies a program label. A breakpoint
is set at the first executable statement in the program label.
- line-num
- specifies a line number in an SCL program
where a breakpoint is set. The specified line must contain at least one executable
SCL statement.
- AFTER count
- specifies the number of times for the debugger
to execute a statement before executing the BREAK command.
Note: When multiple statements appear on a single line,
the debugger treats them as separate statements. That is, the debugger will
break on the same line as each statement on that line is executed. In the
following example, the line will break three times in line number 10 because
the condition is met three times
10 x=1 y=2 z=3
b10 after 3;
- WHEN clause
- specifies an expression that must be true
in order for the command to be executed.
- DO list
- specifies one or more debugger commands
to execute. Use semicolons to separate multiple commands.
The BREAK command sets a breakpoint at
a specified statement. A breakpoint is an executable SCL program statement
at which the debugger suspends program execution. An exclamation mark replaces
the line number in the debugger SOURCE window to designate the line at which
the breakpoint is established.
When an SCL program detects a breakpoint, it
- suspends program
execution
- checks the count that you specified with the AFTER
command and resumes program execution if the statement has not yet executed
the specified number of times
- evaluates the condition specified with the WHEN
clause and resumes execution if the condition evaluates to FALSE
- displays the entry name and line number at which
execution is suspended
- executes any command that is specified in a DO list
- returns
control to you.
If a breakpoint is set at a program line that contains
more than one statement, then the breakpoint applies to each statement on
the source line. If a breakpoint is set at a line that contains a SAS macro
expansion, then the debugger breaks at each statement that is generated by
the macro expansion.
- Set a breakpoint at line 5 in the current program:
DEBUG> b 5
The output to the debugger MESSAGE window is
stop at line 5 in MYLIB.MYCAT.TEST.SCL
b 5
Stop at line 5 in MYLIB.MYCAT.TEST.SCL
Set breakpoint at line 5 in program
MYLIB.MYCAT.TEST.SCL
- Set a breakpoint in each executable statement:
DEBUG> b _all_
- Set a breakpoint in each executable line and print
all the values:
DEBUG> b _all_ do; E _all_; end;
- Set a breakpoint at the first executable statement
in each entry that contains a program in the catalog:
DEBUG> b entry
- Set a breakpoint at the first executable statement
in the MAIN section:
DEBUG> b main
- Set a breakpoint at the first executable statement
in the entry TEST1.SCL:
DEBUG> b test1\
- Set a breakpoint at line 45 in the entry TEST1.SCL:
DEBUG> b test1\45
- Set a breakpoint at the MAIN label in the entry
TEST1.SCL:
DEBUG> b test1\main
- Set a breakpoint at line 45 before the fourth
execution of line 45:
DEBUG> b 45 after 3
- Set a breakpoint at line 45 in the entry TEST1.SCL
only when both the divisor and the dividend are 0:
DEBUG> b test1\45 when (divisor=0 AND dividend=0)
- Set a breakpoint at line 45 only when both the
divisor and dividend are 0 before the fourth execution of line 45:
DEBUG> b 45 after 3 when (divisor=0 AND dividend=0)
- Set a breakpoint at line 12 when the value of
the maxLength attribute on object1 is greater than 12:
DEBUG> b 12 when (object1.maxLength > 12)
- Set a breakpoint at line 45 of the program and
examine the values of variables NAME and AGE:
DEBUG> b 45 do; e name age; end;
DELETE
EXAMINE
LIST
TRACE
WATCH
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.