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

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.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

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.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
lexjansen
Fluorite | Level 6

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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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