BookmarkSubscribeRSS Feed
ToddPM
Calcite | Level 5
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.
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
ODS LAYOUT is still experimental, so this is an issue that is best addressed with Tech Support. If there is some interaction or interference between ODS LAYOUT, ODS PDF and EG, Tech Support can find out by going directly to the developers.

To open a track with Tech Support, go to http://support.sas.com/ and in the left-hand navigation pane, click on the link entitled "Submit a Problem". Alternately, you can go directly to the Tech Support Problem Form here:
http://support.sas.com/ctx/supportform/createForm

cynthia
ToddPM
Calcite | Level 5
Thanks for your response, Cynthia. I had a few initial back-and-forths with SAS tech support before a colleague here figured out to examine how I was retrieving the files.

My FTP client didn't know to use a binary transfer instead of ASCII. It looks like an ASCII transfer messes things up enough not to work, but not enough to give any error message at all.

So, it was my mistake for not checking the FTP method first myself. ODS appears to have been creating the PDFs correctly all along.

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
  • 2 replies
  • 1009 views
  • 0 likes
  • 2 in conversation