SCOREACCEL Procedure
Example 1: Publish, Run, and Delete a DATA Step Model in CAS
| Features: |
CAS LIBNAME statement PROC SCOREACCEL statement PUBLISHMODEL statement RUNMODEL statement DELETEMODEL statement |
Details
In this PROC SCOREACCEL example, a DATA step model is published and run in CAS. The model is then deleted.
PROC SCOREACCEL translates DATA step code into DS2 code on the SAS client.
Program
cas mysess1;
libname mycaslib cas casref=mysess1;
proc delete data=mycaslib.model01_score_data; run;
libname eminput "/mydir/scoring/model01";
data mycaslib.model01_score_data;
set eminput.traindata;
id=_n_; run;
quit;
proc scoreaccel sessref=mysess1;
publishmodel
modelname="model01"
modeltype=datastep
modeltable="modeltable1"
programfile="/mydir/scoring/model01/score.sas"
xmlfile="/mydir/scoring/model01/score.xml"
outdir="/user1/score/work/"
modelnotes="Simple model01 test model"
promotetable=no
persisttable=no
;
quit;
proc delete data=mycaslib.model01out_data run;
proc scoreaccel sessref=mysess1;
runModel
modelname="model01"
modeltable="modeltable1"
intable="model01_score_data"
outtable="model01_out_data"
;
quit;
proc scoreaccel sessref=mysess1;
deletemodel
modelname="model01"
modeltable="modeltable1"
;
quit;
Program Description
Assign a CAS LIBNAME.The CAS LIBNAME is passed to the DATA step in PROC
DELETE.
cas mysess1;
libname mycaslib cas casref=mysess1;
Create an input scoring table in CAS.The DELETE procedure removes an existing input scoring
table.
proc delete data=mycaslib.model01_score_data; run;
libname eminput "/mydir/scoring/model01";
data mycaslib.model01_score_data;
set eminput.traindata;
id=_n_; run;
quit;
Publish a model in CAS.The DATA step model is converted to DS2 in this step and is
published in CAS.
proc scoreaccel sessref=mysess1;
publishmodel
modelname="model01"
modeltype=datastep
modeltable="modeltable1"
programfile="/mydir/scoring/model01/score.sas"
xmlfile="/mydir/scoring/model01/score.xml"
outdir="/user1/score/work/"
modelnotes="Simple model01 test model"
promotetable=no
persisttable=no
;
quit;
Run the model in CAS.The DELETE procedure removes an existing CAS table before running
the model.
proc delete data=mycaslib.model01out_data run;
proc scoreaccel sessref=mysess1;
runModel
modelname="model01"
modeltable="modeltable1"
intable="model01_score_data"
outtable="model01_out_data"
;
quit;
Delete the model from the model table in CAS.
proc scoreaccel sessref=mysess1;
deletemodel
modelname="model01"
modeltable="modeltable1"
;
quit;
Last updated: September 15, 2026