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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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