BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

title  'Title1';

title2  'Title2;

PROC REPORT DATA= test headskip split='*' wrap nowd

style(report)=[background=black cellspacing=10 just=center font_size=9pt font_face="Calibri" bordercolor=black borderwidth=1]

style(column)=[background=white font_size=10pt bordercolor=black borderwidth=1]

  

;

COLUMNS _ALL_;

 

 

DEFINE Disas_Type / Display style(column)={cellwidth=80pt just=center} "Disaster Type";

DEFINE TITLE / Display style(column)={cellwidth=80pt just=center} "Title";

DEFINE STATE / Display style(column)={cellwidth=80pt just=center} "State";

DEFINE Counties / Display style(column)={cellwidth=80pt just=center} "Counties";

 

 

 

run;

ods listing close;

 

Lets say I want to add a page break after Counties and start a new page to insert another proc report and I want to place a page number at the top of each page (Page 1 of 10)  how could I do that

2 REPLIES 2
HB
Barite | Level 11 HB
Barite | Level 11

You could try something like:

 

 

ods pdf file="file.pdf" notoc;

/* Start the page numbering from 1 */
options pageno=1;

proc whatever;
run;

ods pdf startpage=now;

proc whatever;
run;

ods _all_ close;
Cynthia_sas
SAS Super FREQ

Hi, in the LISTING destination, it is very hard to do page numbering, such as you want (Page X of Y).

However for PDF and RTF destinations, it is quite easy. Here's an example using SASHELP.SHOES and SASHELP.CARS.


ods listing close;
ods escapechar='^';
options nodate nonumber pageno=1;

ods pdf file='c:\temp\show_pageXofY.pdf';

title j=c 'My Title' j=r 'Page ^{thispage} of ^{lastpage}';

proc report data=sashelp.shoes(obs=65);
run;
  
title j=c 'Second Report' j=r 'Page ^{thispage} of ^{lastpage}';

proc report data=sashelp.cars(obs=65);
  column make model type origin msrp mpg_highway mpg_city;
run;
 
ods pdf close;

 

 

Hope this helps give you an idea of how to do this for PDF or RTF.
cynthia

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
  • 4182 views
  • 0 likes
  • 3 in conversation