DATA Step, Macro, Functions and more

call python script in SAS EG

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

call python script in SAS EG

we have a python script that should request a data from API call . my question can SAS EG trigger the paython script ? 

or can sas connect to API call and pull a data from it ?

 

Thanks

 


Accepted Solutions
Solution
‎10-07-2015 01:08 PM
SAS Employee
Posts: 24

Re: call python script in SAS EG

You can use the X command to start a program outside of SAS. 

http://support.sas.com/documentation/cdl/en/lestmtsref/68024/HTML/default/viewer.htm#p11ba12uypvfazn...

 

 

If your EG is using an object spawner then you will need to enable all SAS processes started with the object spawner the ability to use X commands by adding the option -ALLOWXCMD to the object spawner command. THIS CAN BE DANGEROUS. There are security risks associated with allowing system commands to be executed from a client application. Clients can use host commands to perform potentially harmful operations such as file deletion.

 

Alternatively, you could create .sas files with the SAS code from the EG project and use them in a batch or cron job. Something like

sas -sysin sasJobsBeforePython.sas

run python

sas -sysin sasJobsAfterPython.sas 

View solution in original post


All Replies
Solution
‎10-07-2015 01:08 PM
SAS Employee
Posts: 24

Re: call python script in SAS EG

You can use the X command to start a program outside of SAS. 

http://support.sas.com/documentation/cdl/en/lestmtsref/68024/HTML/default/viewer.htm#p11ba12uypvfazn...

 

 

If your EG is using an object spawner then you will need to enable all SAS processes started with the object spawner the ability to use X commands by adding the option -ALLOWXCMD to the object spawner command. THIS CAN BE DANGEROUS. There are security risks associated with allowing system commands to be executed from a client application. Clients can use host commands to perform potentially harmful operations such as file deletion.

 

Alternatively, you could create .sas files with the SAS code from the EG project and use them in a batch or cron job. Something like

sas -sysin sasJobsBeforePython.sas

run python

sas -sysin sasJobsAfterPython.sas 

Trusted Advisor
Posts: 1,300

Re: call python script in SAS EG

Check out this open source offering from SAS.

https://github.com/sassoftware/enlighten-integration
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 1853 views
  • 2 likes
  • 3 in conversation