The following code attempts to generate a PDF using ODS.
Running the code from a UNIX prompt (SAS 9.2) generates a file in the specified location with the correct file name, but that PDF is completely blank.
Running the code in Enterprise Guide 4.2 generates the same blank file in the specified UNIX directory, but a PDF opens within EG that contains the expected output. If that PDF is exported from EG, the exported PDF contains the same correct output.
My question: why is the PDF file that is saved to the UNIX directory empty, and what can I do to get it to contain the proper output?
(my UNIX directory structure has been obscured)
[pre]
ODS LISTING CLOSE;
ODS ESCAPECHAR='^';
DATA sample_table;
INPUT thing1 $6. thing2 $6.;
DATALINES;
item1 item2
item3 item4
item5 item6
;
RUN;
ODS PDF FILE="(MY UNIX DIRECTORY HERE)/ODS.pdf" NOTOC;
ODS LAYOUT START x=0 pct y=0 pct
width=100 pct height=100 pct;
ODS REGION x=0 pct y=0 pct
width=100 pct height=100 pct;
ODS PDF TEXT="^{style [font_size=10pt font_face=arial]sample text}";
PROC SQL;
TITLE 'table printed here';
SELECT *
FROM sample_table
;
TITLE;
QUIT;
ODS LAYOUT END;
ODS _ALL_ CLOSE;
ODS LISTING;
[/pre]
In case it can give any insight, here is the accompanying log:
[pre]
NOTE: SAS initialization used:
real time 0.08 seconds
cpu time 0.03 seconds
1 ODS LISTING CLOSE;
2
3 ODS ESCAPECHAR='^';
4
5 DATA sample_table;
6 INPUT thing1 $6. thing2 $6.;
7 DATALINES;
NOTE: The data set WORK.SAMPLE_TABLE has 3 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.02 seconds
11 ;
12 RUN;
13
14 ODS PDF FILE="(MY UNIX DIRECTORY HERE)/ODS.pdf" NOTOC;
NOTE: Writing ODS PDF output to DISK destination "(MY UNIX DIRECTORY HERE)/ODS.pdf", printer "PDF".
15 ODS LAYOUT START x=0 pct y=0 pct
16 width=100 pct height=100 pct;
17
18 ODS REGION x=0 pct y=0 pct
19 width=100 pct height=100 pct;
20
21 ODS PDF TEXT="^{style [font_size=10pt font_face=arial]sample text}";
22
23
23 ! PROC SQL;
24 TITLE 'table printed here';
25 SELECT *
26 FROM sample_table
27 ;
28 TITLE;
29 QUIT;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
30
31 ODS LAYOUT END;
32
33 ODS _ALL_ CLOSE;
NOTE: ODS PDF printed 1 page to(MY UNIX DIRECTORY HERE)/ODS.pdf.
34 ODS LISTING;
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
real time 0.35 seconds
cpu time 0.21 seconds
[/pre]
Thanks for looking.