Reputation: 915
I have some SAS Stored Processes. When i run the stored processes in SAS Enterprise Guide I get some HTML returned. What i would like to do is make my ASP .NET project connect to the Stored Process and return the HTML in my ASP .NET application. I know that i'm starting from zero, so is there some articles or guides I should follow to begin with?
I hope my question makes sense.
Upvotes: 4
Views: 619
Reputation: 12691
easy - you have to register your STP to have _STREAM
output (using SAS Management Console) then create your SAS code without the %stpbegin
/ %stpend
macros so that they put
your HTML directly to the automatic _webout
fileref.
Your ASP .NET project then simply needs to call the STP via the URL (using CURL or whatever).
An even easier way is to create the web service programmatically, eg:
%let appLoc=/Public/app; /* Configure Metadata or Viya Folder location here */
filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc; /* compile macros */
filename ft15f001 temp;
parmcards4;
proc sql;
create table areas as select distinct area from sashelp.springs;
%webout(OPEN)
%webout(OBJ,areas)
%webout(CLOSE)
;;;;
%mp_createwebservice(path=&appLoc/common,name=appinit,code=ft15f001,replace=YES)
More info on https://sasjs.io
It's worth pointing out that you may not even need ASP, as your web / browser client is also able to connect to SAS directly. This can be done via ajax, but for a consistent approach, I'd recommend the SASjs Data Adaptor. It's available on github here: https://github.com/sasjs/adapter
Upvotes: 2