The SAS Output Delivery System and reporting techniques

proc report url

Reply
Regular Contributor
Posts: 199

proc report url

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.
SAS Super FREQ
Posts: 8,862

Re: proc report url

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
Regular Contributor
Posts: 199

Re: proc report url

Posted in reply to Cynthia_sas
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;
SAS Super FREQ
Posts: 8,862

Re: proc report url

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
Regular Contributor
Posts: 199

Re: proc report url

Posted in reply to Cynthia_sas
Thank you. Looks good.
Ask a Question
Discussion stats
  • 4 replies
  • 225 views
  • 0 likes
  • 2 in conversation