Re: [R] Concerning reading of SAS-files

From: Frank E Harrell Jr <>
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 []
>>Sent: Friday, August 12, 2005 4:52 AM
>>Subject: [R] Concerning reading of SAS-files
>>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
>>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
>>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 mailing list PLEASE do read the posting guide! 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