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
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
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!
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
I would try an explicit ODS destination for the output.
Maybe Im not following ... I need the actual image file and not a pdf / rtf / html etc...
Can you be more specific?
Thanks
EJ
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
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
EJ
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
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).
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=;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
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.
Ready to level-up your skills? Choose your own adventure.