Hi,
I wish to export the pie chart I created as pdf. I used the following code.
goptions reset=all border cback=white
htitle=5pt gsfname=grafout gsfmode=replace device=pdf;
filename grafout 'mypath\mydata.pdf';
legend1 label=none
shape=bar(4,1.5)
position=(top left)
offset=(5,)
across=4
mode=share;
proc gchart data=mydata ;
pie var1 / sumvar=var2
noheading
coutline=black
other=0
value= inside
angle=30
ascending
percent= arrow
jstyle
legend=legend1;
run;
quit;
When I run the above code, it says the data has been written to: \\AppData\Local\Temp\SAS Temporary Files\_TD5700_mm-b4_\gchart.png.
Any help?
Hi @Anita_n,
My SAS 9.4 under Windows does produce the PDF file with your code, but this is because I use ODS Listing as the default destination and not HTML. I can reproduce the issue (only PNG is created and a warning " Unsupported device 'PDF' for HTML destination. ..." is written to the log) if I change the settings in Tools → Options → Preferences... → Results from "Create Listing" (only) to "Create HTML" (only).
So you can either tick the check box "Create listing" in the Preferences window and deselect "Create HTML" or submit
ods _all_ close;
ods listing;
to close the HTML and possibly other ODS destinations and open the Listing destination.
Hi @Anita_n,
My SAS 9.4 under Windows does produce the PDF file with your code, but this is because I use ODS Listing as the default destination and not HTML. I can reproduce the issue (only PNG is created and a warning " Unsupported device 'PDF' for HTML destination. ..." is written to the log) if I change the settings in Tools → Options → Preferences... → Results from "Create Listing" (only) to "Create HTML" (only).
So you can either tick the check box "Create listing" in the Preferences window and deselect "Create HTML" or submit
ods _all_ close;
ods listing;
to close the HTML and possibly other ODS destinations and open the Listing destination.
Okay, thanks for that. I will try that
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.