BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
don21
Quartz | Level 8

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.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
don21
Quartz | Level 8
I have ungrouped my sas dataset and used it again for median under ODS proc reports, and it is working now. 🙂

View solution in original post

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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).

Kurt_Bremser
Super User

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)

 

Reeza
Super User

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.

 

 


 

don21
Quartz | Level 8
I have ungrouped my sas dataset and used it again for median under ODS proc reports, and it is working now. 🙂

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1538 views
  • 0 likes
  • 4 in conversation