

libname example sasiola host="grid001.example.com" port=10010 tag='hps';
data example.train example.validate;
set sashelp.heart;
flag=ranuni(12345);
if flag <= .7 then output example.train;
else output example.validate;
run;
proc imstat;
table example.train;
decisiontree Weight / input=(Sex DeathCause
Chol_Status
BP_Status Weight
Smoking_Status)
nbinstarget=5
temptable 1
vars=(Sex DeathCause
Chol_Status
BP_Status Weight
Smoking_Status)
nomissobs;
run;
table example.&_temptree_; 2
/* tableinfo; */
/* columninfo; */
fetch _CI0_ _CI1_ _Val0_ _Val1_ _Parent_ -- _TargetUpperbd_
/ from=1 to=10 format;
run;
table example.&_tempscore_; 3
/* tableinfo; */
/* columninfo; */
where _NodeList2_=6;
fetch / from=1 to=5 format;
run;
where; /* clear the WHERE clause */
decisiontree Weight / treelasr=example.&_temptree_ 4
scoredata=example.validate
temptable
vars=(Sex DeathCause
Chol_Status
BP_Status Weight
Smoking_Status);
run;
table example.&_tempscore_;
fetch / from=1 to=5 format;
run;

NOTE: The misclassification rate for scoring the decision tree is 0.368401
using table EXAMPLE.HEART with 5209 records out of 5209.