- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
SAS Programming Professionals,
One of our projects makes SAS data sets available to users as SAS transport files created by CPORT. Most of our users have SAS (of course) and use PROC CIMPORT to un-transport the files into SAS data sets.
A few of our users only have R. They are having issues importing a CPORT-created SAS data set into R. So, my question is: Can anybody offer a solution for how an R user can import a CPORT-created SAS data set into R?
NOTE: We are aware that transport data sets created by the venerable, ancient PROC XCOPY can be imported to R. But, for data integrity issues, we do not use XCOPY.
Thank you, in advance, for your help!
--Michael
----MMMMIIIIKKKKEEEE
(aka Michael A. Raithel)
Amazon Author's Page: http://www.amazon.com/Michael-A.-Raithel/e/B001K8GG90/ref=ntt_dp_epwbk_0
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi MMMMIIIIKKKKEEEE,
Take a look at the HAVEN package in R: Import and Export 'SPSS', 'Stata' and 'SAS' Files, (see page 8).
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Leonid,
Thank you, this is indeed helpful!
That web page will help us in the future with deliveries of SAS data sets (.sas7bdat) files for R users. I bookmarked it for the proverbial rainy day.
Because we have already "published" CPORT transport files, we are still seeking a way to read them into R.
BTW, as you know, I am a big fan of your Blog posts (https://blogs.sas.com/content/author/leonidbatkhan/). They are always insightful reading!
--Michael
----MMMMIIIIKKKKEEEE
(aka Michael A. Raithel)
Amazon Author's Page: http://www.amazon.com/Michael-A.-Raithel/e/B001K8GG90/ref=ntt_dp_epwbk_0
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you MMMMIIIIKKKKEEEE,
You say "Most of our users have SAS (of course) and use PROC CIMPORT to un-transport the files into SAS data sets."
I think that is the way to do it: un-transport your CPORT files into SAS data sets, then read them in R using the haven package.
Unless anything changed since then, "R can read SAS Transport files created with the EXPORT engine (.xpt extensions), but not Transport files created with the CPORT procedure" - see SAS® and R Working Together.