BookmarkSubscribeRSS Feed
NEWMANSAS
Fluorite | Level 6

Hi Community,

 

I'm trying to get a proper break (blank rows) between  each group and at start and end of the table body, however later part is not working with my current setting of logic. Alongside, blank rows in between each AEBODSYS, I also want to see spaces at highlighted points. 

 

space issue.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

The data ( variable used to get the spaces is grpxSort2) as shown here: However, with current SAS logic, I'm not able to get the proper formatting. Any suggesting please? Thanks in advance. 

 

 

snap_data.PNGsnap_code.PNG

6 REPLIES 6
NEWMANSAS
Fluorite | Level 6
The output destination is RTF
A_Kh
Lapis Lazuli | Level 10

You need to GROUP your grpxsort2variable in the define statement. 

define grpxsort2/ group noprint; 

 

NEWMANSAS
Fluorite | Level 6
It is still the same as previous output.
ballardw
Super User

If you want a working solution you need to provide:

1) actual data in the form of data step code so we have something besides a picture to test code with

2) the complete proc report code you are attempting. Simple things like the order of variables on a columns statement have a big impact on the behavior of proc report not to mention any other proc options. Code should be TEXT. I am afraid that very few of us are going to retype significant elements from a picture. It should be easier to copy code from the editor, or log results, and then paste the copied text into a text box opened on the forum using the </> icon that appears above the message window than to make a picture and attach that.

3) an actual description of the desired formatting. I am not sure exactly what you are expecting. I am afraid that pictures and arrows don't quite tell us if something appears BEFORE or AFTER a value or what the actual conditions based on the data may be.

 

Also the LOG often includes clues about when the procedure is overriding a syntax issue or incorrect use of an option. So an example log

A_Kh
Lapis Lazuli | Level 10

If you only need lines on the top and the bottom of your report, try to group also grpxsort1 variable, and add another compute block to add a line before, that's something like this:

data have;
infile cards dsd;
	length ae $25;
	input grp1 grp2 ae $;
	cards;
1, 0, List of AE by group
1, 1, Group 1 Disorders
1, 1, Nausea
1, 1, Anaemia
1, 1, Vomiting
1, 2, Group 2 Disorders
1, 2, Pyrexia
1, 2, Fatigue
1, 2, Malaise
;
proc print;run; 

ods rtf file= "&lib\have.rtf";
proc report data=have ;
	column grp1 grp2 ae;
	define grp1/ group noprint;
	define grp2/ group noprint;
	define ae/ 'Adverse Events' display;
	compute before grp1;
		line @1 "";
	endcomp;
	compute after grp2;
		line @1 "";
	endcomp; 
run; 
ods rtf close;

  Output:

d202d692-55fe-46cc-a5a0-50faf0e79e26.png

 Style attributes could be added to apply a desired indentation and format.  

 

Ksharp
Super User
compute before ;
line " ";
endcomp;
compute after ;
line " ";
endcomp;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 6 replies
  • 960 views
  • 0 likes
  • 4 in conversation