04-26-2017 10:32 AM
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];
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.
04-26-2017 10:53 AM
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.
04-26-2017 10:58 AM
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.