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";

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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