14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Debug Scripts<br />

Delete a Condition<br />

On the Breakpoints tab, click in the breakpoint’s Condition field and press DELETE.<br />

Specify Break Options<br />

Right-clicking the breakpoint and selecting Edit Breakpoint provides a quick way to manage breakpoint<br />

behavior. Alternatively, select the breakpoint on the Breakpoints tab and click . Both methods display<br />

the Breakpoint Information window, where you customize settings on the Hit Count and Action tabs.<br />

Change the Hit Count<br />

You can control the number of times a breakpoint must be hit and when the break occurs. For example, to<br />

break when the condition is met twice, select break when the hit count is equal to and type 2 on the Hit<br />

Count tab.<br />

Define an Action<br />

You also have the option of defining a JSL expression or script that the Debugger executes when a<br />

breakpoint is hit and execution has stopped. This script is called an action. On the Action tab, enter the JSL<br />

expression to be executed.<br />

Run the Script to the Cursor<br />

When you right-click and select Run To Cursor, all expressions before the location of the cursor are<br />

executed. Select this option when you only want to see values up to the current line. To see values when each<br />

expression is executed, use the stepping options.<br />

Tips for Setting Breakpoints<br />

• If you do not want to watch for errors in a specific loop, set a breakpoint after the loop ends. The<br />

Debugger will hit the next breakpoint rather than stepping through each line of the loop.<br />

• Avoid inserting a breakpoint in lines that do not trigger an action (such as comments, blank lines, and<br />

end parentheses). Debugger will not break on these lines.<br />

• When you insert breakpoints, close Debugger, and edit the script, the breakpoints remain on the<br />

original line numbers. You might need to delete and then reinsert the breakpoints.<br />

• Breakpoints are remembered across Debugger sessions. This means that your breakpoints list includes<br />

breakpoints that have been set in all scripts, not just the script that you are currently debugging.<br />

• Breakpoints are remembered by the Debugger session, not by each script. This means that breakpoints<br />

are listed even for scripts that have been moved or deleted.<br />

• On the Breakpoints tab, click to remove all breakpoints in scripts whether they are currently open<br />

or not, or for scripts that no longer exist.

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

Saved successfully!

Ooh no, something went wrong!