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

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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