Data visualization with SAS programming

SAS Graph

Reply
Contributor
Posts: 56

SAS Graph

Hi,

 

I am helping one of the user I export the client SAS map from into html format it ask to install sasgraph.exe which I downloaded and it show's the graph in html format on the browser. My question is that the client is asking if there is a way to see the graph on the browser without installing sasgraph.exe.

 

Thank You

Respected Advisor
Posts: 2,647

Re: SAS Graph


Ahsan wrote:

Hi,

 

I am helping one of the user I export the client SAS map from into html format it ask to install sasgraph.exe which I downloaded and it show's the graph in html format on the browser. My question is that the client is asking if there is a way to see the graph on the browser without installing sasgraph.exe.

 



If you mean, can other people who do not have SAS/GRAPH (or even SAS) see the .html output, the answer is yes. You just have to write it to a server location that people have access to, and then provide the full path to the .html file that is created.

 

Is that what you are asking?

--
Paige Miller
Contributor
Posts: 56

Re: SAS Graph

Posted in reply to PaigeMiller
yes that what I am asking. That's the code SAS Enterprise generated.
%_eg_conditional_dropds(WORK.MAPCHARTMAPPREP);
PROC SQL;
CREATE VIEW WORK.MAPCHARTMAPPREP AS
SELECT *
FROM MAPSGFK.US_COUNTIES
WHERE STATECODE = 'NC'
;
QUIT;

%_eg_conditional_dropds(WORK.MAPCHARTRESPONSEPREP);
PROC SQL;
CREATE VIEW WORK.MAPCHARTRESPONSEPREP AS
SELECT *
FROM WORK.deviations_by_county
;
QUIT;

GOPTIONS CBACK=
;

PATTERN1 VALUE=SOLID COLOR=CX99CC00;
PATTERN2 VALUE=SOLID COLOR=WHITE;
PATTERN3 VALUE=SOLID COLOR=YELLOW;
PATTERN4 VALUE=SOLID COLOR=CXFF6600;
PATTERN5 VALUE=SOLID COLOR=RED;

LEGEND1
DOWN=5
FRAME
LABEL=( FONT='Times New Roman' HEIGHT=14pt JUSTIFY=LEFT "Light green counties have unusually LOW per enrollee spending. "
FONT='Times New Roman' HEIGHT=14pt JUSTIFY=LEFT "White counties have spending per enrollee that is within plus or minus one standard deviation from the mean. "
FONT='Times New Roman' HEIGHT=14pt JUSTIFY=LEFT "Yellow, orange, and red counties have unusually HIGH per enrollee spending.")
;

TITLE;FOOTNOTE;

TITLE1 "NEMT Per Medicaid Enrollee Spend by County";
TITLE2 "Standard Deviations Above or Below Average";

FOOTNOTE1 "";

ods html body="test.htm"
(title="NEMT spending by county") style=htmlblue

/* this successfully creates a test.htm file in the EXMAP library, but the file is blank,
and this isn't the destination I actually want anyway*/
path="/sas/RA/nc_dhhs/OIA/ContinuousAudit/ContinuousAuditShared/CommonResources/ExampleMapProject"

/*I'm trying to export to desktop using either of the paths below but it's not working yet. */
/*path="/sas/sas94/sas94config/Lev5/SASApp"*/
/*path="//trvwcfs02/NC_SAS_PROD/bwhite6/Desktop/_sas_sas94_sas94config_Lev5_SASApp_test_htm.html"*/
(url=none);
ods html close;
/* while the HTML files don't work, this code does successfully generate a map
in a SAS Report format. I then tried opening the SAS report and using SAS EG
"Export" or "Send To" to generate an HTML file I can share with others.
I'm able to create an HTML file but it doesn't display the map. */

