BookmarkSubscribeRSS Feed
mariko5797
Pyrite | Level 9

I only have subheaders for select columns. For the columns that there are no subheaders, I would prefer there to be one singular cell. 

Current Output:

 

Study Daya

Treatment Groups

 

Group A

Group B

Total

 Want:

Study Daya

Treatment Groups

Group A

Group B

Total

Note: Study Day spans two columns which are defined by day (e.g. Day 1, Day 2, etc) and the milestone (e.g. Blood Draw 1). Treatment groups are each one column and contain counts.

 

%let title= %str(Study Status: Number of Subjects Completing Study Milestones);

%report(2C_milestone);
proc report data= _milestone nowd split= '|' %reportstyle;
 columns ("Study Day^{super a}" milestone milestone2) ("Treatment Groups" a b /*c d e*/ f);
 	define milestone  / "" order= internal format= dy.  style(column)= [just= left vjust= t];
	define milestone2 / "" order= internal format= mil. style(column)= [just= left vjust= t];
	define a 		  / "Group A" center;
	define b 		  / "Group B"	center;
	/*define c 		  / "Group C" center;*/
	/*define d 		  / "Group D"	center;*/
	/*define e 		  / "Group E" center;*/
	define f 		  / "Total"	center;

 compute after / style= [just= l];
 	line "Note: Percentages reflective of ongoing status of the trial.";
	line "^{super a} The study schedule for Group C differs from Groups A, B, D, and E.
 When Study Day differs between treatment groups, the Study Day is listed for Groups A, B, D, and E followed by the Study Day for Group C.";
 endcomp;
run;

ods word close;

%report defines options, layout, and ods word file.

	ods word file= "&file.\&filename..docx" style= cword startpage= no options(cant_split= 'on' keep_next= 'off' keep_lines= 'on');

%reportstyle defines font style and size.

%macro reportstyle;
	style(report)=[cellspacing=0 width=100%]
	style(header)=[just=center vjust=b font_size=9pt fontfamily="Times New Roman"]
	style(column)=[just=center vjust=b font_size=9pt fontfamily="Times New Roman"]
	style(lines)=[bordercolor=black];
%mend;
4 REPLIES 4
JosvanderVelden
SAS Super FREQ
I'm not sure if this can be achieved in proc report. Proc document (ODS) would allow to do colspan and rowspan for the header. See example 3: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsadvug/p1ki00t96zkir2n1g6l4eczqbgrk.htm#n1x...
yascm
Fluorite | Level 6

I'm looking for this too, haven´t had any success.

 

I have this header,

yascm_2-1675109593950.png

 

And I want this header,

yascm_3-1675109717606.png

 

Cynthia_sas
SAS Super FREQ
Hi, Unfortunately, your screen shot is too small to see. Even using the Zoom function, the headers become all pixellated and not readable. Also, the white font on the current background is also unreadable. It looks like the suggestion posted was for an HTML/CSS solution and I'm not sure that would work for ODS WORD or ODS RTF. Microsoft designed their own version of CSS that was different than the CSS used with HTML, so that might now work. You might have to move to the Report Writing Interface to get the type of headers you want. But without your code AND your data or some dummy data to test with, it's hard to do more than make a comment.
Cynthia
ballardw
Super User

@yascm wrote:

I'm looking for this too, haven´t had any success.

 

I have this header,

yascm_2-1675109593950.png

 

And I want this header,

yascm_3-1675109717606.png

 


Start your own question, provide some example data in the form of a data step and your code. Since it appears that you may be playing with ODS Style options include your entire ODS destination code as well.

 

Hint: displaying something where every single value is Text doesn't give much clue as to what is going on.

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