BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sourav_sas
Quartz | Level 8

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Sourav_sas
Quartz | Level 8

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

5 REPLIES 5
ChrisBrooks
Ammonite | Level 13

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;
Sourav_sas
Quartz | Level 8

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

Sourav_sas
Quartz | Level 8

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

 

Regards

Sourav

Sourav_sas
Quartz | Level 8

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;

 

Sourav_sas
Quartz | Level 8

 

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 5 replies
  • 1778 views
  • 0 likes
  • 2 in conversation