BookmarkSubscribeRSS Feed
rarahsghsdd
Calcite | Level 5

Hi SAS Community,

 

I am using SAS Studio in Viya and I am able to run python code in Jupyter using swat library of SAS. But now I wanted to execute Python scripts in SAS Studio.

Is there anyway through which I can execute python scripts in SAS studio in Viya ??

 

 

 

Thank You!

5 REPLIES 5
alexal
SAS Employee

@rarahsghsdd,


The only one way to do that is to execute Python scripts via X command. You can do that only in SAS Studio 4. XCMD was disabled in SAS Studio 5.

AmyP_sas
SAS Employee

I'd love to hear more about your use case.  We've kept SAS Studio focused on SAS coding.  My assumption (based on talking to different types of users) is that a Python (or R or whatever) coder already has an interface they like using that's optimized for Python (or R, etc.).  They would not consider using a SAS interface like Studio.  So we made a conscious decision not to add support for other languages since it would take development effort away from the long wish list we have from SAS programmers.  If that's not the case, I need to know!  Thanks! 

rarahsghsdd
Calcite | Level 5

Actually In my case i am using SAS in Sas Studio and entire code in sas but somewhere in between in SAS code I need to execute python script to use one of python library in SAS studio. 

 

 

Thank You!

mkeintz
PROC Star

What a minute!

 

Taking away the X command has an impact on far more tasks than running python or R, or any other language.  I believe that it removes the ability to call any operating system command, no?   So while many R and Python users may not miss the X command, I'm sure others will.  I've often used X for other tasks - quickly getting directories, and other attributes of my files, and doing some housekeeping.

 

Possibly more awkward: doesn't taking away the X command also remove the ability to use a pipe in a filename statement?  If so, then what if the user (user of unix in my case) wanted to use the TAIL command to get just the last 10 records of a 100 million record raw file, or quickly pipe in a list of a pattern-matching set of files in the directory via the LS plus grep command?

 

If these actually are the results of removing the X command in studio 5, I for one consider it a notable step backward.   At least let access to the X command continued to be controlled by the system administrator.

 

 

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
AmyP_sas
SAS Employee

Thanks for the use case (now documented in our requirements system).  As for the ability to use X command, it's not a permanent removal from Studio.  Studio 5.1 (which runs on SAS Viya) is a subset of Studio 3.x (running on 9.4) and the plan is for 5.x to get to replacement value of 3.x before we can release it on 9.4 (kind of confusing, I know, to have a higher release number with fewer functions).  The goal is to have X command (and the rest) available and controllable by an administrator.  We just don't yet have the microservices support in the 5.x world to implement it.  

 

For being able to switch back and forth between languages, one option is to look at the interfaces like SAS Enterprise Miner in 9.4 or Model Studio in Viya.  I'm not an expert on either, but I think they both support models in several languages in the same flow.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 5 replies
  • 4659 views
  • 3 likes
  • 4 in conversation