BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Anita_n
Pyrite | Level 9

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?

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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.

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

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.

Anita_n
Pyrite | Level 9

Okay, thanks for that. I will try that

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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