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
You can use the X command to start a program outside of SAS.
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
You can use the X command to start a program outside of SAS.
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
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.