BookmarkSubscribeRSS Feed
hari1109
Fluorite | Level 6
Thank you in advance.

i have an issue. i am using ods pdf destination to generate a pdf file but i am using to two proc report procedures with the destination. My requirement is i have to get page numbers for both the procedures. for example if i generate 5 pdf pages for proc report one then i should get like page 1 of 5 and then for the second proc report i should get like 1 of 6 if there are 6 pages.Right now i am getting 1 of 10 ,2,3,4,5 of 10 and then for the second i using pageno =1 for that i am getting 1 of 10,2,3,4,5 of 10. i am using both report procedures with a single ods pdf destnation. Do any one have idea about how to generate the above mentioned. thank you.
7 REPLIES 7
Cynthia_sas
SAS Super FREQ
Hi:
As far as I know, the PAGENO= option only resets the -starting- page number. Everything within one ODS PDF sandwich would be counted toward the -ending- page number, or number of total pages.

My idea would be to create 2 separate PDF files so that the first file has page 1 of 5, page 2 of 5, etc; and then the second file would have 1 of 6, 2 of 6, etc. Then use a 3rd party PDF product or an Adobe product to combine the 2 PDF files into 1 file.

I used the code below to create 2 separate PDF files and then I manually combined them with Adobe Acrobat. However, I understand from students that there are 3rd party PDF conversion/combination tools that are available. I think the place that most folks go to look for 3rd party PDF tools is the PlanetPDF site.

cynthia
[pre]
options nodate nonumber;
title; footnote;

ods pdf file='c:\temp\first.pdf';
ods escapechar='^';

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

proc print data=sashelp.shoes(obs=80);
run;

ods pdf close;

ods pdf file='c:\temp\second.pdf';
ods escapechar='^';

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

proc print data=sashelp.cars(obs=80);
var make model drivetrain invoice enginesize;
run;

ods pdf close;

** then manually combine the 2 files with Adobe products;
** or find a 3rd party program to combine the 2 files;
[/pre]
hari1109
Fluorite | Level 6
First of all thank you Cynthia, i can do it in that way but i am going to create stored process with it .so i have to replace odf pdf file " "; with ODS PDF FILE=_WEBOUT; for that i think we can't get two pdf outputs from the stored process web application but i was wondering if i can put them as two options in stored process program. so if i want i can ran from web application to get two separate pdfs out of what i have right now. Thank you very much.
Cynthia_sas
SAS Super FREQ
Hi:
That might be a question for Tech Support or something to post in the Stored Process forum. You can make a package file (a SAS Package file generally has the extension .spk -- and is like a zip archive) from a stored process and the package file could hold multiple PDF files. You'd have to be careful, in the SP how you opened and closed the files so that they got written to the same package.

I believe the stored process documentation has examples of creating package output. I think the method you use might depend on the version of the Platform you were using and the client application that was going to receive the output package of PDFs.

cynthia
hari1109
Fluorite | Level 6
Thank you Cynthia i will try with what you have suggested but if can't i will go for tech suopport. Do you want me to post my question in stored process forum?.
Cynthia_sas
SAS Super FREQ
Hi:
It's up to you. It's worth a try to see if anyone has done it.

But I think your best bet will be with Tech Support. They can look at all of your code, collect your environment info, look at what client app you're using and give you specific recommendations for how to change your code.

cynthia
Ksharp
Super User
Hi.
If you are using SAS9.2 and these two proc report do the same thing for the same dataset.
You can try to use proc report option bypageno.


Ksharp
Cynthia_sas
SAS Super FREQ
There is a Tech Support note about BYPAGENO:
http://support.sas.com/kb/39/423.html

cynthia

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