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.
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
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 -
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 -
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!
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.