BookmarkSubscribeRSS Feed
lin39
Obsidian | Level 7

Hi everyone, I need help with ODS rtf and the BODYTITLE_AUX option.  

 

Client wants a condensed report so we try to fit two or more tables on one page, thus needing to use BODYTITLE_AUX so the titles are not embeded within the header of the RTF file.  I can't use ODS text for titles, because we generate many tables by class, and I use "title2 '#byval1'" and #byval2, which I don't believe can be achieved using ODS text.

 

However I ran into some issues with bodytitle_aux:

 

1) Page numbers are no longer working.  It just shows "Page   of     " , with no numbers. =(

2) The logo and footer are being displayed multiple times, which looks really strange.  We just want it once per page.

 

I have included a sample of my code below (with a dummy dataset). Perhaps someone can point out what I am missing in my code since I'm new to proc tabulate.  Thanks so much for your help!

 

ODS RESULTS OFF;
options orientation=portrait NODATE NOSTIMER NONUMBER NOBYLINE;
ods rtf file="&root.\Output\test_&SYSDATE9..rtf" startpage=no BODYTITLE_AUX cssstyle="&root.\style.css";
ods escapechar='^';
title1 j=center '^S={preimage="&root.\logo.jpg"}';
footnote j=left 'Name' j=center 'Page ^{pageof}' j=right "Last Revised: &SYSDATE9.";
proc tabulate data=sashelp.shoes;
  title1 '#byval1';
  where region in ('Asia', 'Canada','Pacific') and
        product in ('Boot', 'Slipper' );
  class product region;
  var sales;
  table region * (product all),
        sales*(n);
run;
proc tabulate data=sashelp.shoes;
  title1 '#byval1';
  where region in ('Asia', 'Canada','Pacific') and
        product in ('Boot', 'Slipper' );
  class product region;
  var sales;
  table region * (product all),
        sales*(n);
run;
ods rtf close;

 

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

I'm confused. You can't use #byval1 like you do without having a BY statement. What/where is the BY statement in your Tabulate???

Next, the TITLE1 with the logo instruction would be replaced by the TITLE1 inside the TABULATE step. Should the TABULATE title be  TITLE2???

cynthia

lin39
Obsidian | Level 7

Thanks so much, Cynthia.  Sorry, I used a dummy SAS code due to confidentially issues.  The real SAS code does have a by class statement in the Proc Tabulate so no worries.

 

I tried embedding Title1 within the Tabulate step but this does not solve my problem.  My problem is the Logo is now printed multiple times per page.  I would like it to be printed once per page.

 

My other issue is with the footer not displaying the page number when bodytitle_aux option is used.  It just prints, "Page  of    ".  What should I do?

 

Thanks so much again. Cat Happy

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 1495 views
  • 1 like
  • 2 in conversation