BookmarkSubscribeRSS Feed
tburus
Obsidian | Level 7

Is it possible to have PROC REPORT only add horizontal lines between the first set of group variables in the call? I have the following code:

 

proc report data=top_inj_pct(where=(event_type=2)) spanrows
		style(report)=[frame=hsides rules=rows]
		style(header)=[background=white color=&Dblack.]
		style(lines)=[background=white];
	column injury_or_illness_code injpct TL_pct top_mech top_act;
	define injury_or_illness_code / group left 'Injury' order=data
		style(column)=[cellwidth=2in];
	define injpct / group 'Of All Injuries' style(column)=[just=c];
	define TL_pct / group 'Resulting in Time Loss*' style(column)=[just=c];
	define top_mech / group "Common Injury Mechanisms" order=data;
	define top_act / group "Common Activities" order=data;
run;

This produces the following output:

table.png

I would like to have the lines that span the table, without getting the additional lines on the right side. Thanks.

6 REPLIES 6
ballardw
Super User

Which ODS style are you using?

ballardw
Super User

@tburus wrote:
I ma using ODS RTF

That is your ODS destination. The Style controls the colors and appearance of lines and text.

 

Without any data it is also hard to test code.

I would suggest that possibly you could try making your Top_mech and top_act variables Order variables as I don't see anything appearing to the right of them than needs to be "grouped".

tburus
Obsidian | Level 7

Sorry, I was working to quickly and misread the question. I am using the default style. 

 

My output doesn't change if I change these into order variables. Even if I turn everything into order variables, the output doesn't change. I tried using group only on the first variable ("injury_or_illness_code") and then "rules=groups", but this gave me no horizontal lines inside the table.

ballardw
Super User

You might see what the JOURNAL style does to the output.

You can specify a different style than your current default on a the proc statement such as

Proc report   data=...   style=Journal.

 

No promises without actual data.

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.

ghosh
Barite | Level 11

Could you provide some data to test?

 

For starters remove rules=rows in line 2

 

Then perhaps apply a style to the first group using a compute block, such as:

compute after injury_or_illness_code /
        style={borderbottomwidth=1pt borderbottomcolor=black};
  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
  • 1187 views
  • 1 like
  • 3 in conversation