BookmarkSubscribeRSS Feed
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 ...;

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.


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!

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:

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

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:


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?



Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.


Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 


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
  • 3 replies
  • 3 in conversation