Help using Base SAS procedures

Export images statement SAS UNIVERSITY

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 103
Accepted Solution

Export images statement SAS UNIVERSITY

Good monrning my friends:

I need help exporting images from SAS university edition.

Thanks you very much


Accepted Solutions
Solution
‎08-07-2015 01:40 PM
Super User
Posts: 17,813

Re: Export images statement SAS UNIVERSITY

Try something like the following:

ods hmtl file='/folders/myfolders/myhtml.html' gpath='/folders/myfolders/';

proc sgplot data=sashelp.class;

scatter x=weight y=height;

run;quit;

If you navigate to myfolders destination you'll see the graphs generated as PNG files.

View solution in original post


All Replies
Super User
Posts: 17,813

Re: Export images statement SAS UNIVERSITY

What kind of images? Graphs from SGPlot or SGScatter? What type of code are you running?

Frequent Contributor
Posts: 103

Re: Export images statement SAS UNIVERSITY

Both

If you could help me sending some example for each one, i will really appreciate.

Thank you

Solution
‎08-07-2015 01:40 PM
Super User
Posts: 17,813

Re: Export images statement SAS UNIVERSITY

Try something like the following:

ods hmtl file='/folders/myfolders/myhtml.html' gpath='/folders/myfolders/';

proc sgplot data=sashelp.class;

scatter x=weight y=height;

run;quit;

If you navigate to myfolders destination you'll see the graphs generated as PNG files.

Frequent Contributor
Posts: 103

Re: Export images statement SAS UNIVERSITY

Tested and Works Well

God Bless You!

SAS Super FREQ
Posts: 8,743

Re: Export images statement SAS UNIVERSITY

Hi:

  You do not need to put the full path in the FILE= option if you use PATH= and/or GPATH=. I tend to be overly cautious, so I use both. And rather than dump everything into /folders/myfolders, I like to keep the output contained within a separate folder (shown here as /all_output). So you don't accidentally close the automatic ODS HTML destination, a safer approach would be to identify your output file using the ID= suboption:

ods html(id=mystuff) path='/folders/myfolders/all_output' (url=none)

                     gpath='/folders/myfolders/all_output' (url=none)

                     file='main_wrapper.html';

    

*** code for SAS/GRAPH, if available, or SGPLOT if running UE;

ods graphics / imagename='class1';

proc sgplot data=sashelp.class;

scatter x=weight y=height;

run;

** SGPLOT does not need quit, but SAS/GRAPH does;

  

ods html(id=mystuff) close;

  If I have a chance to post an image, that shows the results, I will do it later.

output:

sas_UE_SGPLOT_image_output.png

cynthia

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 364 views
  • 2 likes
  • 3 in conversation