PROC GMAP GOUT=MAPCHART DATA=WORK.MAPCHARTRESPONSEPREP MAP=WORK.MAPCHARTMAPPREP ALL;
ID STATE COUNTY;
choro Deviations /
WOUTLINE=1
CDEFAULT=BLACK
DISCRETE
LEGEND=LEGEND1 html=tooltip
;
RUN;
QUIT;

TITLE;FOOTNOTE;

GOPTIONS RESET=LEGEND;

GOPTIONS RESET=PATTERN;

GOPTIONS CBACK=;

%_eg_conditional_dropds(WORK.MAPCHARTRESPONSEPREP);
%_eg_conditional_dropds(WORK.MAPCHARTMAPPREP);

/* -------------------------------------------------------------------
End of task code
------------------------------------------------------------------- */
Respected Advisor
Posts: 2,647

Re: SAS Graph

That's the code SAS Enterprise generated

 

Do you mean Enterprise Guide, or Enterprise Miner, or something else?

--
Paige Miller
Contributor
Posts: 56

Re: SAS Graph

Posted in reply to PaigeMiller
Enterprise guide that's the code client wrote actually.
Respected Advisor
Posts: 2,647

Re: SAS Graph

l'm not an expert on Enterprise Guide, but I believe all you have to do is define a server location that everyone can access in the ODS HTML statement

 

ods html file='graph.html' path='\\server\folder\subfolder' gpath='\\server\folder\subfolder';
proc gmap data=whatever;
    ... lines of code ....
run;
quit;
ods html close;
--
Paige Miller
Contributor
Posts: 56

Re: SAS Graph

Posted in reply to PaigeMiller
thank you for your help I see the map in html format. When I try to export and save it on to desktop then send it html link to the client it ask them to install sasgraph.exe do you know why is that.
Super User
Posts: 22,823

Re: SAS Graph

Try creating an HTML5 doc and sending that over.

Contributor
Posts: 56

Re: SAS Graph

how do we do that.
Super User
Posts: 22,823

Re: SAS Graph

Change ODS HTML to ODS HTML5

 

And/or change the output selection in the drop down. 

Respected Advisor
Posts: 2,647

Re: SAS Graph


Ahsan wrote:
thank you for your help I see the map in html format. When I try to export and save it on to desktop then send it html link to the client it ask them to install sasgraph.exe do you know why is that.

There's no way that anybody can answer this without a lot more information. What html link are you sending? Does your client have access to the server location where the .html file is located?

 

What do you mean "when I try to export and save it on to desktop"? No such instructions were given to export (?) and save it to desktop. What do you mean by "export" anyway? Explain using SAS terminology, describing the steps with their SAS names.

--
Paige Miller
Contributor
Posts: 56

Re: SAS Graph

Posted in reply to PaigeMiller
some end user's doesn't have the access to the server where the file is located that's why after I got the results in html format I export the file using export function in SAS enterprise guide so they can see the graph without installing sasgraph.exe the problem is when I send the link to the client it prompted to install sasgraph.exe not all the user have SAS I just want to send the file where they don't need to install any SAS utility to view the graph. Please help
SAS Super FREQ
Posts: 1,042

Re: SAS Graph

It appears you have generated your output using the ActiveX control. To get the same appearance of the graph that you can send to someone without the control, change the device from ACTIVEX to ACTXIMG (ActiveX image). The output will contain a PNG image that can be viewed by anyone.

 

Hope this helps!

Dan

Contributor
Posts: 56

Re: SAS Graph

how do we change that
Community Manager
Posts: 3,349

Re: SAS Graph

I'd go ahead and change your SAS Enterprise Guide preferences to use PNG.  Find it in Tools->Options->Results->Graph, Graph Format.  See how in this post:

 

https://blogs.sas.com/content/sasdummy/2011/05/25/sas-enterprise-guide-options-my-favorite-5/

 

Scroll to "Change Graph Format to PNG"

Ask a Question
Discussion stats
  • 23 replies
  • 224 views
  • 0 likes
  • 6 in conversation