Data visualization with SAS programming

goptions for PROC GMAP

Reply
Frequent Contributor
Posts: 84

goptions for PROC GMAP

Are there any output options for PROC GMAP that don't produce two separate files in the output destination?  I have tried using goptions=png and goptions=gif, but both of them produce two files for each map, a .htm file and a .png file.  I am running a loop that creates hundred of maps using gmaps, which I want to output and then use the image files to create a animated GIF, so I would like to avoid duplication of the files if possible.

Also, is there a way to control the names of the output?  I.e. changing them from gmap1, gmap2 etc. to something more descriptive?

Thanks!

SAS Employee
Posts: 967

Re: goptions for PROC GMAP

You can control the name of the .png file by using the name= option after the /

For example...

choro sales / levels=5 name="foo";

It is often handy to use a macro variable's value for the name, or If you're using 'by' processing you can use the by-value.

If you're using ods html, I think it's going to create an html file.  Probably easiest to just delete them, or always use the same html file name (so it is overwritten each time).

Frequent Contributor
Posts: 84

Re: goptions for PROC GMAP

Is there another ODS besides HTML that I could use to produce pictures from PROC GMAP? 

Grand Advisor
Posts: 10,258

Re: goptions for PROC GMAP

It's been awhile since I used this method but there's a graphics option GSFNAME. No ods destination needed.

You would need some thing like this with a different name in each file ref before the gmap call, pick a device that generates the desired output type, GIF, PNG whatever, and have the extention match. Up to you to put your name in the filename. If you have a data set with the names and parameters Call Execute might be the best way to control the process.

filename fileref 'filename.XXX';

goptions device=devicename gsfname=fileref

  gsfmode=replace; /* replace in case you rerun the code you don't want the graphs appending*/

Ask a Question
Discussion stats
  • 3 replies
  • 341 views
  • 0 likes
  • 3 in conversation