SAS Programming

DATA Step, Macro, Functions and more
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 700 views
  • 0 likes
  • 2 in conversation