Trying to create a simple pdf with the following starting code:
ODS _ALL_ CLOSE; ODS PDF FILE="/home/seb/dm1307/tmp/nfc.pdf" STYLE=SASWEB NOTOC; RUN;
I get simple ERROR: . message.
The directory exists, not root, my id as the owning id and permissions set to 777.
What am I missing?
Two things are missing from your "code".
First, you do not show any procedure or process that would write to the ODS destination.
Second, until the ODS PDF CLOSE; statement is executed then the file is open for writing and is not complete.
Below is a procedure that will write to the destination and a close.
ODS PDF FILE="/home/seb/dm1307/tmp/nfc.pdf" STYLE=SASWEB NOTOC;
proc print data=sashelp.class; RUN;
ods pdf close;
What did your LOG look like?
Abbreviating your code too much will often hide the actual issues. When you have problems the LOG is often what we need to see because it will have messages like "file doesn't exist"
ballardw
Here is the complete code I'm trying. I added the first couple of statements simply because that is where it is failing.
ODS _ALL_ CLOSE; ODS PDF FILE="/home/seb/dm1307/tmp/nfc.pdf" STYLE=SASWEB NOTOC; RUN; PROC SQL; SELECT SYSTEM, DATE, AVG(PCTZIPBY) AS AVGZIP FROM USER.RMFINTRV GROUP BY SYSTEM, DATE; QUIT; ODS _ALL_ CLOSE; ODS LISTING; RUN;
I can run this same code on another system and it does work. I'm assuming this is just a permission issue with the directory. Or does the pdf have to exist? Again, assuming this statement creates the pdf if it does not exist, or replaces if does.
This is all I'm getting in my SASLOG:
1 2 ODS _ALL_ CLOSE; 3 ODS PDF FILE="/home/seb/dm1307/tmp/nfc.pdf" STYLE=SASWEB NOTOC; ERROR: . 4 RUN; 5 6 PROC SQL; ERROR: SAS ended due to errors. You specified: OPTIONS ERRORABEND;. ERROR: Errors printed on page 3.
Can I run OPTIONS on the code to possibly point to the error?
RUN belongs at the end of a procedure or data step. When it appears in code without a procedure then odd things might happen depending on the last statements encountered.
You may want to use the Options to turn off ErrorAbend so your SAS session isn't terminated when you make minor errors.
Options noerrorabend;
In my opinion about the only time errorabend should be on is in the case of production batch jobs so that something like a missing file doesn't create a lot of headaches.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.