BookmarkSubscribeRSS Feed
Earl_W
Calcite | Level 5
Hi,

I've got a program that generates PROC REPORT output into a PDF file. Now we want to prefix this file with a static page of text that describes the descriptions and assumptions of these reports.

If I did this in Adobe Acrobat, I'd use the File > Combine Files option and simply combine the two files into one. Is there a way to do this in SAS?

I guess I want an ODS PDF INSERTDOC= statement. 🙂

Thanks,
Earl
4 REPLIES 4
ScottH_SAS
SAS Employee
Currently there is no way to merge PDF files within SAS. We are looking into that suggestion for a future release.

Thanks!
Scott
Cynthia_sas
SAS Super FREQ
Hi:
Even though there's no way to merge 2 PDF files together, you CAN create a COVER page when you need it by using a technique similar to that shown below.

Basically, use a DATA step to create a file that will become your "cover page" data and then use PROC REPORT with the NOHEADER option to display that data with all the interior table lines turned off. I kept my data really simple, I have an ORD variable and a NOTE variable. I use the ORD variable to make the first line bigger than the comment lines with a CALL DEFINE.

You could read the cover page text from a flat file, too and then tailor your PROC REPORT to the var names from the file. Although it's not the same as having the ability to combine 2 PDF files, if all you need is a simple cover page, then you CAN get it.

cynthia
[pre]

options nodate nonumber orientation=portrait;
data cover;
length ord 8 note $425;
ord = 1;
note = 'Assumptions';
output;
ord = 2;
note = '1) All data will be "scrubbed" and error-free.';
output;
ord = 3;
note = '2) All Sales are CLOSED status';
output;
ord = 4;
note = '3) Pending Sales must be closed by month-end date or they will be reported in the next month.';
output;
ord = 5;
note = '4) Sales under $500 show under MISC category, not under Order Type';
output;
ord=6;
note = '5) And this is a really, really, really, really, '||
'really, really, really, really, really, really, '||
'totally long, very long, comment. It includes '||
'the word "supercalifragilisticexpialidocious", even '||
'though the sound of it is something quite atrocious. '||
'You might prefer a comment that included jabberwocks '||
'and slithy toves and mimsy borogroves, but Alice decided '||
'that she really did not care to comment on the report.';
output;
run;

ods pdf file='c:\temp\coverpage.pdf';
title; footnote;
proc report data=cover nowd noheader
style(report)={rules=none frame=void cellspacing=0}
style(lines)={font_size=18pt font_style=italic font_weight=bold};
column ord note;
define ord / order noprint;
define note / display
style={font_weight=medium font_size=14pt just=l};
compute note;
if ord = 1 then
call define(_ROW_,'style',
'style={font_weight=bold font_size=18pt just=c}');
endcomp;
compute after;
line ' ';
line ' ';
line 'Company Confidential';
endcomp;
run;

proc report data=sashelp.shoes nowd;
title 'Sales Report';
where region in ('Asia', 'Canada');
column region product sales;
define region / group;
define product / group;
define sales/ sum;
rbreak after/ summarize;
run;

ods pdf close;

[/pre]
Earl_W
Calcite | Level 5
Thanks, Scott and Cynthia.

Cynthia, your supercalifragilisticexpialidocious example was my "Plan B." I guess I'll implement it.

Earl
Cynthia_sas
SAS Super FREQ
With a spoonful of sugar, I hope!

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