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

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