

libname example sasiola host="grid001.example.com" port=10010 tag='hps';
data example.stocks;
set sashelp.stocks;
run;
proc imstat data=example.stocks;
where stock="IBM";
aggregate close (agg=min) close (agg=max) close (agg=mean) 1
/ id=date idstart='01jan1998'd idend='31dec1998'd 2
interval="quarter"; 3
run;
where same and date >= '01jan2003'd; 4
aggregate close (agg=n) close (agg=mean) close (agg=stddev)
/ id=date idfmt="yyq6." interval="quarter" temptable; 5
table example.&_templast_;
fetch / format; 6
quit;
