Data visualization with SAS programming

SAS/Graph ignoring device

Reply
Frequent Contributor
Posts: 80

SAS/Graph ignoring device

Hey all,

I have an odd problem, and I'll admit that I haven't done much troubleshooting as I'm under a fast approaching deadline (a half hour).

I cannot get the SG procs to use anything but PNG. When I submit the following code, the gplot produces a gif image, but the sgplot always produces a png. It doesn't matter if I select activex, java, bmp. No matter what I do, the sgplot always comes out as PNG.

Any ideas?

data x;
input x y z;
datalines;
1 1 3
1 2 5
1 3 8
1 4 7
1 5 8
1 6 7
2 1 6
2 2 7
2 3 7
2 4 7
2 5 8
2 6 7
;
run;

goptions device = gif;
ods html;
proc gplot data = x;
plot z*y=x;
run;
proc sgplot data = x;
xaxis type = discrete;
series x=y y=z / group = x;
run;
ods html close;
SAS Super FREQ
Posts: 889

Re: SAS/Graph ignoring device

Use this for the SG procedures:

ods graphics / imagefmt=;

THanks!
Dan
Frequent Contributor
Posts: 80

Re: SAS/Graph ignoring device

Thanks a billion! It worked.
Contributor
Posts: 66

Re: SAS/Graph ignoring device

Dan: are you saying ods graphics options work ONLY for SG procedures?
Should we keep using goptions for regular proc gplot?
SAS Super FREQ
Posts: 889

Re: SAS/Graph ignoring device

The ODS GRAPHICS statement must be used for any template-based graphics output. This includes the SG procedures, GTL templates rendered using PROC SGRENDER, and any STAT/ETS/etc. procedures generating graphics with the "ODS GRAPHICS ON;" statement active. For regular SAS/GRAPH procedures, such as GPLOT and GCHART, continue to use GOPTIONS to control the global options.

Thanks!
Dan
Contributor
Posts: 66

Re: SAS/Graph ignoring device

Thanks, Dan. This is really helpful!
Ask a Question
Discussion stats
  • 5 replies
  • 217 views
  • 0 likes
  • 3 in conversation