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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1362 views
  • 0 likes
  • 2 in conversation