The SAS Output Delivery System and reporting techniques

Can we get all proc print outputs in one PDF doc in SAS/EG?

Reply
Contributor
Posts: 36

Can we get all proc print outputs in one PDF doc in SAS/EG?

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
SAS Super FREQ
Posts: 8,868

Re: Can we get all proc print outputs in one PDF doc in SAS/EG?

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
Contributor
Posts: 36

Re: Can we get all proc print outputs in one PDF doc in SAS/EG?

Posted in reply to Cynthia_sas
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,
SAS Super FREQ
Posts: 8,868

Re: Can we get all proc print outputs in one PDF doc in SAS/EG?

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]
Contributor
Posts: 36

Re: Can we get all proc print outputs in one PDF doc in SAS/EG?

Posted in reply to Cynthia_sas
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...
Super User
Posts: 10,046

Re: Can we get all proc print outputs in one PDF doc in SAS/EG?

[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
Super User
Posts: 11,343

Re: Can we get all proc print outputs in one PDF doc in SAS/EG?

Or

ODS PDF Text='This is text I want to appear at this time, not later in the document';
Ask a Question
Discussion stats
  • 6 replies
  • 292 views
  • 0 likes
  • 4 in conversation