In some SAS operations,
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
to specify the object that you want. For example, in a SET statement
that contains the POINT= option, you can change the default from
member to observation by specifying the CNTLLEV= data set option.
In this example, the value, REC (for record), means the same as observation.
set datalib.fuel (cntllev=rec) point=obsnum;
Note: If you make this change,
the values in a specific observation might differ each time that you
read the observation.
You can also change the data object 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 reset the data
object observation to member.
set datalib.fuel (cntllev=mem);
by area;
In some SAS operations,
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. Therefore, even if you
specify CNTLLEV=REC in such a DATA statement, the DATA step tries
to set the data object as member, but this will fail if other operations
are accessing the data set.
Note: Be careful when using the
CNTLLEV= option in 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 a procedure has this
requirement, a warning is issued but the procedure will allow its
objects to be reset if you use the CNTLLEV= option.
For details about the
syntax of the CNTLLEV= option in the SET statement, see CNTLLEV= Data Set Option in SAS Data Set Options: Reference.