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

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

 

1 ACCEPTED SOLUTION

Accepted Solutions

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 

 

And per @FriedEgg, there are other ways to integrate Python and R into your SAS process:

Check out this open source offering from SAS.

https://github.com/sassoftware/enlighten-integration

View solution in original post

2 REPLIES 2

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 

 

And per @FriedEgg, there are other ways to integrate Python and R into your SAS process:

Check out this open source offering from SAS.

https://github.com/sassoftware/enlighten-integration

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 13315 views
  • 2 likes
  • 3 in conversation