The SAS Output Delivery System and reporting techniques

Proc template (tables). Hyperlink

Frequent Contributor
Posts: 115

Proc template (tables). Hyperlink

Is it possible to design a table using proc tabulate that will embed hyperlinks on a given column based on the values of a category field.

I want to link(hyperlink) the calculated value in the third column to a sheet that will show the detail for that calculation.

I’m not having any luck finding this in the proc tabulate documentation.
Posts: 8,739

Re: Proc template (tables). Hyperlink

Generally, PROC TABULATE links are done on CLASS variables -- not on the calculated number in a cell. I'm not clear on where you want the link to be. It sounds like you want the link on the calculated number -- which would be hard (not impossible) but hard.

The way it works (if you put the link on the CLASS/CLASSLEV) variables is that a user defined format, like this:
proc format;
value $gend 'F' = ''
'M' = '';

is generally associated with a CLASSLEV statement as shown in the code snippet below:
class gender;
classlev gender / style={url=$gend.};
var age;
table gender, age*mean;

You don't know ahead of time what the MEAN of age is going to be, so it's hard to design a user-defined format that would be able to apply to ONLY one calculated MEAN. Whereas, if your detail file was the detail on females only, you could show the detail for females in one file and the detail for males in another file.

I have seen situations where folks will pre-calculate statistics and generate a dynamic format -- but before you go down this road, you have to be very sure that the numbers generated for each cell will be different, because there's no way to disginguish the 13.45 in one calculated cell from the 13.45 in another calculated cell.

PROC REPORT has more capabilities in the ability to set URLs dynamically and I believe there are some dynamic examples in these papers:

You might not need to design a custom table template if you tried to build a URL using PROC REPORT. And, remember that PROC TEMPLATE will not automatically summarize or calculate your cells -- it will only put information into cells -- so you'd have to pre-summarize or otherwise get your statistics for the TABLE template.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation