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

Hi all

I have a small query for you all related to exporting Univariate histogram (in my case) as gif. 

In SAS 9.2, I use to do something like :

 

filename grafout "&dirout\mygraph.gif" ;
goptions gsfname=grafout gsfmode=replace device=gif ;
title1 f=swissb h=1.3 "my super graph" ;
proc univariate data = test noprint ;
histogram var1/cfill = steel ;
inset n mean std min max ;
where var1ne . ; run ; quit ;

 

In SAS 9.4, that doesn't seem to work anymore. I read somewhere that SAS 9.4 ha a default HTML output. Is that right? if so can I 'disable' it and go back to my old way? or is there a more efficient way with SAS 9.4?

PS: I am not using SAS Enterprise.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
SuzanneDorinski
Lapis Lazuli | Level 10

Try turning ODS graphics off. 

 

ODS GRAPHICS OFF;

filename grafout "&dirout\mygraph.gif" ;

goptions gsfname=grafout gsfmode=replace device=gif ;

title1 f=swissb h=1.3 "my super graph" ;

proc univariate data = sashelp.class noprint ;
  histogram age /cfill = steel ;
  inset n mean std min max ;
  where age ne . ; 
run ; 

 

From the PROC UNIVARIATE documentation:

 

The UNIVARIATE procedure supports two kinds of graphical output.

  • ODS Statistical Graphics output is produced if ODS Graphics is enabled, for example by specifying the ODS GRAPHICS ON statement prior to the PROC statement.

  • Otherwise, traditional graphics are produced if SAS/GRAPH® is licensed.

Find more details at http://support.sas.com/documentation/cdl/en/procstat/68142/HTML/default/viewer.htm#procstat_univaria...


mygraph.gif

View solution in original post

2 REPLIES 2
SuzanneDorinski
Lapis Lazuli | Level 10

Try turning ODS graphics off. 

 

ODS GRAPHICS OFF;

filename grafout "&dirout\mygraph.gif" ;

goptions gsfname=grafout gsfmode=replace device=gif ;

title1 f=swissb h=1.3 "my super graph" ;

proc univariate data = sashelp.class noprint ;
  histogram age /cfill = steel ;
  inset n mean std min max ;
  where age ne . ; 
run ; 

 

From the PROC UNIVARIATE documentation:

 

The UNIVARIATE procedure supports two kinds of graphical output.

  • ODS Statistical Graphics output is produced if ODS Graphics is enabled, for example by specifying the ODS GRAPHICS ON statement prior to the PROC statement.

  • Otherwise, traditional graphics are produced if SAS/GRAPH® is licensed.

Find more details at http://support.sas.com/documentation/cdl/en/procstat/68142/HTML/default/viewer.htm#procstat_univaria...


mygraph.gif
MrTh
Obsidian | Level 7

@SuzanneDorinski many thanks for the simple but effcient answer. i've been scratching my haed a while. Cheers!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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