ASTORE Procedure

Example 4.3 Describing and Scoring with Options

This example uses the SETOPTION statement to set options when you describe and score an analytic store. It first creates an analytic store that can be used together with the SETOPTION statement, and then it uses the ASTORE procedure to describe and score the analytic store in accordance with the options that you set.

The following DATA step code creates the data table mylib.baseball by loading the baseball data set, which is available in the Sashelp library that SAS provides:

data mylib.baseball;
   set sashelp.baseball;
run;

The following PROC REGSELECT call trains a GLM model on the mylib.baseball table. The model predicts the natural logarithm of a Major League Baseball player’s salary on the basis of their league, number of hits, and number of home runs. The STORE statement saves the model’s state in an analytic store, which is stored in the mylib.baseballsave table.

proc regselect data=mylib.baseball;
   class league;
   model logSalary = league nHome nHits;
   store mylib.baseballsave;
run;

The following PROC ASTORE call sets the COMPUTE_CONFIDENCE_LIMIT option to 1 via the SETOPTION statement and then describes the contents of the analytic store via the DESCRIBE statement:

proc astore;
   setoption COMPUTE_CONFIDENCE_LIMIT 1;
   describe rstore=mylib.baseballsave;
quit;

Output 4.3.1 includes the following ODS tables:

  • The "Store Key" table displays the string identifier of the store.

  • The "Basic Information" table displays the analytic engine that produced the store and the time when the store was created by processing a SAVESTATE statement.

  • The "Input Variables" table displays the input variables.

  • The "Output Variables" table displays the output variables. Note that there are additional variables related to the confidence limit because the COMPUTE_CONFIDENCE_LIMIT option was set to 1.

Output 4.3.1: Output Tables from the DESCRIBE Statement

The ASTORE Procedure

Store Key
2E6649EED53BF66EFFFD2A9A2B86AA9FD91D1984

Basic Information
Analytic Engineglm
Time Created22May2023:14:42:16

Input Variables
NameLengthRoleTypeRawTypeFormatName
League8InputClassificationCharacter 
nHits8InputIntervalNum 
nHome8InputIntervalNum 

Output Variables
NameLengthTypeLabel
P_logSalary8NumPredicted: logSalary
_h_8NumLeverage
_lcl_8NumLower Bound of 95% C.I.(Individual Pred)
_ucl_8NumUpper Bound of 95% C.I.(Individual Pred)
_lclm_8NumLower Bound of 95% C.I. for Mean
_uclm_8NumUpper Bound of 95% C.I. for Mean
_stdi_8NumStandard Error of Individual Prediction
_stdp_8NumStandard Error of Mean Predicted Value


The following PROC ASTORE call sets the ALPHA option to 0.01 and the COMPUTE_CONFIDENCE_LIMIT option to 1 via the SETOPTION statement, and then it scores the mylib.baseball table on the analytic store to produce the output data table mylib.baseballout. Note that multiple options are set using multiple SETOPTION statements. The first observation of the mylib.baseballout table is shown in Output 4.3.2. You can see the additional output variables there because the COMPUTE_CONFIDENCE_LIMIT option is set to 1, and the confidence interval values that are shown are influenced by the ALPHA option being set to 0.01.

proc astore;
   setoption ALPHA 0.01;
   setoption COMPUTE_CONFIDENCE_LIMIT 1;
   score data=mylib.baseball
         rstore=mylib.baseballsave
         out=mylib.baseballout;
quit;
proc print data= mylib.baseballout (obs=1);
run;

Output 4.3.2: First Record of the Scoring Results

ObsP_logSalary_h__lcl__ucl__lclm__uclm__stdi__stdp_
15.314350.0158193.310777.317935.064325.564380.772110.096353


Last updated: August 06, 2026