- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I want no page number for first page. From second page onwards I want "page 1 of last page" . Total number of pages does not include first page.
Thanks in advance for help,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
However, if you wanted to run PROC GLM, (for example) and have page 1 without page numbers and then have the rest of the output with page numbers, this is not possible without post processing the output.
In order to get Page X of Y page numbering, you must use ODS ESCAPECHAR functions ^{thispage} and ^{lastpage}. In my program, I show an ESCAPECHAR of ^. If you used a different ESCAPECHAR, (such as ~), then your function calls would change to ~{thispage} and ~{lastpage}.
cynthia
[pre]
options nodate nonumber;
title; footnote;
ods pdf file='change_nums_middle3.pdf';
ods escapechar='^';
proc print data=sashelp.shoes(firstobs=1 obs=33);
title 'My Report from PROC PRINT with no Page Numbers';
run;
title;
footnote;
options pageno = 1;
ods pdf;
proc print data=sashelp.shoes(firstobs=34 obs=120);
title 'Page Numbers Start here (in footnote)';
footnote j=r 'Page ^{thispage} of ^{lastpage}';
run;
ods pdf close;
title;
footnote;
[/pre]
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
ods listing close;
ods escapechar='^';
options nodate nonumber pageno=1;
options nodate nonumber papersize = letter orientation=landscape;
ods noptitle;
ods pdf file="&OutDir/&ReportOut..pdf" style=printer notoc /*startpage=never;*/;
goptions hsize=10 in vsize=11 in;/*9 7*/
title j=c 'Mortgage Disaster Impact Analysis'
j=r 'Page ^{thispage} of ^{lastpage}';
title2 justify=center 'Originations Pipeline Impact';
title3 justify= center &wkday. &Date1. &Time1.;
PROC PRINT DATA = FEMA_IMPACT_CUTOFF noobs
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]
grandtotal_label='Grand Total';
title j=center 'Originations Pipeline Impact';
by Disaster State ;
sum Indiv_Numb Indiv_Doll Publ_Numb Publ_Doll;
label Indiv_Numb = 'Indiv#s';
label Indiv_Doll = 'Indiv$';
label Publ_Numb = 'Public#s';
label Publ_Doll = 'Public$';
RUN;
ods pdf close;
goptions reset=all;
ods pdf startpage=yes;
ods listing;
run;
As a follow up to this post I inserted the page number logic however I am not getting the page number just the results. This uses a pdf output
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
I'm not sure why you posted this in a 9 year old forum posting. However, you have an issue in your code, which is probably the reason why the "pageof" ESCAPECHAR strings are not working.
also, not sure why you have a GOPTIONS statement. For PDF to change the papersize, you typically use the PAPERSIZE option in an OPTIONS statement.
And, if you are using graph procedures in your production code with page x of y type of formatting, you may want to look at this Tech Support note: http://support.sas.com/kb/33/986.html.which indicates that "pageof" functions may not work with graphics.
cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply. This is what I was looking for.
Thanks,
Amit