Hi,
in creating report, I am trying to list the first and last names of individuals with a count of surveys completed. In my report, one individual may be listed more than once, however proc report leaves a blank space (to represent a duplicated name). Is there any way to have the name printed again, instead of leaving blank?
proc report data=ITr out=ITre(drop=_break_) nowd;
column ID LName FName survey n;
define ID/Group;
define LName/Order 'Last';
define FName/Order 'First';
define survey/across 'surveys for 2018';
rbreak after / dol skip summarize ;
compute after;
ID='Total';
endcomp;
run;
thanks! Is there any way I could do order and display for the ID? Id the the ID to show up both times as well.
Hi:
Without data, it's hard to run your code, especially since you have an ACROSS variable. However, the issue of blanks for ORDER or GROUP items will happen whether you have ACROSS variables or not.
But, making some fake data based on SASHELP.CLASS,
and then running PROC REPORT, you can see where the duplicate values were suppressed. However you can cause PROC REPORT to "fill-in" the blanks for you using a COMPUTE blocks, like this:
and there is an alternate coding technique that would produce the same results. You can make all the changes in the COMPUTE block for name because of the left-to-right rule of PROC REPORT, the COMPUTE block for NAME can "touch" the cells for ID and CHARAGE in order to fill in the blanks The changed code is shown below. The rest of the REPORT code is the same:
Hope this helps,
Cynthia
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.