This section applies to actions in the following action sets: clustering, pca, phreg, quantreg, and regression.
The code parameter writes SAS DATA STEP code for computing predicted values of the fitted model to a file or to a CAS table. For survival actions, the predicted values may include survival probabilities and cumulative hazards at specific time points. To score new data, you can then include the file in a DATA step, or you can specify the CAS table in the runCodeTable action in the dataStep action set.
The subparameters that you can specify are described in the Syntax section of the specific action chapters. If you do not specify a casOut subparameter, then the SAS scoring code is written to a table named _code_.
For example, in the following CASL program, the code parameter writes the code for computing predicted values from the model to the file mycode.sas. The file is subsequently included in a DATA step to score the sashelp.one data, which should include the y and x columns.
proc cas;
regression.glm
table='mycas.mydatatable',
model={depVar='y',
effect='x'},
code={casout='mycode'};
run;
proc cas;
runCodeTable / codetable='mycode' table='one' casout='myscore';
run;