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
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;
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
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.
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.