Skip to content

suggestions about import SAS Transport files to R.

6 messages · Santosh, Ista Zahn, Duncan Murdoch +3 more

#
Hi Santosh,
On Tue, Mar 26, 2013 at 1:57 PM, Santosh <santosh2005 at gmail.com> wrote:
Show us what you did and what errors R gave you. As of now we have no
idea what your actual problem is.

Best,
Ista
#
On 26/03/2013 1:57 PM, Santosh wrote:
I thought I had heard that SAS was now distributing some way to connect 
to R.  So shouldn't you be asking them this question?

Duncan Murdoch
#
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
#
On Mar 26, 2013, at 12:38 PM, netra timalsina wrote:

            
Why are you writing an object that you have not yet created?
And why are you mixing "write"-objects with "load"-operations"?

"write" <--> "read"  :::  "save" <--> "load"

Furthermore if you "load" an image file, the object names that existed at the time of the 'save' are included in the file and get assigned at the time of the 'load'. 'save' and 'load' operate via side-effects, as do the base plot commands.
David Winsemius
Alameda, CA, USA