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>

 

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

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>

 

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
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.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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