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

HI.

What is the popular way to convert SAS code into R.

We are thinking to use PMML.Is it a good idea or what other ways we have?

 

Thank You in advance

1 ACCEPTED SOLUTION

Accepted Solutions
DougWielenga
SAS Employee

As @RW9 said, 

There is no change my code from one language to another button. 

As @Reeza shared,

Code conversion is not a 1:1 process and requires a programmer who knows both systems. Don't underestimate the amount of work required. 

 

The short answer is, "No, there is no simple way to convert SAS processes to R processes even when they are similar in nature".

 

Having said that, are you trying to translate training code for building models or are you trying to translate data step code for scoring/manipulating data?  Presumably you are looking to R for analytics rather than data preparation.  It is very unlikely that you would be able to generate identical results in any modeling situation involving optimization since the optimization algorithms in R and SAS would almost certainly generate slightly different solutions in most cases.  

 

SAS Enterprise Miner can facilitate using R code through the Open Source Integration node, but there is no reason for SAS to export R code.  SAS Enterprise Miner generates score code in SAS and it can also generate score code in Java, C, and PMML for certain processes.  This code is generated by the modeling nodes rather than being converted.  

 

Hope this helps!

Doug

 

View solution in original post

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You analyze the code from one programming language, and then implement the logic in the new language?  There is no change my code from one language to another button.  As you will have been programming to SDLC the process should be quite simple as the Functional Design Specs, Test Cases, etc. will all be transferable, only the actual syntax coding will be different.  Of course if you haven't done that then your back to stage 1.

Reeza
Super User

PMML only works if you have SAS EM and models. No reports built in sas?

 

Code conversion is not a 1:1 process and requires a programmer who knows both systems. Don't underestimate the amount of work required. 

MelodieRush
SAS Employee

You may want to check out this free class that SAS offers "SAS Programming for R Users".

 

I found it very useful to see how R programming translate into SAS code.

Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF



DougWielenga
SAS Employee

As @RW9 said, 

There is no change my code from one language to another button. 

As @Reeza shared,

Code conversion is not a 1:1 process and requires a programmer who knows both systems. Don't underestimate the amount of work required. 

 

The short answer is, "No, there is no simple way to convert SAS processes to R processes even when they are similar in nature".

 

Having said that, are you trying to translate training code for building models or are you trying to translate data step code for scoring/manipulating data?  Presumably you are looking to R for analytics rather than data preparation.  It is very unlikely that you would be able to generate identical results in any modeling situation involving optimization since the optimization algorithms in R and SAS would almost certainly generate slightly different solutions in most cases.  

 

SAS Enterprise Miner can facilitate using R code through the Open Source Integration node, but there is no reason for SAS to export R code.  SAS Enterprise Miner generates score code in SAS and it can also generate score code in Java, C, and PMML for certain processes.  This code is generated by the modeling nodes rather than being converted.  

 

Hope this helps!

Doug

 

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 choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 7193 views
  • 3 likes
  • 5 in conversation