The SAS Output Delivery System and reporting techniques

Proc template (tables). Hyperlink

Reply
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.
SAS Super FREQ
Posts: 8,739

Re: Proc template (tables). Hyperlink

Hi:
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:
[pre]
proc format;
value $gend 'F' = 'http://www.server.com/detail/female.html'
'M' = 'http://www.server.com/detail/mail.html';
run;
[/pre]

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

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:
http://support.sas.com/resources/papers/proceedings09/026-2009.pdf
http://support.sas.com/resources/papers/proceedings09/154-2009.pdf
http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf

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.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 129 views
  • 0 likes
  • 2 in conversation