BookmarkSubscribeRSS Feed
Coooooo_Lee
Obsidian | Level 7

Hi,

 

I am working on PROC REPORT with across statement. 

I'd like to insert a blank row after each group which is defined by var3.

 

Finally, I want to get a table in 1.png

Below is my proc report code:

proc report data=mydata nocenter missing headline headskip split="\" spacing=0 FORMCHAR='|_---|+|---+=|-/\<>*' nowindows;

  column  var4  var3  var2,var1,var5,var6  dummy;
 
  define var4/group order=data left flow width=8 "name" id;
  define var3/ group noprint;

  define var2/'' across order=data ;
  define var1/'' across order=data ;
  define var5/ '' across order=data ;
  define var6/'' display left  width=6;
  define dummy/ noprint;

  compute dummy;     
	dummy = 1;   
  endcomp;

  break after var3/ skip;

  compute before _page_;
    line "_";
  endcomp;
  compute after _page_;
    line "_";
  endcomp;
run;

But what I can get are in part1.png and part2.png

 

Now, I have 2 questions:

1, why there is no blank row was inserted into the output?

2, how to control the blank row to show the output in 1.png? The skip break should depend on var3 instead of var4.

 

PNGs are in the zip file.

Thanks very much!

5 REPLIES 5
Coooooo_Lee
Obsidian | Level 7

Data was attached here. Thanks!

Tom
Super User Tom
Super User

If you want to post images so that users can see your issue use the Photos icon in the editor tool bar.   Most users will not want to download files.

SuryaKiran
Meteorite | Level 14

Hello,

 

Many people here can't open your attachments because of the restrictions they have. Please try to provide your data in the form of a data step and any images can be directly inserted here. 

Untitled.png

Check this how to add a line after a group;

proc report data=sashelp.cars(obs=50);
column make invoice msrp pct;
define make / group;
define pct / computed format=percent8.2 'PCT';
compute pct;
pct = invoice.sum / msrp.sum;
endcomp;
compute after make;
line ' ';
endcomp;
run; 

 

Thanks,
Suryakiran
Coooooo_Lee
Obsidian | Level 7

 

1.PNGAbove is what I want to get.

 

 

Below is how the outputs looks like.

 

part1.PNG

 

part2.PNG

 

Coooooo_Lee
Obsidian | Level 7

Hi guys,

 

Thanks for your comments

 

Now, I got the answer which is simple.

VAR3 should be defined before VAR4!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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