3

I know there is a method where you can call a stored process via the SAS Stored Process Web Application, but I was wondering if there is a method where i can call the stored process server directly.

The goal is to call a stored process which delivers data (via the _webout file?) to python, as efficiently as possible. So maybe it could reduce processing time by skipping the SAS Web Application.

I don't think it is possible with SASPy (seems to be using Workspace servers).

Regards.

2 Answers 2

1

There are 2 ways to call a stored process server in code, using the Java libraries and using the .NET libraries.

Personally, I have used .NET to create a command line application that calls the stored process and returns the stream to STDOUT. From Python, you just read that output. You can replicate this from Java (but the .NET libraries are easier to use).

The other method would be to use a library that allows you to call Java from your flavor of Python (or .NET if you are using the MS Python) and integrate it that way.

In the end, for most use cases, it is just easier to use the STP Web Application. You can log in once, store the authorization token, and pass that back, negating the overhead of re-logging in for each call.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! Do you have any references to tutorials or examples to do this? Not familiar with C# or Java.
Check the SAS documentation. If you have questions on it, I recommend talking to SAS Tech Support.
1

Your best bet will be to install saspy, configure your sascfg_personal.py file, open a session, and run the stored process. Something like this:

import saspy
sas = saspy.SASsession(cfgname='winiomwin')
stp = 'proc stp program="/Shared Data/Stored_Processes/your_SP"; run;'
sas_output = sas.submit(stp)
sas_log = sas_output['LOG']

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.