Re: [R] Concerning reading of SAS-files

From: Frank E Harrell Jr <f.harrell_at_vanderbilt.edu>
Date: Sat 13 Aug 2005 - 01:26:39 EST

bogdan romocea wrote:

> The first one is an index, not a data set. Anyway, just use SAS to
> export the data sets in text format (CSV, tab-delimited etc). You can
> then easily read those in R. (By the way, the help for read.xport says
> that 'The file must be in SAS XPORT format.' Is .sas7bdat an XPORT
> file? Hint: no.)
> 
> 
> 

>>-----Original Message-----
>>From: Fredrik Thuring [mailto:frt@Codan.dk]
>>Sent: Friday, August 12, 2005 4:52 AM
>>To: r-help@stat.math.ethz.ch
>>Subject: [R] Concerning reading of SAS-files
>>
>>
>>
>>Hi!
>>
>>I'm trying to start a credibility estimation study with a
>>coule of data
>>sets that are created for SAS. The data sets are saved as
>>".sas7bndx" and
>>".sas7bdat".
>>I've tried reading them to R with the function 'read.xport' but this
>>returns the error message 'Error in lookup.xport(file) :
>>unable to open
>>file'.
>>Are there any other functions that one could use instead?
>>
>>Thanks a lot to who ever can solve my problem!
>>
>>Fredrik Thuring
>>Codan Insurance, Copenhagen

If you want to go the CSV route, the sasxport.get function in Hmisc can help. Its help function references a Howto on our web site. Beware that SAS PROC EXPORT which it uses is not really a PROC but a stored macro (where do all the billions of $ SAS earns go?) that has a bug if you have an unmatched quote in a field. sasxport.get will detect the problem because it compares the number of observations to that reported by PROC CONTENTS.

Frank Harrell



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Aug 13 01:30:20 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:17:02 EST