BookmarkSubscribeRSS Feed
SwissC
Obsidian | Level 7

Hi,

 

I have a fairly narrow report, with just 3 short columns.  However I want to add a longer piece of text at the end.  Below is some partial code.

proc template;
     define style styles.myrtf;
       parent=styles.rtf;
       style Table from output /
         Background=_UNDEF_
         Rules=groups
         Frame=above
         OUTPUTWIDTH=_undef_
         CELLPADDING=0
         CELLSPACING=0 
         bordertopstyle=solid
         bordertopcolor=black;
    end;
  run;
 
 
PROC REPORT data=adsl nowd headline headskip missing split='#';
  COLUMNS subjid arm trtsdt ;  
  
  DEFINE subjid / order order=data  " "  style={just=l  cellwidth=4cm asis=on};
  DEFINE arm /  style={just=l cellwidth=4cm asis=on};
  DEFINE trtsdt /  style={just=l cellwidth=4cm asis=on };
  
    COMPUTE after _page_;  
      LINE j=l "xxx xxxxxxxx xx xxx xxxxxx xxxxxxxxx xxx xxxxxxxxxx, xx xxx 1 xx xxxxx xxx xx xxxxxxxxx xxxxxx. xxxxxxxx xxxx xx xxxxxxxxx xxxxxx xx xx xxxxxxxx xxxx xxx xxxxxxxx xx xxx 1,";
  ENDCOMP;

RUN;

Now the table can be quite long,  and we are using the compute after to add footnotes as we have a lot of them.  Hence I would like to be able to span these the full of the page.  I know I could set outputwidth=100% in the template, but this would also stretch the 3 columns over the full width of the page.  Is there any way around this?

 

n.b. I know I am missing the ODS RTF statements, but these are in company macros so I removed them for clarity.

3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
Anything you write with a LINE statement must stay within the boundary of the table. So what you want is not possible without stretching the entire table. The LINE statement cannot stretch from margin to margin if the table itself does not stretch from margin to margin. Or to put it another way, the report table cannot be 4 inches wide but you want the LINE output to be 7 inches wide. Both have to be either 4 inches or 7 inches.

You should look at using regular FOOTNOTE statements or ODS TEXT statements to insert text after a table. The FOOTNOTE automatically is centered on the page width, not the table width. The ODS TEXT can be made to stretch from margin to margin. By default is it left justified, so you might need to change your template to format the ODS TEXT element to have the characteristics and justification you wanted.

Cynthia
SwissC
Obsidian | Level 7

Thanks for the reply Cynthia,

Unfortunately I have a multiple page table with >10 footnotes so the FOOTNOTE option will not work.  Is there any way to get an ODS TEXT statement to print into the footer of the RTF so that  it appears on each page?

Cynthia_sas
SAS Super FREQ

Hi:
No, ODS TEXT strings appear only where placed-- essentially at the top of bottom of output, but not in the header or footer of the document. However, you can get more than 10 footnotes in a document using the ESCAPECHAR + {newline}. But, as shown below, 20 TITLES and 20 FOOTNOTES don't leave much room for anything else in the report.

Cynthia_sas_0-1614008110875.png

 

 

 


Cynthia

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
  • 691 views
  • 0 likes
  • 2 in conversation