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
SAS Super FREQ

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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 590 views
  • 2 likes
  • 3 in conversation