BookmarkSubscribeRSS Feed
ScottBass
Rhodochrosite | Level 12

Hi,

When I launch the Stored Process Web Application (SPWA) and navigate the folder structure, the stored processes (STP) all have the "newwindow" action.  For example:

http://myserver.com:8080/SASStoredProcess/do?_action=form,properties,execute,nobanner,newwindow&_program=%2FUsers%2Fsbass%2FMy+Folder%2FStored+Processes%2FExample+-+Batch+Program+Submission

1)  I'd prefer this particular STP not launch a new window, but instead send its results to the right hand frame of the SPWA.  In this regard, it is like the behaviour when no prompts are defined.  How do I make this happen?

2)  Furthermore, I'd prefer it display a javascript alert dialog "Your batch job has been submitted", and then redirect back to the originating STP (if a redirect is required).

I've got this code:

<html>

<head>

<script type="text/javascript">

alert("Your batch has been submitted. You will receive an email when your job has finished.");

window.location.href="http://<referring STP URL>"

</script>

</head>

<body>

</body>

</html>

It works fine in the browser, but I don't know how to get the referring URL in the STP.  Do I need to edit Params.config to create _HTREFER?  Or is there a better way to just display an alert without leaving the STP prompts window?

Thanks,

Scott


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
8 REPLIES 8
DavidHenderson
SAS Employee

To answer the second question, you could use the history object.

Instead of setting the window.location.href property, call this method:

history.go(-1);

DavidHenderson
SAS Employee

And the answer to your first question:

You can send the results to a specific browser frame by setting the _target macro in the SAS code:

&_target=name

In the Stored Process web app, the right frame is named "_stpOutput".  To replace the prompts with the stored process output, set the _target macro like this:

&_target=_stpOutput

ScottBass
Rhodochrosite | Level 12

Thanks, a few more questions:

1) Does &_target=_stpOutput need to be a hidden prompt, or can I set it in the STP code, i.e. %let _target=_stpOutput early in the SAS code?

2) Is there a way to change the *generated* URL by the SPWA, on a per STP basis, to suppress &_action=whatever,newwindow?

3) So, combining all the above, would I:

* Create a hidden prompt &_target=_stpOutput?  (depending on the answer to #1)

* And then write this to _webout via data _null_?

<html>

<head>

<script type="text/javascript">

alert("Your batch job has been submitted. You will receive an email when your job has finished.");

history.go(-1)

</script>

</head>

<body>

</body>

</html>

Thanks,

Scott


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
ScottBass
Rhodochrosite | Level 12

I've created a hidden prompt _target=_stpOutput.  I'm still getting the newwindow popup, instead of the _webout content going to the right hand frame of the SPWA.


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
shivas
Pyrite | Level 9

Hi,

I am not sure this will work or not..

data _null_;

file _webout;

if _n_ = 1 then do;

thissrv = symget('_url');

thispgm = symget('_program');

put '<FORM ACTION="' thissrv +(-1) '" method=get>';

put '<input type="hidden" name="_program" value="' thispgm +(-1) '">';

put '<input type="hidden" name=reqtype value="print">';

put  '<tr>';

put  ' <td align="right"><input type="submit" value="Submit Request" />

      <input type="Reset"  value="Reset" />

     </td>';

put   '</tr>';

put '</table>';

end;

run;

Thanks,

Shiva

GrischaPfister
Fluorite | Level 6

Hello folks,

 

has there ever been a solution to this issue?

 

Regards,

 

Grischa

Vince_SAS
Rhodochrosite | Level 12

Regarding question 1, if you want all stored processes to be affected, then you can edit the "Welcome.jsp" file located in the .../sas_webapps/sas.storedprocess.war/input/Samples/Welcome/ directory.  Look for this block of code:

 

<form id="IndexForm" action="<%=URI%>" method="post">

  <input type="hidden" name="_action" value="index,form,properties,execute,newwindow" >

</form>

<form id="SearchForm" action="<%=URI%>" method="post">

  <input type="hidden" name="_action" value="search,form,properties,execute,newwindow" >

</form>

<form id="ReportForm" action="<%=URI%>" method="post">

  <input type="hidden" name="_action" value="index,form,properties,execute,newwindow" >

  <input type="hidden" name="_type" value="report" >

</form>

 

The first instance of "newwindow" affects users that click on the "List Available Stored Processes and Reports" link on the Welcome page, and the second instance affects the "Search for Stored Processes and Reports" link.

 

Do not edit the "Welcome.jsp" file if you want to affect only some stored processes.  You can bypass the Welcome page by accessing this URL:

 

http://yourserver.com:8080/SASStoredProcess/do?_action=index,form,properties,execute

 

Instead of starting here and then clicking "List Available Stored Processes and Reports":

 

http://yourserver.com:8080/SASStoredProcess/do

 

Vince DelGobbo

SAS R&D

GrischaPfister
Fluorite | Level 6

Vince,

 

thanks a lot, this is a really helpfull tipp 😉

 

Regards,

 

  Grischa

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 8 replies
  • 2353 views
  • 1 like
  • 5 in conversation