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

Hi,

 

how can I enforce to always open a new window (= browser tab) for the Output of a Stored Process.

 

At the moment the situation is:

For the first run of the SP a new browser tab is opened containing the output of the SP.

For the following runs the same browser tab is used as before.

 

We would prefer to always have the output in a new window, so the previous outputs are still available. 

 

We work with STPBEGIN and ODS HTML.

 

Thanks,

Marlis

1 ACCEPTED SOLUTION

Accepted Solutions
Quentin
Super User

Hi,

 

target="_blank" is not part of the URL.  It's part of the link.  So if you are making a web page that has a link to a stored process, the link in the html file might look like:

 

<a href="https://myserver/SASStoredProcess/do?&_program=/MyFolder/MyStoredProcess"> MyStoredProcess </a>

When user clicks that link, it would open the result in the same browser tab.

 

If you change the link to:

 

<a href="https://myserver/SASStoredProcess/do?&_program=/MyFolder/MyStoredProcess" target="_blank"> MyStoredProcess </a>

The stored process results would open in a new browser tab.

 

target= is an attribute of the link, not part of the URL.  See e.g.: https://www.w3schools.com/tags/att_a_target.asp.

 

-Q.

 

 

The Boston Area SAS Users Group is hosting free webinars!
Next up: Joe Madden & Joseph Henry present Putting Power into the Hands of the Programmer with SAS Viya Workbench on Wednesday Nov 6.
Register now at https://www.basug.org/events.

View solution in original post

4 REPLIES 4
Quentin
Super User

Hi,

 

Depends how you are calling the stored process.  But could be as simple as adding target="_blank" to the link.

 

--Q.

The Boston Area SAS Users Group is hosting free webinars!
Next up: Joe Madden & Joseph Henry present Putting Power into the Hands of the Programmer with SAS Viya Workbench on Wednesday Nov 6.
Register now at https://www.basug.org/events.
Marlis
Calcite | Level 5

Thank you, Quentin!

 

I tried to intergrate this information into  the URL calling the SP.

So I changed

" .... /do?&_program=/ .... " to

 

" .... /do?&_action=newwindow&target="_blank"&_program=/ .... ".

 

I tried different versions of syntax (with/without _  or single/double quotation marks).

But nothing has changed.

 

Does anybody know the right syntax?

Quentin
Super User

Hi,

 

target="_blank" is not part of the URL.  It's part of the link.  So if you are making a web page that has a link to a stored process, the link in the html file might look like:

 

<a href="https://myserver/SASStoredProcess/do?&_program=/MyFolder/MyStoredProcess"> MyStoredProcess </a>

When user clicks that link, it would open the result in the same browser tab.

 

If you change the link to:

 

<a href="https://myserver/SASStoredProcess/do?&_program=/MyFolder/MyStoredProcess" target="_blank"> MyStoredProcess </a>

The stored process results would open in a new browser tab.

 

target= is an attribute of the link, not part of the URL.  See e.g.: https://www.w3schools.com/tags/att_a_target.asp.

 

-Q.

 

 

The Boston Area SAS Users Group is hosting free webinars!
Next up: Joe Madden & Joseph Henry present Putting Power into the Hands of the Programmer with SAS Viya Workbench on Wednesday Nov 6.
Register now at https://www.basug.org/events.
Marlis
Calcite | Level 5

Many thanks to you, Quentin 🙂

 

Now I have understood the logic.

 

Best, Marlis

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 1054 views
  • 2 likes
  • 2 in conversation