BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
sathyarajamohan
Calcite | Level 5

My requirement is when I click the link it should open in a new page.

 

proc gslide border
cframe=green
wframe=3 ;

note move=(35,20)pct height=35 j=c color="black"
link="\\xyz\xxx.htm" "Click Here" ;

run;

quit;

 

I tried the below

link="\\xyz\xxx.htm" "Click Here" hreftarget="_blank";

 

It didn't work for me. Please help me with samples to use the links in proc gslide

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

Hi: Interesting approach.  And thank you for jogging my memory. When I was testing I just right clicked and chose "Open in New tab" or "Open in new window" -- so the target=_blank in the OP's code didn't really register with me.

  I like how you did that. At first I thought about the HREFTARGET style atttibute, but GSLIDE doesn't use a STYLE template like a report procedure does.

  However, dipping back into my ODS/HTML early days I thought I remembered something, so I started searching and:


ods html path='c:\temp' (url=none) file='linkbase.html' headtext='<BASE target=_blank >';
proc gslide border
cframe=green
wframe=3 ;

note move=(35,20)pct height=12pt j=c bold color="purple"
link="https://www.sas.com/en_us/home.html" "Click Here to visit SAS";

run;

quit;
ods html close;

  I'd forgotten about this TS note https://support.sas.com/kb/24/058.html but rediscovered it looking for HREFTARGET.

 

Cynthia

View solution in original post

11 REPLIES 11
Quentin
Super User

When you use:

note move=(35,20)pct height=35 j=c color="black"
link="\\xyz\xxx.htm" "Click Here" ;

Does the link work?  If so, I would try:

note move=(35,20)pct height=35 j=c color="black"
link="\\xyz\xxx.htm" "Click Here" "target='_blank'";

But that's just a guess.  Since the NOTE statement is apparently making a link for you, you might need to look at the html it produces to see what is wrong about the link.  For example, if it is treating the entire string as a URL, you might not be be able to break out of it to add a target= option in the HTML, or you might need to add more quote marks.

 

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
sathyarajamohan
Calcite | Level 5

Thank you for the quick reply.

 

The suggested solution didn't work for me.

Though the link works for me it still open in the current window only.

 

Quentin
Super User

Can you post the HTML code that you are getting as output?  Just the section of the code that shows the <a href=...> ... </a> definition?

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
Cynthia_sas
SAS Super FREQ

Hi my understanding of the LINK= option was that it needed to be a URL, which starts with HTTP:// or HTTPS:// your LINK= value looks like a network drive location, not a URL.
I find that if I use a modified version of your code with explicit ODS HTML statements and a valid URL for LINK= and then I open the created HTML file in a browser then the link on the GSLIDE works for me. Here's the code I tested. I changed the size of the HEIGHT= value because 35 was huge for me.
Cynthia
My test:

ods html path='c:\temp' (url=none) file='slidelink.html';
proc gslide border
cframe=green
wframe=3 ;

note move=(35,20)pct height=12pt j=c bold color="purple"
link="https://www.sas.com/en_us/home.html" "Click Here to visit SAS";

run;

quit;
ods html close;

** then open slidelink.html in a browser;
Quentin
Super User

Hi @Cynthia_sas , thanks for jumping in.  I totally missed that the link in the OP's code wasn't a URL.  Looks like your code did not make it into your post.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
Quentin
Super User

I played a bit to try to add target=_blank to Cynthia's code.

 

The below hack creates some ugly HTML, but it seems to work okay in chrome.

 

ods html path='C:\junk' (url=none) file='slidelink2.html';
proc gslide border
cframe=green
wframe=3 ;

note move=(35,20)pct height=12pt j=c bold color="purple"
link="https://www.sas.com/en_us/home.html"" target='_blank'" "Click Here to visit SAS"; *this doesnt do what I had hope, but it seems to work in chrome at least;
run;

quit;
ods html close;

The html looks like:

<area shape="RECT" href="https://www.sas.com/en_us/home.html"" target='_blank'" coords="280,465,437,483">

So there is an extra pair of double quotes in the HTML, which is probably bad.  But chrome doesn't seem to worry about it.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
Cynthia_sas
SAS Super FREQ

Hi:

Hi: Interesting approach.  And thank you for jogging my memory. When I was testing I just right clicked and chose "Open in New tab" or "Open in new window" -- so the target=_blank in the OP's code didn't really register with me.

  I like how you did that. At first I thought about the HREFTARGET style atttibute, but GSLIDE doesn't use a STYLE template like a report procedure does.

  However, dipping back into my ODS/HTML early days I thought I remembered something, so I started searching and:


ods html path='c:\temp' (url=none) file='linkbase.html' headtext='<BASE target=_blank >';
proc gslide border
cframe=green
wframe=3 ;

note move=(35,20)pct height=12pt j=c bold color="purple"
link="https://www.sas.com/en_us/home.html" "Click Here to visit SAS";

run;

quit;
ods html close;

  I'd forgotten about this TS note https://support.sas.com/kb/24/058.html but rediscovered it looking for HREFTARGET.

 

Cynthia

sathyarajamohan
Calcite | Level 5

Thank you @cynthia for the solution. It works for me.

 

Even I missed to remember this option. Thank you for the detailed explanation.

 

 

 

Quentin
Super User

Very cool, thanks Cynthia.  Not surprising at all that the Queen of ODS would come up with the proper way to do this, rather than my attempted hack.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
sathyarajamohan
Calcite | Level 5

Thank you Quentin for trying to solve the issue.

 

The suggested way didn't work for me. Soon will come back with more questions.

Thank you!!

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
  • 11 replies
  • 1804 views
  • 1 like
  • 3 in conversation