I am trying to build an application which would use ASP.NET for the interface.
I have SAS EG installed on my system. I have completed a stored process which i want to run through this application when the interface is used.
The information entered on the interface will be used as the stored process parameters.
If you go to support.sas.com and look for the SEARCH box in the upper right hand corner of the web page (above the dark blue banner), you can type a search string into the SEARCH box. If you type stored process ASP
into the search box and then click the Search button, you will find that at least 8 of the first 10 hits that are returned are relevant to your question.
After a long time I have been successful running a independent SAS code file from a Web Application written in C# ASP.NET. I wanted to get some more pointers on the same.
Do help me with it.
using a part of the code which is as follows:
SAS.StoredProcessService sp =sasWS.LanguageService.StoredProcessService;
// tell it where to find the stored processes
sp.Repository = "file:c:\\output\\procs";
// and execute the stored process
where sasWS is SAS workspace object.
check is stored process name.
The information I want is how to send the parameter strPath to the SAS code. The line :
sp.Execute("check","strPath=Hello"); has the parameter argument but it does not get populated as variable in SAS code which I call.
SAS code is as follows:
proc print data=test;
where test is a temporary dataset. The stored process runs successfully which I see in a HTML output of the proc print. But the title doesn't get populated in the title.
As a best practice, in class, we recommend that you ALWAYS use the *ProcessBody; comment because then you have the most flexible stored process that could run on either server without any editing of the SP code, as described here from the doc:
"Parameters are not initialized in the same way for the stored process server and the workspace server. The stored process server sets parameter values before the stored process begins to execute. This means the first line of code in the stored process can access any input parameter macro variable. The workspace server does not set input parameters into macro variables until it reaches a *ProcessBody; comment line in the stored process:
A stored process that does not contain this line will never receive input parameters when executed on a workspace server.
It is recommended that you begin all stored processes (regardless of the server types) with %GLOBAL declarations for all of your input parameters followed by the *ProcessBody; comment:"
I also included the link for %stpbegin; and %stpend; (note that those are actually very LONG macro programs and to use them correctly, they MUST have ending semi-colons to correctly terminate the invocation string. Any overrides to the reserved macro paramters MUST appear BEFORE the %stpbegin; invocation.
You could have been getting an error because of the absence of the *ProcessBody. Without seeing the log message or your entire SP code, I don't know why you're getting errors. You might want to work with Tech Support, if the errors persist after you use *ProcessBody.