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>

 

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

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>

 

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
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.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

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