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.

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

Debug Scripts<br />

View Variables<br />

The variables lists are populated as they appear in the script. Their values are updated every time the script<br />

changes them. If you are uncertain why a variable has a particular value when you run your script, you can<br />

watch its value at every step to see what happens.<br />

You can also assign the variables whatever value you want. For example, if you are stepping through a For()<br />

loop but are interested only in what happens starting with a particular iteration, you can assign your<br />

iterating variable that value. Step through the first part of the loop that initializes the iteration variable and<br />

then assign it the value that you want in the variable list at the bottom. Then when you step through, the<br />

loop begins executing at that point.<br />

Tips for Managing Variables<br />

• If you have run several scripts using the global scope, you might want to clear or delete global variables.<br />

This makes the list of variables in the Debugger shorter and relevant. Use the Delete Symbols()<br />

function to do so. You can also close JMP and restart to clear the space.<br />

• If your script uses so many variables that they are difficult to find and watch in the variable lists, add<br />

watches for the specific variables in which you are interested.<br />

Work with Watches<br />

JMP preserves the Watch variables across sessions. So when you close and reopen JMP, the Watch variables<br />

are still listed on the Watch tab.<br />

Create a Watch<br />

• On the Watch tab, click and enter the value in the window.<br />

• In the Debugger, right-click the line that you want to watch, select Add Watch, and then enter the<br />

variable name in the window.<br />

• In the Debugger, place the cursor in or next to a variable name (or select the variable name), right-click,<br />

and select Add Watch.<br />

• On the Watch tab, enter the variable in an empty Variable field.<br />

Modify a Watch<br />

Do one of the following on the Watch tab to enter a new value:<br />

• Select the watch and click .<br />

• Click in the Variable field and enter a new value.<br />

Delete Watches<br />

Do one of the following on the Watch tab to delete watches:<br />

• Select the watch and then click .

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

Saved successfully!

Ooh no, something went wrong!