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