Hi ed_sas_member , Appreciate your advice. The reason I stick to proc print as I've more 10 variables on my dataset. Can you help me to check on my follows code as I would like to show the date as One day before "Today -1" title j = left "THE FIRST FIVE OBSERVATIONS OUT OF 19 AS AT %TRIM(%QSYSFUNC(Today(),-1, NLDATE20.))"; ERROR: Expected close parenthesis after macro function invocation not found. ERROR: More positional parameters found than defined. Appreciate you can show me how can I use DO LOOP statement to spilt the dataset by Name and save it to excel worksheet and output name as the "Column Name" ODS EXCEL OPTIONS(AUTOFILTER="1-5" SHEET_NAME = "TERMINAL COMPARISON" EMBEDDED_TITLES='YES');
proc report data=sashelp.class (obs=5) nowd style(header)={backgroundcolor=lightblue fontweight=bold};
title j = left "THE FIRST FIVE OBSERVATIONS OUT OF 19 AS AT %TRIM(%QSYSFUNC(Today(), NLDATE20.))";
column Name Sex Age Height Weight;
define Name / display;
define Sex / display;
define Age / analysis; /* <--- specify analysis if you want to compute the total */
define Height / display;
define Weight / display;
rbreak after / summarize style={backgroundcolor=lightblue};
compute after;
if _BREAK_ = "_RBREAK_" then do;
Name="Total";
/* Specify _c3_ as "age" is the 3rd column in the report */
call define ('_c3_','style','style={BORDERBOTTOMSTYLE=SOLID BORDERTOPSTYLE=SOLID}');
end;
endcomp;
run;
ODS EXCEL CLOSE; Thanks in advance
... View more