Data visualization with SAS programming

how to 'force' SAS to output my ODS/Graphs remotely?

Reply
Frequent Contributor
Posts: 78

how to 'force' SAS to output my ODS/Graphs remotely?

Hi all,

I had been generating and running my web pages and graphs locally for the past few months. so now this project is going live and I need to know how do I get SAS to force the ods html pages and graphs to be output to a remote directory in our company server so that everyone in the company will be able to view these webpages?

Hoping someone can help me on this one!!

cheers. yennie
SAS Employee
Posts: 967

Re: how to 'force' SAS to output my ODS/Graphs remotely?

The 'best' answer for you will be dependent on what code you're currently using, and what kind of output you're creating.

But an example of _one_ way to control the output location, when using "ods html" and device=png (or gif, etc) is included below. I assign a "filename odsout", and then I use that in the "path=" of my ods html statement (in my case, U: is mapped to a drive on the netapp file server \\sashq\root\u\realliso\ on the network, and the public_html directory is served by a web server)...

-----

%let name=foo;
filename odsout 'u:\public_html\';

GOPTIONS DEVICE=png;
ODS LISTING CLOSE;
ODS HTML path=odsout body="&name..htm" style=minimal;

proc gplot data=sashelp.class;
plot height*age /
des="" name="&name" ;
run;

quit;
ODS HTML CLOSE;
ODS LISTING;
Frequent Contributor
Posts: 78

Re: how to 'force' SAS to output my ODS/Graphs remotely?

Hi Robert,

Thank you for your reply. This is a quick example of my code which I was using initially...

The above suggestion is great however i think it only allow me to output the gif. I can't see html pages .... =/

ODS HTML File = "/data/webserver/yennie";

Proc Summary Data = ABC Nway Missing;
Class month;
Var transif ;
Output out = ABC_smry (Drop = _Type_ _Freq_ ) Sum=;
Run;

%LET _EGCHARTWIDTH=0;
%LET _EGCHARTHEIGHT=0;
GOPTIONS xpixels=&_EGCHARTWIDTH ypixels=&_EGCHARTHEIGHT;
GOPTIONS COLORS = (CX0F3E93);
SYMBOL1 INTERPOL=SPLINES HEIGHT=10pt VALUE=NONE CV=RED LINE=1 WIDTH=3;
Axis1 STYLE=1 WIDTH=1 MINOR=NONE LABEL=( FONT='Arial /b' HEIGHT=13pt ANGLE=90 "Inforce Risks");
Axis3 STYLE=1 WIDTH=1 MINOR=NONE LABEL=( FONT='Arial /b' HEIGHT=13pt ANGLE=90 "Month");
TITLE;
TITLE1 " Portfolio ";
FOOTNOTE;

PROC GPLOT DATA = ABC_smry NOCACHE ;
PLOT transif * month /
GRID VAXIS=AXIS1
HAXIS=AXIS1 FRAME;
RUN;QUIT;

TITLE; FOOTNOTE;
GOPTIONS RESET=ALL;
ODS HTML Close;
Super Contributor
Super Contributor
Posts: 3,174

Re: how to 'force' SAS to output my ODS/Graphs remotely?

Start here for SAS/Graph output destination (both the HTML documents and the image files):

http://support.sas.com/documentation/cdl/en/grstatproc/61948/HTML/default/a003106589.htm

Scott Barry
SBBWorks, Inc.
SAS Employee
Posts: 967

Re: how to 'force' SAS to output my ODS/Graphs remotely?

Yennie - when I run the code I provided, it produces both a png file and an htm file, such as ...

login003> ls -lt foo*
-rwxr-xr-x 1 realliso isd 3172 Mar 24 08:11 foo.htm
-rwxr-xr-x 1 realliso isd 7569 Mar 24 08:11 foo.png

Try running the code from Windows SAS, as-is (with no changes), from a fresh SAS session. Oh, and not from EG. ... and I bet it will produce both files for you :-)

With that as your starting place, then try adding your own SAS/Graph proc, and make sure it still produces both files. And then try running it from EG, etc, etc. At each point, making sure it produces both files. Perhaps your SAS session has a setting that's overriding the code, or maybe something similar if you're running from EG.
Ask a Question
Discussion stats
  • 4 replies
  • 191 views
  • 0 likes
  • 3 in conversation