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

I feel like this should be an easy thing to do, especially for the length of time that I have been using SAS, but I am at a lost going through the documentation. It may be more a matter of me have very little understanding when it comes to graphic files and the like.

I created a map that I need to output to a graphic file, preferably at 300 dpi and 500 x 500 pixels using a PNG or other high resolution graphic file, with the outcome being a image file of the graphic that appears in SAS. Can someone outline the syntax steps that are needed to accomplish this? These go through our communications department and it doesnt seem to matter how we do it we dont get the high resolution file.

Thanks for any help that can be provided!

EJ

1 ACCEPTED SOLUTION

Accepted Solutions
Andre
Obsidian | Level 7

E J

I am not familiar with EG but

what happens if you place before your gplot code

ods listing  gpath="some directory";

But i doubt as you graph is normally going to a sas catalog

and not a separated file

Andre

Discard this as you were sending your code at the same time

i was answering

View solution in original post

9 REPLIES 9
DanH_sas
SAS Super FREQ

Use the PNG300 device instead of the PNG device and see if that gives you what you want. Let me know if it doesn't. Thanks!

esjackso
Quartz | Level 8

I noticed that device and will try that for the high resolution piece. The real problem is assigning where the file is stored. We have used a filename statement with a goption option (which I can off hand remember) to assign the name and path, but it never seems to be created. The only graphic file we found was in our temp directory. But I just remembered that this was being ran also under EG which may have complicated things as well with its default ODS settings and auto generated code.

EJ

ballardw
Super User

I would try an explicit ODS destination for the output.

esjackso
Quartz | Level 8

Maybe Im not following ... I need the actual image file and not a pdf / rtf / html etc...

Can you be more specific?

Thanks

EJ

Andre
Obsidian | Level 7

E J

I am not familiar with EG but

what happens if you place before your gplot code

ods listing  gpath="some directory";

But i doubt as you graph is normally going to a sas catalog

and not a separated file

Andre

Discard this as you were sending your code at the same time

i was answering

esjackso
Quartz | Level 8

This worked Andre ...and this may be what was getting at in his post.

One of the mysteries of ODS syntax.

I think I need a course "How to be a graphic designer when all you want to be is a SAS Programmer". Maybe RobertAllison@SAS and Sanjay@SAS

can develop that Smiley Happy

EJ

Andre
Obsidian | Level 7

E J

i was guessing and infering !

OR you were in a Eg context OR you were on an implicit open destination which in 9.32 is : ods html.

To catch the file in another place   use the gpath=  that was thus  working

For your other ask, my counsel is to read and study  this

http://www.epi.soph.uab.edu/bugs/zender/Super_Demo_ODS_Graphics.pdf

as ods is part of the every day life with SAS.

Already at the beginning is gpath appearing...

Best

Andre

ballardw
Super User

My suggestion about explicit ODS output was mostly aimed at HTML because then the images, png files, referenced in the html are placed in the same folder (path).

esjackso
Quartz | Level 8

I got back to my code so I can show it now. Still having the problem that the image is not in the location specified.

%_sas_pushchartsize(500, 500);

GOPTIONS CBACK= ;

PATTERN1 VALUE=SOLID COLOR=CXEFF3FF;

PATTERN2 VALUE=SOLID COLOR=CXBDD7E7;

PATTERN3 VALUE=SOLID COLOR=CX6BAED6;

PATTERN4 VALUE=SOLID COLOR=CX2171B5;

LEGEND1

DOWN=2

FRAME

POSITION=(BOTTOM CENTER OUTSIDE)

LABEL=( FONT='Arial /b' HEIGHT=10pt JUSTIFY=LEFT   "County Percentage")

;

TITLE;FOOTNOTE;

TITLE1 "Percent of County Medicare Population that are Dually Eligible";

FOOTNOTE1 " ";

filename out "h:\SCDE.png";

goptions dev=png300 gsfname=out gsfmode=replace;

PROC GMAP GOUT=MAPCHART DATA=WORK.MAPCHARTRESPONSEPREP MAP=WORK.MAPCHARTMAPPREP ALL ;

ID COUNTY;

CHORO perc /

WOUTLINE=1

LEVELS=4

STATISTIC=FIRST

LEGEND=LEGEND1

;

RUN;

QUIT;

TITLE;FOOTNOTE;

GOPTIONS RESET=LEGEND;

GOPTIONS RESET=PATTERN;

GOPTIONS CBACK=;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 9 replies
  • 2811 views
  • 3 likes
  • 4 in conversation