Your SAS programs, embedded in web apps and elsewhere

Start Stored Process from Stored Process

Reply
N/A
Posts: 0

Start Stored Process from Stored Process

Hi,

I would like to start a Stored Process within an other Stored Process.
Can anyone tell me how to do this?

Thnx.
Thierry
SAS Employee RMP
SAS Employee
Posts: 52

Re: Start Stored Process from Stored Process

Posted in reply to deleted_user
you can achieve this with two methods -

1 create a url link pointing to the new stored process.

or

2 a redirect script. The first stored process writes out some html which then redirects to the second script.

send me a mail I can give you some examples.

Other readers interested. Let me know I can post some code here.
Contributor
Posts: 73

Re: Start Stored Process from Stored Process

Could you post some code here ?

Thank you.
SAS Super FREQ
Posts: 8,864

Re: Start Stored Process from Stored Process

Hi:
Before you post any code with LT or GT symbols (as in HTML tags) remember that the LT symbol needs to be changed to < (ampersand-ltSmiley Wink and the GT symbol needs to be changed to > (ampersand-gtSmiley Wink in order to be able to post successfully.

So for example, an example of a URL that calls the Stored Process Web App is:
[pre]
<a target="new" href="http://yourserver.com:8080/SASStoredProcess/do?
_program=/MyFolder/MyStoredProcess&region=Canada">
Click here to launch the Stored Process</a>
[/pre]

as discussed here:
http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/stpwebapp.html

Every LT or GT symbol in the above HTML tag was coded with &lt; and &gt; -- inside a [ pre ] and [ /pre ] section (there are no spaces between the square brackets and the words pre or /pre).

cynthia
Regular Contributor
Posts: 163

Re: Start Stored Process from Stored Process

Posted in reply to Cynthia_sas
Hi:
This post is interesting. How would you specify in the htref link to specify a parameter without hard coding it? In other words, without hard coding &region=Canada ?
I could think of creating a concatanated string but is there a more simple way?
Thanks,
jp

Click here to launch the Stored Process
SAS Super FREQ
Posts: 304

Re: Start Stored Process from Stored Process

You can use a concatenated string in the DATA Step using the concatenation operator, or the CAT* functions. Here is an example:

[pre]
data _null_;
length string $1024;
set sashelp.shoes; by region;
if first.region;
string = '<a target="new" href="http://yourserver.com:8080/SASStoredProcess/do' ||
'?_program=/MyFolder/MyStoredProcess&region=' ||
urlencode(strip(region)) ||
'">Click here to launch the Stored Process for ' ||
strip(region) ||
'</a>';
file _webout;
put string;
run;
[/pre]

Vince DelGobbo
SAS R&D
Regular Contributor
Posts: 163

Re: Start Stored Process from Stored Process

Posted in reply to Vince_SAS
Thanks Vince.
jp
SAS Employee RMP
SAS Employee
Posts: 52

Re: Start Stored Process from Stored Process

Posted in reply to deleted_user
create a stored process and add the following data step. This code calls the second stored process defined in the URL parameter.

data _null_;
file _webout;
put '';
put "";
put '';
put '';
put '';
put '';
run;
SAS Employee RMP
SAS Employee
Posts: 52

Re: Start Stored Process from Stored Process

Posted in reply to deleted_user
Cynthia,

I just posted the code 'as is' and it appears to be ok.
SAS Super FREQ
Posts: 8,864

Re: Start Stored Process from Stored Process

That's good. Every time I try to post with < or > symbols in code, my posting gets trashed. Perhaps they've now changed the message handling. Up above, I have &-lt-;

but, for example, here I have the BODY tag in the next line

and now what will happen????

Ah, very nice -- that IS different behavior than I've seen in the past.

cynthia
N/A
Posts: 0

Re: Start Stored Process from Stored Process

Posted in reply to deleted_user
Would this also work in Excel with the MS Add-In or Enterprise Guide?
SAS Super FREQ
Posts: 8,864

Re: Start Stored Process from Stored Process

Posted in reply to deleted_user
Hi:
The Stored Process Web Application -- what is used when you invoke SASStoredProcess?do via URL
[pre]
http://yourserver.com:8080/SASStoredProcess/do?
[/pre]
is generally used with HTML/web services applications.

I have never tested trying to invoke a stored process from a stored process using the SPWA and the SAS Add-in. My sense is that it won't work. My suggestion is to contact Tech Support with this question.

cynthia
Ask a Question
Discussion stats
  • 11 replies
  • 339 views
  • 0 likes
  • 6 in conversation