BookmarkSubscribeRSS Feed
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. 




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

You need to GROUP your grpxsort2variable in the define statement. 

define grpxsort2/ group noprint; 


Fluorite | Level 6
It is still the same as previous output.
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

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 $;
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 "";
	compute after grp2;
		line @1 "";
ods rtf close;



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


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



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 4 in conversation