Previous Page | Next Page

SAS Component Language Dictionary

OPTSETC and OPTSETN



Assign a value to a SAS system option
Category: SAS System Option

Syntax
Details
Examples
Example 1: Using the OPTSETC Function
Example 2: Using the OPTSETN Function
See Also

Syntax

rc=OPTSETC(option-name,cval);
rc=OPTSETN(option-name,nval);

rc

contains the return code for the operation:

0

successful

[ne]0

not successful

Type: Numeric

option-name

is the name of the character SAS system option to set.

Type: Character

cval

is the new character setting for the option.

Type: Character

nval

is the new numeric setting for the option. For options with binary settings of ON and OFF, specify an nval of 1 to turn the option on and 0 to turn it off.

Type: Numeric


Details

If you try to use OPTSETC to assign a value to a numeric option or OPTSETN to assign a value to a character option, an error message is generated. To determine whether a SAS system option has a numeric or character setting, see the SAS documentation for your operating environment or SAS Language Reference: Dictionary.

For options that have ON/OFF settings (for example, DATE/NODATE), use OPTSETN, because the options have the numeric values 1 for ON and 0 for OFF.

You can view current option settings by using the OPTIONS procedure in the SAS session or by using the OPTIONS command.


Examples


Example 1: Using the OPTSETC Function

Set the COMPRESS option to allow compression of new SAS tables:

rc=optsetc('compress','yes');


Example 2: Using the OPTSETN Function

Turn on the CAPS option:

rc=optsetn('caps',1);


See Also

OPTGETC and OPTGETN

Previous Page | Next Page | Top of Page