Chapter Contents

Previous

Next
Using Debugger Commands

Specifying Identifiers Outside the Current Function

For arguments of the types that are used in a WHEN clause or those accepted by commands that take expressions, you can specify a variable or a tag in a function in the calling sequence that is different from the current function.

To specify a function that is different from the function that you are in, use the following argument format:

    

FUNCTION-NAME:IDENTIFIER

 

FUNCTION-NAME is the name of a function in the calling sequence. The function must be active. (Use the where command [placeholder] to determine if a function is in the active calling sequence.)

For example, suppose your program has three functions: sub1 , sub2 , and sub3 . sub1 calls sub2 , and sub2 calls sub3 . A variable named check is declared in sub2 as auto int check . Assuming that check is visible at the point that sub2 called sub3 , you can print the value of check from sub3 using the following command:
print sub2:check

The colon is part of the syntax.

To print the sum of two variables in different functions, a in suba and b in subb , use the following command:
print suba:a + subb:b

Note:    You can also specify identifiers outside your current function by changing command scope. The scope command is used to change command scope. See Using the Status Window for a discussion of command scope and Command Directory for information about the scope command.  [cautionend]


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.