Your SAS programs, embedded in web apps and elsewhere

Stored Process Parameters and other questions

Reply
Frequent Contributor
Frequent Contributor
Posts: 77

Stored Process Parameters and other questions

When I define a stored process in SMC, I group parameters that the SP will use. The parameters on a tab, are arranged in order of importance and the groups of parameters correspond to a step in a multistep process. However, If I wish to insert a parameter into a group, or move a parameter from one group to another the only way that I can find is to start all over. Is it possible to move parameters around between groups and within groups? Is there a file somewhere that stores stored process that might be modifiable? Is this something that has improved in 9.2?

Also is it possible to assign a default value to a parameter based on a function.
For instance a default value might be today()?

Another nagging question is How do you decide when it is appropriate to define using stored process server, and when do you use it with workspace server.

I can't find any good documentation for this(stored processes) so if anyone has a link I would be very greatful.

Thanks
SAS Super FREQ
Posts: 8,864

Re: Stored Process Parameters and other questions

Hi:
You'd have to check with Tech Support about your first question and the ability to rearrange parameters in a group or tab.

As for assigning a default value, you can always assign a value to a parameter -- in your program -- in a %LET statement or inside a macro program conditional %IF test:
[pre]
%let parm1 = %sysfunc(today(),mmddyy10.);

[/pre]

The Stored Process server and Workspace server have different capabilities. Some differences are:
1) Streaming output -- possible on the SP server; not possible on the WS server
2) Multiple value parameters (such as pick 3 values for a parameter) -- possible on the SP server; not possible on the WS server;
3) Your SP is populating data for an information map -- that SP must run on the WS server.

There are other differences, which are outlined in the stored process documentation, some of which you can find here:
http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/result.html
http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/program.html
http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/program.html#choose
http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/input.html

You will also want to check the Platform Administrator's guide for particular server differences and the SAS Integration Technologies documentation about stored processes.

cynthia
SAS Super FREQ
Posts: 304

Re: Stored Process Parameters and other questions


Using the SAS Management Console in SAS®9.2, you can move prompts within groups and also move a prompt from one group to another.


The attached file "PromptGroup1.png" shows a stored process that has several prompts and prompt groups. With the prompt named "simple_int" selected, note that I can use the "Move Down" button on the right side of the panel to change the location of the prompt within the prompt group. The "Move Up" button is disabled because the prompt is already at the top of the group.


To move a prompt to another group, select the prompt and either double-click it, or click the "Edit..." button on the right side of the panel. The resulting dialog is shown in attached file "PromptGroup2.png". To move the prompt to a different group, select the desired group from the "Parent Group" drop-down list. Here the top group, "Parameters", is being selected. Click OK to save your selection.


The attached file "PromptGroup3" shows that the prompt "simple_int" has been moved from the "numeric" group to the bottom of the "Parameters" group. You may now change the location of the prompt in this group by using the "Move Up" button.


Also in SAS®9.2, you can choose "commonly used" values for date and time prompts, as shown in attached files "DatePrompt.png" and "TimePrompt.png", respectively.


Similar functionality is available if you are using SAS Enterprise Guide 4.2.


To use a function as a default value of a prompt, try this:


1. Create a stored process with a text prompt named "DATE" with a default value "%sysfunc(today())".


2. Use this SAS code:



[pre]
*ProcessBody;

data test;
do i = 0 to 5;
thedate = today() + i;
output;
end;
run;

%STPBEGIN;

data _null_;
call symput('DATE', resolve("&DATE"));
run;

title "The value of DATE is &DATE";
proc print data=test;
where (thedate eq &DATE);
run; quit;

%STPEND;
[/pre]


When you execute the stored process, the PRINT procedure should display only the first observation.

Vince DelGobbo
SAS R&D
Frequent Contributor
Frequent Contributor
Posts: 77

Re: Stored Process Parameters and other questions

Vince,

I don't see the attachments. What am I missing?
SAS Super FREQ
Posts: 304
Ask a Question
Discussion stats
  • 4 replies
  • 233 views
  • 0 likes
  • 3 in conversation