OPTLOAD Procedure

Example: Load a Data Set of Saved System Options

Features:

PROC OPTLOAD option: DATA=

Details

This example saves the current system option settings using the OPTSAVE procedure, modifies the YEARCUTOFF system option, and then loads the original set of system options.

Program

libname mysas "c:\mysas";
proc options option=yearcutoff;
run;
proc optsave out=mysas.options;
run;
options yearcutoff=2000;
proc options option=yearcutoff;
run;
proc optload data=mysas.options;
run;

proc options option=yearcutoff;
run;

Program Description

These statements and procedures were submitted one at a time and not run as a SAS program to allow the display of the YEARCUTOFF option.
Assign the libref.
libname mysas "c:\mysas";
Display the value of the YEARCUTOFF= system option.
proc options option=yearcutoff;
run;
Save the current system option settings in mysas.options.
proc optsave out=mysas.options;
run;
Use the OPTIONS statement to set the YEARCUTOFF= system option to the value 2000.
options yearcutoff=2000;
Display the value of the YEARCUTOFF= system option.
proc options option=yearcutoff;
run;
Load the saved system option settings.
proc optload data=mysas.options;
run;

Display the value of the YEARCUTOFF= system option.After loading the saved system option settings, the value of the YEARCUTOFF= option has been restored to the original value.
proc options option=yearcutoff;
run;

Log

The following is the SAS log output after submitting the previous statements and procedures:
1    libname mysas "c:\mysas";
NOTE: Libref MYSAS was successfully assigned as follows:
      Engine:        V9
      Physical Name: c:\mysas

2    proc options option=yearcutoff;
3    run;

    SAS (r) Proprietary Software Release xxx  TS1B0

 YEARCUTOFF=1920   Cutoff year for DATE and DATETIME informats and functions
NOTE: PROCEDURE OPTIONS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


4    proc optsave out=mysas.options;
5    run;

NOTE: The data set MYSAS.OPTIONS has 259 observations and 2 variables.
NOTE: PROCEDURE OPTSAVE used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


6    options yearcutoff=2000;

7    proc options option=yearcutoff;
8    run;

    SAS (r) Proprietary Software Release xxx  TS1B0

 YEARCUTOFF=2000   Cutoff year for DATE and DATETIME informats and functions
NOTE: PROCEDURE OPTIONS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


9    proc optload data=mysas.options;
10   run;

NOTE: PROCEDURE OPTLOAD used (Total process time):
      real time           0.06 seconds
      cpu time            0.01 seconds


11   proc options option=yearcutoff;
12   run;

    SAS (r) Proprietary Software Release xxx  TS1B0

 YEARCUTOFF=1920   Cutoff year for DATE and DATETIME informats and functions
NOTE: PROCEDURE OPTIONS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds