Hey @acordes! One way to do this is to use the putn function on the Min/Max values in the result. For example:
proc cas;
simple.summary result=sumres /
subset={'min', 'max'}, inputs={{name='timestamp', format='datetime20.' nfl=30, nfd=30}},
attributes={{name='timestamp', format='datetime20.' nfl=30, nfd=30}},
table={caslib="casuser",name="test"};
print 'Min:' putn(sumres.summary[1, 'Min'], datetime20.);
print 'Max:' putn(sumres.summary[1, 'Max'], datetime20.);
run;
Another option is to output the table and use table.fetch:
proc cas;
simple.summary result=sumres /
subset={'min', 'max'}, inputs={{name='timestamp', format='datetime20.' nfl=30, nfd=30}},
attributes={{name='timestamp', format='datetime20.' nfl=30, nfd=30}},
table={caslib="casuser",name="test"}
casout={caslib="casuser",name="outsum",replace=True};
table.fetch /
table='outsum'
fetchvars={{name='_min_', format='datetime20.'}
{name='_max_', format='datetime20.'}
};
run;
Or, if you want to use a CAS-powered PROC, you can try MDSUMMARY and then print it with PROC PRINT:
proc mdsummary data=casuser.test;
var timestamp;
output out=casuser.outsum;
run;
proc print data=casuser.outsum;
format _min_ _max_ datetime20.;
var _min_ _max_;
run;
... View more