This solution (putting the entire anchor tag) into an output data set is building a column that contains an anchor tag. The anchor tag will not turn into a link until HTML comes into play somehow -- this points to a report procedure and ODS HTML at a minimum or FILE PRINT ODS and ODS HTML. At the very least, in EG, you would have to run a List Data task on the output table in order to be able to see the links "in action".
Also, the URL that you build, must be syntactically correct. An <A> tag is not syntactically correct until the </A> is also provided. ( I suspect that you had the closing tag in your code, but that it was "disappeared" by the forum text editor.)
If you use the SERIALNUMS data from the above example, either of these will produce a detail report table with a hyperlink on every row -- assuming that the anchor tag is already a column in the data. However, if all you want is a hyperlink in the HTML output report, then PROC REPORT can also do that in a CALL DEFINE without needing to build a separate column.
EG is doing the equivalent of the ODS HTML "sandwich" for you, so the PROC PRINT on the output table is the equivalent of the List Data task. I highlighted the background of the link to make it stand out from the "regular" SERIAL column.
cynthia
[pre]
data serialnums;
infile datalines;
input serial $ val1 val2 state $;
return;
datalines;
abc123 12 4 WA
abc123 15 3 CA
abc123 25 10 ND
xyz123 10 5 NC
xyz123 10 4 MA
xyz123 5 2 DE
;
run;
ods html file='c:\temp\showlinks_detail.html' style=sasweb;
proc report data=serialnums nowd
split='#';
title 'Detail Report With URL Links directly from SERIAL value';
column serial val1 val2 state;
define serial / display;
define val1 / sum "Amt#Sold";
define val2 / sum "Amt#Discounted";
define State / 'State #Code';
compute serial;
length tmpvar $30;
tmpvar=catt('http://website.com/',serial);
call define(_COL_,'URL',tmpvar);
endcomp;
run;
title 'With Data Step directly';
data outputTable;
set serialnums ;
length ser_link $200;
ser_link=compbl("<a href=http://website.com/"||SERIAL||">"||SERIAL||'</a>');
file print ods;
put _ods_;
run;
proc print data=outputTable;
title 'Print on Data set: link contained in new column';
var serial val1 val2 state;
var ser_link / style(data)={background=cxeeeeee};
run;
ods html close;
[/pre]