Previous Page | Next Page

DATA Step Debugger

BREAK



Suspends program execution at an executable statement.
Category: Manipulating Debugging Requests
Alias: B

Syntax
Arguments
Details
Examples
See Also

Syntax

BREAK location <AFTER count> <WHEN expression> <DO group >

Arguments

location

specifies where to set a breakpoint. Location must be one of these:

label

a statement label. The breakpoint is set at the statement that follows the label.

line-number

the number of a program line at which to set a breakpoint.

*

the current line.

AFTER count

honors the breakpoint each time the statement has been executed count times. The counting is continuous. That is, when the AFTER option applies to a statement inside a DO loop, the count continues from one iteration of the loop to the next. The debugger does not reset the count value to 1 at the beginning of each iteration.

If a BREAK command contains both AFTER and WHEN, AFTER is evaluated first. If the AFTER count is satisfied, the WHEN expression is evaluated.

Tip: The AFTER option is useful in debugging DO loops.
WHEN expression

honors a breakpoint when the expression is true.

DO group

is one or more debugger commands enclosed by a DO and an END statement. The syntax of the DO group is the following:

DO; command-1 < ... ; command-n; >END;

command

specifies a debugger command. Separate multiple commands by semicolons.

A DO group can span more than one line and can contain IF-THEN/ELSE statements, as shown:

IF expression THEN command; <ELSE command;>

IF expression THEN DO group; <ELSE DO group;>

IF evaluates an expression. When the condition is true, the debugger command or DO group in the THEN clause executes. An optional ELSE command gives an alternative action if the condition is not true. You can use these arguments with IF:

expression

specifies a debugger expression. A non-zero, nonmissing result causes the expression to be true. A result of zero or missing causes the expression to be false.

command

specifies a single debugger command.

DO group

specifies a DO group.


Details

The BREAK command suspends execution of the DATA step at a specified statement. Executing the BREAK command is called setting a breakpoint.

When the debugger detects a breakpoint, it does the following:

If a breakpoint is set at a source line that contains more than one statement, the breakpoint applies to each statement on the source line. If a breakpoint is set at a line that contains a macro invocation, the debugger breaks at each statement generated by the macro.


Examples


See Also

Commands:

DELETE

WATCH

Previous Page | Next Page | Top of Page