Desktop productivity for business analysts and programmers

How to create Hyper link in particular column of dataset

Accepted Solution Solved
Reply
Contributor
Posts: 71
Accepted Solution

How to create Hyper link in particular column of dataset

Hi

 

I have one situation. I have one dataset, in this dataset one column is there containing all links like

 

Capture 1.JPG

When I am getting the output in excel or HTML from at from SAS code, I am getting the data in that particular column as normal data, but I need that data in Hyperlink format.

 

Can you help me how can I get that. What ods format I can use to get that. I need that code in PROC REPORT actually. To print the data I am using PROC REPORT.

Situation is little bit urgent, expecting quick help.

 

Regards

Sourav

 


Accepted Solutions
Solution
4 weeks ago
Contributor
Posts: 71

Re: How to create Hyper link in particular column of dataset

Posted in reply to ChrisBrooks

I have used this code

 

ods html file="/var/opt/data/data_project/sas94/bire/redwh/data/tmp/temp.html" ; 

PROC REPORT DATA=FINAL_REPORT;

COLUMN DATA_DICT_LINK;

DEFINE DATA_DICT_LINK / DISPLAY "Wiki Link" ;

compute DATA_DICT_LINK ;

href=trim(DATA_DICT_LINK)||".html";

call define(_col_, "URL", href);

 

endcomp;

run;

 

 

 

I have tried with URLP and URB also but not getting the link in proper way, which been mentioned in side the column. I mean to say exact link is not opening. When clicking on that hyperlink from excel output.

 

 

Regars

Sourav

 

 

ods html close;

 

View solution in original post


All Replies
Valued Guide
Posts: 555

Re: How to create Hyper link in particular column of dataset

Posted in reply to Sourav_sas

It looks like you're missing the appropriate tags in your data set variable - this works for me, for example

 

data test;
link = "<a href='https://www.sas.com/en_us/home.html'>SAS</a>";
run;

ods html body="/folders/myshortcuts/Dropbox/test.html";
proc print data=test;
run;
ods html close;
Contributor
Posts: 71

Re: How to create Hyper link in particular column of dataset

Posted in reply to ChrisBrooks

Thank

 

I am using proc report there in my project. Anything you can suggest there. For that column. To get all the link from that column as hyperlink.

 

Regards

Sourav

Contributor
Posts: 71

Re: How to create Hyper link in particular column of dataset

Posted in reply to ChrisBrooks

also in that column I have many links. How can I hyperlink that.

 

Regards

Sourav

Solution
4 weeks ago
Contributor
Posts: 71

Re: How to create Hyper link in particular column of dataset

Posted in reply to ChrisBrooks

I have used this code

 

ods html file="/var/opt/data/data_project/sas94/bire/redwh/data/tmp/temp.html" ; 

PROC REPORT DATA=FINAL_REPORT;

COLUMN DATA_DICT_LINK;

DEFINE DATA_DICT_LINK / DISPLAY "Wiki Link" ;

compute DATA_DICT_LINK ;

href=trim(DATA_DICT_LINK)||".html";

call define(_col_, "URL", href);

 

endcomp;

run;

 

 

 

I have tried with URLP and URB also but not getting the link in proper way, which been mentioned in side the column. I mean to say exact link is not opening. When clicking on that hyperlink from excel output.

 

 

Regars

Sourav

 

 

ods html close;

 

Contributor
Posts: 71

Re: How to create Hyper link in particular column of dataset

Posted in reply to Sourav_sas

 

At last it worked for me. I have just removed

||".html"; 

 

this part from the code, because my link was tiny link. For tiny link it was not working. For other link it will work.

 

Thanks

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 162 views
  • 0 likes
  • 2 in conversation