BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,
I'm creating listings of clinical datasets using Proc Report to RTF. I can control the vertical pagination of the colums with the PAGE option, but how can I number pages and count total pages since each row/obs will now span multiple pages? Any Suggestions would be appreciated.
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
In SAS 9.1, ODS RTF does not do vertical measurement -- so the control for the page break behavior is left to Word. One person could open the report, set one set of margins and they would see different page numbering than another person who opened the report and set different margins.

In SAS 9.2, a new type of RTF -- "measured" RTF -- does do vertical measurement and so page breaks inserted by SAS should be respected. So, for example, using TAGSETS.RTF in SAS 9.2 should get you consistent page breaking results (or more consistent than was previously possible with SAS 9.1).

However, numbering pages in page x of y fashion has been possible since SAS 8.2. Consider the followng code. It puts page x of y page numbering in a title and in a footnote.

cynthia

[pre]
options nodate nonumber center;
ods listing close;

ods rtf file='use_pageof.rtf';
ods escapechar='^';

proc report data=sashelp.prdsale nowd;
title j=r '^{pageof}';
footnote j=c 'Page ^{thispage} of ^{lastpage}';

column country division prodtype actual predict;
define country / group;
define division / group;
define prodtype / group;
define actual / mean 'Avg Actual';
define predict / mean 'Avg Predict';

break after country / page;
run;

ods rtf close;
[/pre]

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
  • 1 reply
  • 2133 views
  • 0 likes
  • 2 in conversation