B--rian
B--rian

Reputation: 5880

REST endpoints for SAS macros?

Assume we have a set of custom written SAS macros with a couple of parameters each. Let us further assume that these input parameters are mostly scalar (i.e. single numbers) or small tables. I am now trying to figure out how to build REST endpoints for these macros with the simplest possible architecture. I am currently having a nginx webserver for the outside world, and a SAS server in the secure zone. What I am after is something like Python Flask for SAS. Did somebody try that yet?

The input data is concise enough to push to a web server using POST or GET, the results of the macros are usually a simple table which can converted to a JSON, so that should not be problem.

PS: I am asking here, because I figured out that I am probably using the wrong search terms.

References

Upvotes: 3

Views: 673

Answers (3)

Allan Bowe
Allan Bowe

Reputation: 12701

Your choices are:

  • BIWS -> you can define REST endpoints using BI Web Services
  • https://sas9api.io -> an actual REST api for SAS 9a, not open source though
  • https://sasjs.io -> not REST but will let you build a web app very easily using Javascript

Upvotes: 1

AlanC
AlanC

Reputation: 582

Ok, simplest possible architecture is how I approach it. The SAS web services architecture is pretty complex. Viya is better, from what I have seen, but you probably don't have that. See my paper here on Lightweight SAS Web Services (https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3604-2019.pdf). The way I do it is use ASP.NET Core, Web API, and SAS Integration Technologies. .NET Core runs on all major O/Ss but SAS Int Tech uses DCOM on Windows and CORBA (I believe) on Linux. SAS probably has a Java interface on Linux as well.

Set up the IntTech calls and get that to work then wrap it with web service code. Watch out for logging and results.

This is very, very doable. I have done it a lot with SOAP, REST, and now gRPC. Get the SAS submission out of the way then wrap it.

Upvotes: 2

user667489
user667489

Reputation: 9569

I think the closest thing to what you're after is probably the SAS Stored Process Web Application:

https://documentation.sas.com/?docsetId=stpug&docsetTarget=n1gt44n8wc0la0n18s9kajwq0o2q.htm&docsetVersion=9.4&locale=en#p1h7zy9iqb8wzzn14nyflilmeafw

Does that do roughly what you had in mind?

Upvotes: 1

Related Questions