02-24-2017 03:13 AM
I would like to consult expertise of the community regarding my plan if it would be feasible.
(1) Load file to SAS
(2) Call python/R to do some treatments on the SAS dataset
(3) Load SAS dataset to RDBMS
If everything is on a sas script, will SAS be able to capture if there are any failures in the pyhton script called?
NOTE: Reason there's a python/R as there were previously built scripts to cleanse the data. While it can be done in SAS thru prxmatch,etc we don't want too waste much effort replacing a working one in python/R
Greatly appreciate your inputs and thoughts on this.
02-24-2017 03:15 AM - edited 02-24-2017 03:16 AM
not sure about python integration, but you can run R code in proc IML.
An introduction is given here:
02-24-2017 03:55 AM
Where does the data for step (1) come from? Do you read from the RDBMS, or from external data?
My preferred method to communicate with other applications is to use a common file format and store the data there.
So I'd try to
(after the data is in SAS)
- write data to a file format suitable for the external application
- run the external application from SAS (XCMD necessary), and catch the return code (suitable wrapper script for external app necessary)
- if RC = 0, read the output back into SAS and transform for loading into the RDBMS
You don't need additional SAS licensing, and the blueprint works for any application that can be run from the commandline.
02-28-2017 10:44 PM
Thanks I have the same thing in mind in case they push for this approach. But I'm planning to have all the processing done in python as I don't have to let SAS read back and forth data in the dbms
02-24-2017 03:59 AM
I am not seeing the value - load to SAS, run Python, upload to DBMS? Why not just use Python to load, check and upload to DBMS, or if you are moving to SAS, put the time in to do the migration. Surely any time you spend maintaining multiple applications will mitigate migration costs (just thinking about validation of installs, updates, etc.).
02-28-2017 10:41 PM
Agree with you on this one as I was also trying to point out to the team that it's either go for python doing the processing and loading of file to dbms. Because loading back and forth to dbms using SAS will be time consuming