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.

Chapter 8 Programming Methods 213<br />

Advanced Scoping and Namespaces<br />

qualified and unqualified variable named references is important to understand. A qualified named<br />

reference uses the : and :: operators to provide specific information about where a referenced variable<br />

resides, or where it is created.<br />

Examples of qualified named references include the following:<br />

:var<br />

::globalvar<br />

datatable:var<br />

nsref:var<br />

"nsname":var<br />

An unqualified named reference provides no explicit information to completely identify where a variable<br />

resides or where it is created. No scoping operator (: or ::) is specified in the reference. To change the<br />

behavior of JMP when resolving unqualified named variable references, use the Names Default To Here<br />

function. For more details about variable name resolution, see the “Name Resolution” on page 97 in the<br />

“JSL Building Blocks” chapter.<br />

Table 8.8 Resolving Access to a Variable in JMP 8 versus JMP 9 and Later<br />

JMP 8<br />

JMP 9 and Later<br />

1. If it is followed by a pair of parentheses ( ), look it up as a function.<br />

2. If it is prefixed by : or an explicit data table reference, look it up as a data table column or table<br />

variable.<br />

3. If it is prefixed by ::, look it up as a global variable.<br />

4. Not applicable. If it is an explicit scope reference (such as<br />

group:vowel) look it up in the user-defined<br />

group namespace, which could be represented<br />

as a data table or namespace.<br />

5. If it is in a Local or Parameter function,<br />

look it up as a local variable.<br />

If it is in a Local or Parameter function,<br />

look it up as a local. If it is nested, repeat until<br />

a function call boundary is found.<br />

6. If it is in a user-defined function, look it up as a function argument or local variable.<br />

7. Not applicable. Look it up in the current scope and its parent<br />

scope. Repeat until the Here scope is<br />

encountered.<br />

8. Not applicable. Look it up as a variable in the Here scope.<br />

9. Look it up as a global variable.<br />

10. Look it up as a data table column or table<br />

variable.<br />

Look it up as a data table column or table<br />

variable.<br />

11. Look it up as a platform launch name (for example, Distribution, Bivariate, Chart, and so on).

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

Saved successfully!

Ooh no, something went wrong!