BookmarkSubscribeRSS Feed
datamgr85
Calcite | Level 5

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.

2 REPLIES 2
collinelliot
Barite | Level 11

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.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 919 views
  • 2 likes
  • 3 in conversation