4

我有一些 SAS 存储过程。当我在 SAS Enterprise Guide 中运行存储过程时,我会返回一些 HTML。我想做的是让我的 ASP .NET 项目连接到存储过程并在我的 ASP .NET 应用程序中返回 HTML。我知道我是从零开始的,所以我应该从一些文章或指南开始吗?

我希望我的问题是有道理的。

4

1 回答 1

2

简单 - 您必须注册您的 STP 才能获得_STREAM输出(使用 SAS 管理控制台),然后创建没有%stpbegin/宏的 SAS 代码,%stpend以便将put您的 HTML 直接发送到自动_webout文件引用。

然后,您的 ASP .NET 项目只需通过 URL(使用 CURL 或其他)调用 STP。

一种更简单的方法是以编程方式创建 Web 服务,例如:

%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)

有关https://sasjs.io的更多信息

值得指出的是,您甚至可能不需要 ASP,因为您的 Web/浏览器客户端也能够直接连接到 SAS。这可以通过 ajax 完成,但为了获得一致的方法,我建议使用 SASjs 数据适配器。它在 github 上可用:https ://github.com/sasjs/adapter

于 2017-03-16T14:30:29.663 回答