BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
shlomiohana
Obsidian | Level 7
hello,

I use a stored process , i need to open a permanent link at the end or the run.

I worte the following code:

data _null_;
file _webout;
put '<HTML dir="rtl" >';
put '<body>';
put '<HEAD><TITLE>PEGA</TITLE></HEAD>';
put '<h1>Welcome ';
put '<br>';
put '<a href ="https://crmpg.com">CLICK TO OPEN</a>';
put '</h1>';
put '</body>';
put '</HTML>';
run;

The user need to click on "CLICK TO OPEN" in web browser to get to https://crmpg.com.

Is there a possibility that the link opens automatically without user intervention?

Thanks.
1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

You could add a JavaScript redirect to the HTML you create. You've probably seen this pattern in action many times.

 

Whether it works will depend on the trust your browser window/client machine has with your results page (that is, will it allow the script to run).

 

<html>
 <head>
<script type="text/JavaScript">
 function Redirect() {
window.location = "https://crmpg.com";
 }
 document.write("You will be redirected to the new page in 5 seconds.");
 setTimeout(function() {
Redirect();
 }, 5000);
</script>
 </head>
</html>

 

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

View solution in original post

3 REPLIES 3
ChrisHemedinger
Community Manager

You could add a JavaScript redirect to the HTML you create. You've probably seen this pattern in action many times.

 

Whether it works will depend on the trust your browser window/client machine has with your results page (that is, will it allow the script to run).

 

<html>
 <head>
<script type="text/JavaScript">
 function Redirect() {
window.location = "https://crmpg.com";
 }
 document.write("You will be redirected to the new page in 5 seconds.");
 setTimeout(function() {
Redirect();
 }, 5000);
</script>
 </head>
</html>

 

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
shlomiohana
Obsidian | Level 7
It works, how do I change that there won't be a 5 second wait, that the user will go directly to the link
ChrisHemedinger
Community Manager

From what I've seen, general practice is to code in the short delay and also a link they can click in case the script does not run for some reason.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

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