How to call a stored procedure within a stored procedure

113 Views Asked by At

I have create a stored procedure which has prompt to select two values, on selection of any of the values I need to call another stored procedure which I have created through SAS DI where user can again pass another set of values to the prompt.

In first stored procedure file I have given below condition to call stored procedure on selected value.

%sysfunc(ifc("&Prompt." = "Prompt_Value1", 
%nrstr(%include "stp1 link" "operties,execute,nobanner,newwindow&_program=%2F%2FStored+Process%2FBarring_Prompt";),
%nrstr(%include "stp12 link";)));
1

There are 1 best solutions below

0
On

You can't do this as you would need your job to authenticate with SASLogon first.

Instead, you can use PROC STP to call the STP - this macro has an example (we use it to run our test suites): https://core.sasjs.io/mx__testservice_8sas_source.html

Alternatively, just run the underlying code. This macro will grab it for you:
https://core.sasjs.io/mm__getstpcode_8sas.html