BookmarkSubscribeRSS Feed
barbier
Calcite | Level 5

I use:

SAS Base 9.1

Linux Server

Interactive mode

I would like to output a html-file which is later called by an other program. (This progam is not compatible with activex, so I can not use activex as device. That is why I use PNG.)

In this html-file there need to be 2 things:

1) a clickable link to an other file

2) a graph

I used this code:

/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

goptions DEV=PNG cback=white noborder;

ods html file="&export_path.&GraphName._&sitename_title_2..html";
ods html text="&titlestatement";

ods html text='<a HREF="file..."> click here </a>'
ods html close;ods markup    style=SASWEB   path="&export_path" (URL=NOne)   file="&GraphName._&sitename_title_2..html"    tagset=HTML4 ;  

proc gplot data = ...;
   where ...;
   plot ...;
run;

ods markup close;

/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

The problem is that the output of the markup part overwrites the output of the html part. So i see my graph, but not my title and link.

Is there a way to add (not overwrite) the output from the markup part to the html part? Something like the file is kept open and completed in stead of overwritten?

Other things I have tried:

a) no ods html. print link with title statement within ods markup. problem: link is not clickable. html code itself is printed literally.

b) no ods markup part. proc gplot within ods html. For device PNG (or GIF), the graph is not readable.

failed_graph.PNG

It works for activex but that I can not use because my client program is not compatible with activex.

What can I do to have a clickable link and a PNG-graph in one outputfile?

Many thanks!

3 REPLIES 3
GraphGuy
Meteorite | Level 14

With dev=png, you get 2 files ... a png file with the graph, and an html file that displays the graph and overlays the clickable links, etc.  Using this 2-file technique, you can use the 'link=' option on the title statement.

Here is an example:

http://robslink.com/SAS/democd48/gasoline_prices.htm

http://robslink.com/SAS/democd48/gasoline_prices_info.htm

In 9.1, (if I recall correctly) dev=activex or dev=java are the only alternatives to produce graphs with a link capability in a single file.  Caveats: With dev=activex, the person viewing the output must have the SAS/Graph Activex control installed in order to view the output.  With dev=java, the person viewing the graph would need to be able to get to the java jar files to view the output. 

Note that SAS 9.1 is a very old version, and there have been many improvements since then - I'd encourage you to upgrade! Smiley Happy

GraphGuy
Meteorite | Level 14

In SAS 9.3, you have 2 additional choices for producing SAS/Graph output in a single file, and have link/drilldown capability:  dev=pdf, and dev=svg

See the 2nd bulleted item in Chapter 18 (SAS/Graph), p. 153 in this SAS 9.3 "What's New" document:

http://support.sas.com/documentation/cdl/en/whatsnew/64209/PDF/default/whatsnew.pdf

DanH_sas
SAS Super FREQ

One thing I'm not clear about in your example is why you are opening two destinations on the same file. Can you combine your text, link, and graph all under ODS HTML?

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1435 views
  • 0 likes
  • 3 in conversation