BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
lexjansen
Obsidian | Level 7

I know I can connect SAS on Demand with SASPy.

But I like to to test SAS code that uses Python functions created with PROC FCMP at SAS on Demand. It looks like MAS_PYPATH is not set in SAS on Demand.

Is there a way to do this?
 
Thanks,
Lex
 
ERROR: masPublish encountered a failure.
ERROR: Foreign Language Compilation messages:
ERROR: Python compile: ERROR: MAS_PYPATH environment variable is undefined.
ERROR: Python compile: ERROR: tkmaspyPublish encountered a failure in tkmaspyConnect, rc=0x803FC26A.
ERROR: Unable to publish program for foreign language execution.
ERROR: Error reported in function 'python:PUBLISH' in statement number 6 at line 21 column 6.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

Lex, I don't know this for certain but I suspect Python is not generally available for SAS code in this environment.

 

With over a quarter million active users, the SAS OnDemand for Academics environment has to limit the ability to call out to external processes, including things like Python. 

 

In an environment where you had some control, you could set these environment variables in your SAS program to known values:

options set=MAS_PYPATH="path-to-python"
        set=MAS_M2PATH="your-sas-root/SASFoundation/9.4/misc/tkmas/mas2py.py";

 

But then you would also need to be able to install (or ask for) the Python packages you need. numpy, pandas, etc are likely not in a vanilla environment, so an admin needs to make those packages available in order for you to do anything useful. Given the governance needed for SAS OnDemand for Academics, I'm thinking these use cases are out of scope.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

View solution in original post

2 REPLIES 2
ChrisHemedinger
Community Manager

Lex, I don't know this for certain but I suspect Python is not generally available for SAS code in this environment.

 

With over a quarter million active users, the SAS OnDemand for Academics environment has to limit the ability to call out to external processes, including things like Python. 

 

In an environment where you had some control, you could set these environment variables in your SAS program to known values:

options set=MAS_PYPATH="path-to-python"
        set=MAS_M2PATH="your-sas-root/SASFoundation/9.4/misc/tkmas/mas2py.py";

 

But then you would also need to be able to install (or ask for) the Python packages you need. numpy, pandas, etc are likely not in a vanilla environment, so an admin needs to make those packages available in order for you to do anything useful. Given the governance needed for SAS OnDemand for Academics, I'm thinking these use cases are out of scope.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
lexjansen
Obsidian | Level 7

Thanks, Chris, I get that. SAS OnDemand is really a vanilla SAS environment to get 'a taste of SAS'.

I appreciate your detailed response.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1593 views
  • 1 like
  • 2 in conversation