Hi:
You can alter your stored process code to include SAS Macro conditional logic, based on parameter values or based on parameters having some default value. Depending on your stored process and your data, you may want to create a SAS macro program to execute 2 different PROC SQL steps. Or you may want to split your differing SQL queries into different macro programs. Ther are a lot of different ways to add conditional logic to your stored process. Imagine something like this:
[pre]
%macro makesql;
%if &how = USEPARM %then %do;
proc sql;
create table work.wombat as
select *
from perm.master
where var1 = "&parm1" and other = "&parm2"
order by var1;
quit;
%end;
%else %do;
proc sql;
create table work.wombat as
select *
from perm.master
order by var1;
quit;
%end;
%mend makesql;
[/pre]
So in the above example, if the parameter &HOW is set to USEPARM, then the PROC SQL step includes a WHERE clause that uses input parameters. If the value of &HOW is anything else (empty value, something else), then the PROC SQL step has no WHERE statement. There are other ways to generate code like this, but for this example, inside your stored process, you'd have:
[pre]
%global how parm1 parm2;
*ProcessBody;
%stpbegin;
** this macro invocation will put the correct SQL step into the stored process;
** based on values of the macro parameter &HOW;
%makesql;
** no matter which PROC SQL step was used, still want to have a;
** PROC PRINT on work.wombat;
proc print data=work.wombat;
run;
%stpend;
[/pre]
Tech Support can help you figure out the best way to add macro conditional logic to your stored process. You can generate whole steps with macro code or you can generate single statements or parts of statements. It is a very powerful feature of SAS and if you're not familiar with macro processing, the documentation would be a good place to start, along with getting help from Tech Support.
cynthia