BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

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

Thnx.
Thierry
11 REPLIES 11
RMP
SAS Employee RMP
SAS Employee
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.
Stephane
Quartz | Level 8
Could you post some code here ?

Thank you.
Cynthia_sas
SAS Super FREQ
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-lt;) and the GT symbol needs to be changed to > (ampersand-gt;) 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
jplarios
Quartz | Level 8
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
Vince_SAS
Rhodochrosite | Level 12
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
jplarios
Quartz | Level 8
Thanks Vince.
jp
RMP
SAS Employee RMP
SAS Employee
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;
RMP
SAS Employee RMP
SAS Employee
Cynthia,

I just posted the code 'as is' and it appears to be ok.
Cynthia_sas
SAS Super FREQ
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
deleted_user
Not applicable
Would this also work in Excel with the MS Add-In or Enterprise Guide?
Cynthia_sas
SAS Super FREQ
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

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
  • 11 replies
  • 1209 views
  • 0 likes
  • 6 in conversation