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>

 

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

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>

 

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
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.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1291 views
  • 0 likes
  • 2 in conversation