BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
webart999ARM
Quartz | Level 8

Hi Folks,

 

Hope everyone is doing good.

Could you help me with one question regarding proc report?
Below is the part of my report which I need to update.

webart999ARM_0-1599740713704.png


First two columns highlighted with the black need to be moved up (mentioned with arrow).
I could not find the appropriate option to solve that 'problem'.
Below is the proc report of the above-mentioned report.

proc report data=final nowindows headline headskip split='^' style(header)=[cellspacing=0 ] style=[cellwidth=100%];
	   column I ord2 col1
	  ("~S={borderbottomcolor=black borderbottomwidth=1} &trt" col2 col3 ("~S={borderbottomcolor=black borderbottomwidth=1 cellheight =10% } TEXT" col4 col5)col6) ;
	  define I/order order=internal noprint;
	  define ord2/order order=internal noprint;
	  define col1 / display " " 							                    style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=16%];
	  define col2 / display "TEXT^300 mg^(N=%sysfunc(trim(&TEXT.)))"   	        style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	  define col3 / display "TEXT^300 mg^(N=%sysfunc(trim(&TEXT.)))"   	        style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	  define col4 / display "300 mg^(N=%sysfunc(trim(&TEXT.)))" 	            style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	  define col5 / display "600 mg^(N=%sysfunc(trim(&TEXT.)))" 				style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	  define col6 / display "All^300mg^Patients^(N=&TOT1.)" 					style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	

	  compute before i;
	  line "";
	  endcomp;
	  compute after ord2;
	  line "";
	  endcomp;

run;
ods rtf close;
ods listing;



Thank you in Advance
Artur












1 ACCEPTED SOLUTION

Accepted Solutions
Oligolas
Barite | Level 11

Hi,

 

since you are using a spanning header for col5 and 6, one way could be to display the label of col2, col3 and col6 in a spanning header and no more in the define statement. Something like this:

proc report data=final nowindows headline headskip split='^' style(header)=[cellspacing=0 ] style=[cellwidth=100%];
	   column I ord2 col1
	  ("~S={borderbottomcolor=black borderbottomwidth=1} &trt" 
         ("TEXT^300 mg^(N=%sysfunc(trim(&TEXT.)))" col2) 
         ("TEXT^300 mg^(N=%sysfunc(trim(&TEXT.)))" col3) 
         ("~S={borderbottomcolor=black borderbottomwidth=1 cellheight =10% } TEXT" col4 col5)
         ("All^300mg^Patients^(N=&TOT1.)" col6
      ) ;
	  define I/order order=internal noprint;
	  define ord2/order order=internal noprint;
	  define col1 / display " " 							                    style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=16%];
	  define col2 / display ""   	        style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	  define col3 / display ""   	        style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	  define col4 / display "300 mg^(N=%sysfunc(trim(&TEXT.)))" 	            style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	  define col5 / display "600 mg^(N=%sysfunc(trim(&TEXT.)))" 				style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	  define col6 / display "" 					style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	

	  compute before i;
	  line "";
	  endcomp;
	  compute after ord2;
	  line "";
	  endcomp;

run;

 

________________________

- Cheers -

View solution in original post

2 REPLIES 2
Oligolas
Barite | Level 11

Hi,

 

since you are using a spanning header for col5 and 6, one way could be to display the label of col2, col3 and col6 in a spanning header and no more in the define statement. Something like this:

proc report data=final nowindows headline headskip split='^' style(header)=[cellspacing=0 ] style=[cellwidth=100%];
	   column I ord2 col1
	  ("~S={borderbottomcolor=black borderbottomwidth=1} &trt" 
         ("TEXT^300 mg^(N=%sysfunc(trim(&TEXT.)))" col2) 
         ("TEXT^300 mg^(N=%sysfunc(trim(&TEXT.)))" col3) 
         ("~S={borderbottomcolor=black borderbottomwidth=1 cellheight =10% } TEXT" col4 col5)
         ("All^300mg^Patients^(N=&TOT1.)" col6
      ) ;
	  define I/order order=internal noprint;
	  define ord2/order order=internal noprint;
	  define col1 / display " " 							                    style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=16%];
	  define col2 / display ""   	        style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	  define col3 / display ""   	        style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	  define col4 / display "300 mg^(N=%sysfunc(trim(&TEXT.)))" 	            style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	  define col5 / display "600 mg^(N=%sysfunc(trim(&TEXT.)))" 				style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	  define col6 / display "" 					style(column)=[just=l asis=on] style(header)=[Just=c cellwidth=6%];
	

	  compute before i;
	  line "";
	  endcomp;
	  compute after ord2;
	  line "";
	  endcomp;

run;

 

________________________

- Cheers -

webart999ARM
Quartz | Level 8
That approach worked. Thank you 🙂

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1772 views
  • 1 like
  • 2 in conversation