BookmarkSubscribeRSS Feed
knveraraju91
Barite | Level 11
data have;
term='all';
output;
term='par';
output;
term='';
a1='1';b1='2';c1='3';a2='4';b2='5';c2='6';
output;
run;
%let N=10;
%let year=20;
proc report data=have headline headskip nowd split='|' spacing=0;
column (term) ( "therapy" a1 b1 c1) ( "Compare" a2 b2 c2) ;

define term/display '|Term' left width=40 flow;
define a1/display '       n' center width=23;
define b1/display 'Number' center width=15;
define c1/display 'rate' center width=18;
define a2/display '       n' center width=20;
define b2/display 'Number' center width=15;
define c2/display 'rate' center width=18;

run;

Dear

in my report output i need to insert below text  under both therapy and compare section when term='par'. thank you

N=&N.

Total years=&year.

3 REPLIES 3
ballardw
Super User

I think you many need to create a table in a word processor and show what you want and share that.

 

" under both therapy and compare section" leads to questions such as "where under"? Part of the heading "Therapy" text displayed in the same cell? In a different cell under Therapy? Under each of the headings for A1 B1 and C1? Under some value of A1? Under B1? Under C1? At the bottom of the report.

 

And the bit that your two values for Term have nothing in the rest of the table raises why are they even in your code or example.

knveraraju91
Barite | Level 11

Thank you very much. I need to populate in the highlighted area in the attachemnt spanning all three columns. Thank you

ballardw
Super User

Must it be in a separate cell? Or can it be in the same cell but a second line? This later is relatively easy and your code already included one of the options to do it. My example only shows for therapy the same use of | and other text with Compare would work. I show the N and Years on separate lines as it isn't exactly clear which is your intent because your
document only shows 2 dashes, not an example of the actual text you requested or where it goes.

 

proc report data=have headline headskip nowd split='|' spacing=0;
column (term) ( "therapy|N=&n|Total years=&year" a1 b1 c1) ( "Compare" a2 b2 c2) ;

define term/display '|Term' left width=40 flow;
define a1/display '       n' center width=23;
define b1/display 'Number' center width=15;
define c1/display 'rate' center width=18;
define a2/display '       n' center width=20;
define b2/display 'Number' center width=15;
define c2/display 'rate' center width=18;

run;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 442 views
  • 0 likes
  • 2 in conversation