To combine the individual result tables you can use the CASL function COMBINE_TABLES.
You can use the SAVERESULTS statement to write to a CAS table, this allows for a dynamic name, this is not possible for a SAS data set.
See this example:
cas sugus sessopts=(caslib="casuser");
libname casuser cas caslib="casuser";
data casuser.cars;
set sashelp.cars;
run;
proc cas;
action simple.mdSummary result=res status=s /
inputs={"Horsepower", "Invoice", "Length" },
subSet={ "mean", "N"},
sets={
{groupBy={"origin"}}
{groupBy={"origin", "type"} }
},
table={ name="cars"}
;
run;
describe res;
run;
do i=1 to 2;
s=combine_tables(res, cats("ByGroupSet", i));
table = cats("summary_a", i);
saveresult s casout=table caslib="casuser" replace;
end;
run;
quit;
... View more