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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 731 views
  • 2 likes
  • 3 in conversation