BookmarkSubscribeRSS Feed
Hari2
Quartz | Level 8

HI All,

 

I just want to create macro variable with hyper link and which will be used to display in  ods PDF Output .

 

 

for ex 

var1 = Google.com  with hyper link.

 

 

Thanks

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Why do you want to put it in a macro variable?  Surely even the most changeable url will be mostly the same each time.  Just use macro variables for the bit that changes, it will be a lot easier.

/* Will be a nightmare to work with */

%let var1=https://communities.sas.com/t5/forums/replypage/board-id/programming/message-id/130439;
%put &var1.;

/* As only message number changes */
%let var1=130439;
%put https://communities.sas.com/t5/forums/replypage/board-id/programming/message-id/&var1.;

If you have lots of these, then put it in a dataset - macro is not a replacement for Base SAS.

Hari2
Quartz | Level 8

hi ,

 

Thanks for reply.

 

but here, the thing is when I use the macro variable it replaces the text what ever we have given. But my requirement is, when I display URL through macro variable in in PDF, it should come as hyperlink (Means, in PDF when a link comes with underline, we can directly click on that to navigate). but currently macro variable is not coming with hyper link rather it just puts the required URL without Underscore.

s_lassen
Meteorite | Level 14

There is a nice description and solution by Cyntia_sas here

 

So you may want to make your macro variable something like

%let SAScom=^S={font_size=9pt font_face='Arial Unicode MS' url='http://www.sas.com'};

And you can use it like

ods escapechar='^';
Title "&SAScom.This is SAS";

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
  • 3 replies
  • 1164 views
  • 0 likes
  • 3 in conversation