Skip to content
Prev 320343 / 398506 Next

suggestions about import SAS Transport files to R.

I may end up saying more than I know, and one of these days I may have the time to dig into the SAS to R pathway using SAS (but not yet).  And as of now, SAS still does not make it easy to transfer data to R for use outside of the SAS environment.  That said, SAS Proc Copy and Proc Cport create different portable file structures.  I don't think the functions in the foreign package read Proc Copy transport files.  

My preferred way of transferring SAS data sets to R is to use Proc Export to convert the files to Stata format.  The foreign package reads these just fine, and you don't have to worry about truncating variable names as can happen with Proc Cport.  The drawback is that "SAS Access for PC Files Formats" needs to be licensed on the SAS side.  

Your colleagues can always use Proc Cport or use Proc Export and convert the files to CSV.  Anyway you look at it, they need to recreate the files in a format that you can read.


Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204