Chapter Contents

Previous

Next
SAS/SHARE User's Guide

Default Circumstances for Selected SAS Operations

Knowledge of the default data objects and how they are accessed will help you to anticipate the behavior of certain operations when you write your application or issue SAS statements in interactive mode. Default Circumstances for Selected SAS Operations presents the default circumstances for some frequently used SAS operations.

Default Circumstances for Selected SAS Operations
Typical Statements and Commands How Object Is Locked What Object Is Locked
DATA step


DATA statement with MODIFY statement update observation

DATA statement without MODIFY statement output member

SET statement without POINT= and KEY= options input observation

SET statement with POINT= and KEY= options input member

MERGE statement input observation

MODIFY statement without POINT= and KEY= options update observation

MODIFY statement with POINT= and KEY= options update member

UPDATE statement input observation
Procedures


APPEND procedure



BASE= option update observation


DATA= option input observation

COPY procedure



IN= option input observation



IN= option with MOVE option output observation


OUT= option output member

FSBROWSE procedure



DATA= option input observation

FSEDIT procedure



DATA= option update observation

FSVIEW procedure




DATA= option without EDIT option input observation



DATA= option with EDIT option update observation

PRINT procedure



DATA= option input observation


UNIFORM= option input member

SORT procedure



DATA= option input observation


OUT= option output member

SQL procedure



CREATE TABLE statement output member


DELETE statement update observation


INSERT statement update member


UPDATE statement update member


Changing the Data Set Option Default Object

In some cases, you can change the SAS data set option default object. When the syntax of a statement or a command allows you to specify SAS data set options, you can use the CNTLLEV= option to override the default object and specify the object that you want, instead.

For example, for a SET statement that contains the POINT= option, you can change the default from member to observation by specifying the CNTLLEV= data set option:

set datalib.fuel (cntllev=rec) point=obsnum;

Note:   If you make this change, the values in a specific observation may differ each time that you read the observation.  [cautionend]

Note:   The value, rec (for record), means the same as observation.  [cautionend]

You can also change observation to member. You might do this to ensure that a data set does not change while you are processing it. For example, if you use a SET statement with a BY statement and you cannot use an index to retrieve the observations in sorted order, you can use the CNTLLEV= option to re-set observation to member.

set datalib.fuel (cntllev=mem);
by area;

In some cases, you cannot override the default setting because the statement or the command requires it. For example, a DATA statement requires a member setting when the MODIFY statement is omitted from the DATA step. Without the MODIFY statement, the data set that is specified in the DATA statement must be opened for output. Thus, even if you specify CNTLLEV=REC in such a DATA statement, the DATA step tries to set the object as member but will fail if other operations are accessing the data set.

Note:   Be careful when using the CNTLLEV= option for a procedure. Some procedures make multiple passes through an input data set and require that the data remains the same to guarantee the integrity of the output. If they have this requirement, such procedures issue a warning but allow their objects to be re-set with the CNTLLEV= option.  [cautionend]

For details about the syntax of the CNTLLEV= option in the SET statement, see The CNTLLEV= Data Set Option.


Chapter Contents

Previous

Next

Top of Page

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