[R] Reading SAS SD2 Data file

Marc Schwartz marc_schwartz at comcast.net
Thu Sep 27 20:26:42 CEST 2007


On Thu, 2007-09-27 at 19:56 +0200, Peter Dalgaard wrote:
> Corey Sparks wrote:
> > I am trying to read a SAS dataset into R that is in a .SD2 format, which
> > is the Version 6 standard format from SAS.
> >   
> (for DOS/Windows, that is. The format was machine/OS dependent.)

That is still the case with the proprietary SAS formats. You can't read
a SAS V9 file from Windows with SAS V9 on Linux, etc.

> > I see the routines that read the SAS XPORT format (foreign, Hmisc), but
> > is there any way to read this one?
> >   
> Only commercial solutions. (SAS itself, DBMS/COPY, StatTransfer, ...) 
> The actual format is a company secret, and noone has bothered to try and 
> decipher it.

The XPORT (Transport) format is openly documented and is cross-platform
compatible, which is why the FDA had standardized on it, for example.

There is the SAS System Viewer, which will open Windows based
proprietary SAS files and enable you to save them to CSV files. It is
_free_ and is available from here:

http://www.sas.com/apps/demosdownloads/sassystemviewer_PROD_9.1.3_sysdep.jsp?packageID=000313&jmpflag=N

It also runs under WINE on Linux, BTW.  :-)

HTH,

Marc Schwartz



More information about the R-help mailing list