14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

60 <strong>Scripting</strong> Tools Chapter 4<br />

Debug Scripts<br />

Delete Breakpoints<br />

Do one of the following:<br />

• In the Debugger margin, click the breakpoint icon.<br />

• In the Debugger margin, right-click the breakpoint icon and select Clear Breakpoint.<br />

• On the Breakpoints tab, select the breakpoint and then click .<br />

• On the Breakpoints tab, click to delete all breakpoints (not just the selected breakpoints).<br />

The red breakpoint icon is removed, and the breakpoint no longer appears on the Breakpoints tab.<br />

Disable and Enable Breakpoints<br />

Disabling a breakpoint is helpful when you potentially fix a problem and then want to see whether the script<br />

will run correctly past that breakpoint. You can then enable the breakpoint when necessary rather than<br />

recreating it.<br />

Do one of the following:<br />

• In the Debugger margin, right-click the breakpoint icon and select Enable Breakpoint or Disable<br />

Breakpoint.<br />

• On the Breakpoints tab, select or deselect the breakpoint’s check box.<br />

• On the Breakpoints tab, click to disable or enable all breakpoints.<br />

A disabled breakpoint turns white; enabled breakpoints are shaded red.<br />

Specify and Clear Conditional Expressions on Breakpoints<br />

Setting a condition on a breakpoint is an alternative to single-stepping through code. Rather than<br />

single-step and view the variables for each expression, you specify that the script break only when a<br />

condition is met. Then you can step through the code and figure out where the problem arises.<br />

Suppose that a calculation in your script is incorrect, and you suspect the problem occurs when i==19. Set<br />

a conditional breakpoint for i==18. The Debugger will run until that condition is met, then you can step<br />

through the code to identify the problem.<br />

Specify a Breakpoint Condition<br />

1. Right-click the breakpoint icon and select Edit Breakpoint.<br />

2. On the Condition tab, select Condition and enter the conditional expression.<br />

3. Specify whether to break when the expression Is true or Has Changed.<br />

4. Click OK.<br />

Disable or Enable a Condition<br />

1. Right-click the breakpoint icon and select Edit Breakpoint.<br />

2. On the Condition tab, deselect or select Condition.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!