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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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