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
Diamond | Level 26
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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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