BookmarkSubscribeRSS Feed
milts
Pyrite | Level 9

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.

 

Thank you!

5 REPLIES 5
PeterClemmensen
Tourmaline | Level 20

not sure about python integration, but you can run R code in proc IML. 

 

An introduction is given here:

 

https://www.youtube.com/watch?v=rUaTTre24kI

 

Kurt_Bremser
Super User

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.

milts
Pyrite | Level 9

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

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.).

milts
Pyrite | Level 9

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 2660 views
  • 1 like
  • 4 in conversation