BookmarkSubscribeRSS Feed
JibJam221
Obsidian | Level 7

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;

3 REPLIES 3
Reeza
Super User
Try adding display as an option after the slash.
JibJam221
Obsidian | Level 7

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. 

Cynthia_sas
Diamond | Level 26

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,

show_default_blanks.png

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:

report_method1.png

 

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:

report_method2.png

 

Hope this helps,

Cynthia

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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