BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Daily1
Quartz | Level 8
data have;
	set sashelp.cars;
	where type = 'Sedan' and drivetrain = 'All' and msrp < 35000;
	sr=_N_;
	keep sr origin make model msrp;
run;

proc report data=have out=rect;
	columns sr origin make model msrp;
	define sr / order noprint;
	compute after sr;
		length linetext $200.;
		if sr=6 or  sr=8 then
			linetext = ' ';
		line linetext $200.;
	endcomp;
run;

i want blank line after sr=6 and sr=8

Daily1_0-1689657571116.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
data have;
 set sashelp.cars;
 where type = 'Sedan' and drivetrain = 'All' and msrp < 35000;
 sr=_N_;
 keep group origin make model msrp; /*<-----------*/

 if sr=7 or  sr=9 then group+1;  /*<-----------*/
run;

proc report data=have nowd;
 columns group origin make model msrp;
    define group/order noprint;
compute before group;
 n+1;x=' ';
 if n=1 then len=0;else len=10;
 line x $varying10. len;
endcomp;
run;

Ksharp_0-1689680292827.png

 

View solution in original post

3 REPLIES 3
Daily1
Quartz | Level 8
Not Working
Ksharp
Super User
data have;
 set sashelp.cars;
 where type = 'Sedan' and drivetrain = 'All' and msrp < 35000;
 sr=_N_;
 keep group origin make model msrp; /*<-----------*/

 if sr=7 or  sr=9 then group+1;  /*<-----------*/
run;

proc report data=have nowd;
 columns group origin make model msrp;
    define group/order noprint;
compute before group;
 n+1;x=' ';
 if n=1 then len=0;else len=10;
 line x $varying10. len;
endcomp;
run;

Ksharp_0-1689680292827.png

 

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 3 replies
  • 1313 views
  • 5 likes
  • 3 in conversation