Read SAS data
Question
I have a SAS data, can I load it into RapidMiner? I encountered an error when I tried to read in a SAS data set in rapidminer.
Answer
'Read SAS' operator is an advanced data connector in rapidminer. http://docs.rapidminer.com/studio/operators/data_access/files/read/read_sas.html
If your process failed for some known parsing issues with 'Read SAS' operator, you can try this workaround solutions uses R to read SAS files and RapidMiner's R connector to easily get a handy data set out of R.
In order to apply it you need to:
- download r scripting extension from our marketplace via RapidMiner Studio or directly via this site: https://marketplace.rapidminer.com/UpdateServer/faces/product_details.xhtml?productId=rmx_r_scripting
- install a local copy of R and open RapidMiner Studio preferences which will after a restart hold an additional "R scripting" tab – here enter the local path to RScript.exe of your local R installation
- open R command line and run install.packages("sas7bdat") and install.packages("data.table") to add these libraries to your setup
- now you can open the attached process (SAS Alternate Reader URL) and configure the operator "Generate Macro" to open any SAS file from a gvien URL
- for testing purposes, you can have access to a list of example sas7bdat files from here:
https://github.com/ppham27/sas_to_csv/tree/master/test_files
- to make the attached process work for your own LOCAL SAS data, simply modify the function expression of the macro 'source' to update the value of source, for instance, set macro 'source' as "C:/Users/HOMEFOLDER/Downloads/YOUROWNDATA.sas7bdat". Refer to the attached process (SAS Alternate Reader Local) to make some modifications accordingly.
Comments
The new SAS connector is avaiable from RM marketplace https://marketplace.rapidminer.com/UpdateServer/faces/product_details.xhtml?productId=rmx_sas_connector
@yyhuang is this the same update that was done Jan 2017? That is the last update shown on that page.
Hi @sgenzer, we can igonor the original KB since the new SAS connector can load sas7bdat data directly into RapidMiner. Before it came to marketplace around Jan 2017, the old version of SAS connector did not work well. I thought it would be a workaround to use R scripts so published it as a KB. Now the bug is fixed. We have not seen any complaint for the new SAS connector.