BookmarkSubscribeRSS Feed
srisai
Calcite | Level 5
Hi All,

Here i have a question about Proc print pdf output.
I would like to get all my proc print outputs together in one pdf page in the results tab (i am getting one output in one page).

Do we have any option to get this?

Thanks,
SRi
6 REPLIES 6
Cynthia_sas
SAS Super FREQ
Hi:
With code techniques, it is possible to get multiple PROC PRINTs in one PDF file:
[pre]
ods _all_ close;
ods pdf(id=specpdf) file='c:\temp\more_than_one.pdf';
proc print data=sashelp.class(obs=5);
title 'One';
run;

proc print data=sashelp.cars(obs=5);
title 'Two';
run;

proc print data=sashelp.shoes(obs=5);
title 'Three';
run;

proc print data=sashelp.prdsale(obs=5);
title 'Four';
run;
ods pdf(id=specpdf) close;
[/pre]

Normally, you do not need to use the ID= suboption when you create output, however, EG uses a special ID= suboption for its results and so the ID= suboption in the above code will prevent a "collision" with any ID= suboption that EG uses automatically. When I submit the above code, using EG 4.3, the ODS _ALL_ CLOSE; statement will close the default SASReport output, causing 1 blank result tab for the SASReport output. Then, there will be a second tab for the PDF results -- of 1 PDF file with 4 PROC PRINTs.

However, as to how you accomplish this in SAS Enterprise Guide using point and click techniques, I am not sure. Perhaps, you can enter code to execute at the beginning and end of the project? Otherwise, generally, in EG, every task gets a separate result. You might want to ask this question in the SAS Enterprise Guide forum if the code technique will not work for you.

cynthia
srisai
Calcite | Level 5
This is also sounds good........we have title for every proc print and here can we have a global title for all the proc print codes along with each proc print title??
Please respond..

Thanks,
Cynthia_sas
SAS Super FREQ
Hi:
I am confused. All SAS titles are GLOBAL (you can have up to 10 TITLE and 10 FOOTNOTE statements in your report output). I just put a separate TITLE statement for each PROC PRINT so you could see which page in the output came from which PROC PRINT step.

If there had been ONLY 1 TITLE statement at the top of the code:
[pre]
title 'This is the ONLY title statement';
[/pre]

with no other TITLE statements in the code, then the single TITLE statement would have been used for every PROC PRINT -- since TITLE statements are GLOBAL, they remain in effect until they are changed.

So, I'm not sure what you mean by a "global title for all the proc print codes along with each proc print title" -- do you mean some string that would ONLY appear on page 1 of the document that contained the 4 proc prints???? If so, then you could change the title statements as shown below. (Essentially, you would use a TITLE1 and TITLE2 statement for the first PROC PRINT and then just use TITLE1 statements for all the other PROC PRINTS.)

Otherwise, if that's not what you mean, there's the possibility that you might use ODS TEXT= to insert some extra text into the report. But I'm not clear on what you really want.

cynthia
[pre]
ods _all_ close;

ods pdf(id=specpdf) file='c:\temp\more_than_one.pdf';

title1 'The Very First Title';
proc print data=sashelp.class(obs=5);
title2 'One';
run;

proc print data=sashelp.cars(obs=5);
title1 'Two';
run;

proc print data=sashelp.shoes(obs=5);
title1 'Three';
run;

proc print data=sashelp.prdsale(obs=5);
title1 'Four';
run;
ods pdf(id=specpdf) close;
[/pre]
srisai
Calcite | Level 5
Hi,

Thanks for the information.
Yes i mean some string that would ONLY appear on page 1 of the document that contained the 4 proc prints.

It works for me...Thanks once again...
Ksharp
Super User
[pre]


data one;
title='The Very First Title';
run;
data two;
title="The Cynthia's title";
run;

ods pdf file='c:\temp\more_than_one.pdf' startpage=no uniform;

proc report data=one nowd noheader style={frame=void};
run;
proc print data=sashelp.class(obs=5);
run;

proc report data=two nowd noheader style={frame=void};
run;
proc print data=sashelp.shoes(obs=10);
run;


ods pdf close;
[/pre]



Ksharp
ballardw
Super User
Or

ODS PDF Text='This is text I want to appear at this time, not later in the document';

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
  • 6 replies
  • 1128 views
  • 0 likes
  • 4 in conversation