BookmarkSubscribeRSS Feed
knveraraju91
Barite | Level 11

I need to add a line after a group variable. The following code works. The line appears after all groups of observations. But I need it have only after first group of observations. How to write a code.Thanks.

 

compute after grp/style={protectspecialchars=off};
line '\brdrt\brdrs ';
endcomp;

1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
First, style=journal goes on the ODS statement, NOT on the PROC REPORT statement.
Second, a LINE statement is executed EVERY time the break occurs, so the only thing you can do to write the line "conditionally" is to make a text variable to hold the text you want for the occurrence. Then you use a different form of the compute block as explained in this Tech Support note: http://support.sas.com/kb/37/763.html (The second code example that uses $varying. is the one you want to follow.)

cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1 reply
  • 1517 views
  • 0 likes
  • 2 in conversation