Dear all,
I have created a ODS excel report with proc report, I have noticed in one of the excel outputs that one table should be reflecting the Median values instead of sum.. I tried changing this in the proc report statement:
define Numbers/group median style={tagattr='format:#,###'} center; /** changed sum to median**/ but it doesnt work.
I tried changing in the base data set in sas using proc sql query, still no use.
Request you to kindly suggest any syntax or anything.I am using SAS 9.3 currently..
Many thanks.
Its generally not a good idea to do processing in proc report, as that is a reporting function. Use proc means before that to get the data in the way you want then a simple proc report to output the data. Don't think report can even do the more complicated calculations.
proc means data=yourdata; by id; var thevar; output out=want median=median; run;
Shows and example use of proc means (as you haven't shown any test data or code this is just an example).
You can use statistics only on analysis variables. See the documentation for this:
statistic
associates a statistic with an analysis variable. You must associate a statistic with every analysis variable in its definition. PROC REPORT uses the statistic that you specify to calculate values for the analysis variable for the observations that are represented by each cell of the report. You cannot use statistic in the definition of any other type of variable.
(emphasize by me)
ODS EXCEL isn't supported in SAS 9.3
Are you using ODS TAGSETS.EXCELXP or something else?
@don21 wrote:
Dear all,
I have created a ODS excel report with proc report, I have noticed in one of the excel outputs that one table should be reflecting the Median values instead of sum.. I tried changing this in the proc report statement:
define Numbers/group median style={tagattr='format:#,###'} center; /** changed sum to median**/ but it doesnt work.
I tried changing in the base data set in sas using proc sql query, still no use.
Request you to kindly suggest any syntax or anything.I am using SAS 9.3 currently..
Many thanks.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.