BookmarkSubscribeRSS Feed
gzr2mz39
Quartz | Level 8
I have a variable called url1 (eg www.abc.com, www.sas.com).
How do I include the variable url1 in the code below?
Also, I have a macro variable &path (where &path is
%let path=%str(http://xyz.com/);
How would I combine &path and url2 (where url2 is place1, place2, etc) in the code below to create links like http://xyz.com/place1, http://xyz.com/place2, etc?

proc report data=reports nowd style(report)={width=100pct}
style(header)={background=cx494068 color=white};
columns date title new;
define new / computed " ";
compute title;
call define(_col_, "style", "style=[color=blue textdecoration=underline url='" url1 "']");
endcomp;
run;

Thank you.
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
Instead of setting the URL in a STYLE= override in the CALL DEFINE statement, investigate the use of the URL and URLP arguments to CALL DEFINE (instead of STYLE argument).

http://support.sas.com/kb/25/394.html
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a002473624.htm

cynthia
gzr2mz39
Quartz | Level 8
I tried the code below.
"title" is the name of the document I'm trying to link to and "url" is, eg, http://abc.com.
"title" is being underlined, but the link is not being created.
Thank you for your help.

proc report data=reports nowd style(report)={width=100pct}
style(header)={background=cx494068 color=white};
columns date title url;
define url / noprint;
compute title;
urlstring=url;
call define(_col_,'URL', urlstring);
call define(_col_, "style", "style=[color=blue textdecoration=underline");
endcomp;
Cynthia_sas
SAS Super FREQ
Hi:
PROC REPORT works from LEFT to RIGHT as it builds a report row. This means that you cannot use URL in the calculattion of TITLE unless their positions are reversed on the COLUMN statment:
[pre]
columns date url title;
[/pre]

cynthia
gzr2mz39
Quartz | Level 8
Thank you. Looks good.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2373 views
  • 0 likes
  • 2 in conversation