The SAS Output Delivery System and reporting techniques

ODS proc report showing column totals instead of individual observations

Reply
Regular Learner
Posts: 1

ODS proc report showing column totals instead of individual observations

I have a dataset with 66 individual observations but the proc report is showing column totals instead and I don't know why. Here's my code:

 

*************

 

ods pdf (ID=work) file="Compliance.pdf" style=styles.plateau;

proc report data=compliance nowd;
column week complied enrolled rate;
define week       /"Week"      style=[cellwidth=30mm textalign=center];
define complied   /"Complied"  style=[cellwidth=30mm textalign=center];
define enrolled   /"Enrolled"  style=[cellwidth=30mm textalign=center];
define rate       /"Rate"      style=[cellwidth=30mm textalign=center];
run;

ods pdf (ID=work) close;

 

*************

 

As a workaround, I tried inserting "display" after each slash (e.g., define week /display "Week") and this fixed the problem but I don't know why it is necessary as I have never had to insert "display" to see individual observations in a proc report before.

PROC Star
Posts: 307

Re: ODS proc report showing column totals instead of individual observations

Posted in reply to datamgr85

I believe that numeric variables default to "sum" as the type, so without the alternate definition that is what the proc generates. I would assume that for week you want something like "group" or "order," though. If you did that, then if your variables are just one observation per week, the default sum would show the same as display.

Super User
Super User
Posts: 7,955

Re: ODS proc report showing column totals instead of individual observations

Posted in reply to datamgr85

Is week numeric?  If you don't specify display or such like, SAS will default usage depending on datatype (can't find what the defuault is right now).  So either always put the usage (always a good idea to be more verbose and clearer) or make week character.

Ask a Question
Discussion stats
  • 2 replies
  • 123 views
  • 2 likes
  • 3 in conversation