Chapter Contents

Previous

Next
Command Directory

scope

Change Command Scope

ABBREVIATION
sc{ope}

FORMATS

Format 1: scope
FUNCTION-NAME
Format 2: scope
+INTEGER
Format 3: scope
-INTEGER
Format 4: scope

DESCRIPTION
The scope command is used to change command scope. Normally, command scope is identical to run scope, which is the term used to described the location where the debugger stops when you are given control. In full-screen mode, the code displayed in the Source window is that around the line where execution stopped. The line where execution stopped is highlighted and its location is displayed as run scope in the Status window.

Commands that manipulate expressions refer to the identifiers (variables, structures, and so on) that are visible as you need to look at source code or examine variables in a facility. This process allows you to specify a command scope that is different from the run scope.

Format 1: This format changes the command scope to the function named by the FUNCTION-NAME argument. This argument must name a function in the calling sequence, If there are multiple instances of the function identified by FUNCTION-NAME, command scope is set to the most recent.

Format 2: This format changes command scope to that of a function that is farther up in the calling sequence. The INTEGER argument specifies the number of functions up in the calling sequence to change the command scope.

Format 3: This format changes command scope to that of a function that is farther down in the calling sequence. The INTEGER argument specifies the number of functions down in the calling sequence to change the command scope.

Format 4: This format sets command scope back to run scope.

The following commands use command scope to resolve references to all identifiers:


The following commands use command scope to supply default function or section names:


The transfer command in a nonexpression context and all other commands use run scope if a scope is needed for resolution.

In either line mode or full-screen mode, you can use the where command to see where you are in the calling sequence. If command scope is different from run scope, it is indicated by an asterisk next to the line number in the calling trace list displayed by the where command. Run scope is always the first location in the calling trace list.

EXAMPLES

scope stats
changes command scope to the stats function.

scope - 1
changes command scope to the function that is one position up in the calling sequence: the caller. For example, if function a called function b , and your command scope is in function b , then command scope is changed to function a by this command.

scope + 1
changes command scope to the function that is one position down in the calling sequence: the callee. For example, if function a has already called function b , and you have changed your command scope to function a , then command scope is changed back to function b by this command.

scope
When using the INTEGER argument with the scope command, command scope is used to determine to which function in the calling sequence to move.

ADDITIONAL DISCUSSION AND EXAMPLES
See Using the Status Window.

SYSTEM DEPENDENCIES
none

COMMAND CAN BE ISSUED FROM

PROFILE no
configuration file no
Source window prefix none

SCOPE
The scope command is used to change command scope.

RETURN CODES SET
Successful: 0
Unsuccessful: 1

SEE ALSO
where


Chapter Contents

Previous

Next

Top of Page

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