Re: [R] Read SAS .sd2 file into R?

From: Kevin Viel <>
Date: Tue 28 Feb 2006 - 03:27:15 EST

Peter Dalgaard wrote:
> "mtb954 mtb954" <> writes:

>>Does anyone know how to import a SAS .sd2 file into R? I can't see
>>anything in library(foreign).

> The SAS dataset file formats are not publicly available. You need
> either SAS itself (on a Windows machine) or a specialized tool like
> DBMS/Copy to converti it.


   There may be another way, though I have yet to explore it.

The SAS System Viewer is free and you may distribute it royalty free:

"Files Supported by the SAS System Viewer The SAS System Viewer lets you view the following types of SAS files: Read Only
* 7.00 Data Sets created under the windows environment (sas7bdat, sd7, sd2, ssd,
ssd0x, saseb$data)
* 6.06 - 6.12 Catalogs - Directory Information Only (sc2, sct, sct0x, saseb$catalog)

* 3.2.2 JMP(r) Data Sets - Macintosh and Windows (jmp)
* 6.12 MDDB - Multi-dimensional Data Base Files (sm2)
* SAS Transport Files (stx, xpt)
* SAS Log Files (log)
* SAS List Files (lst)

Read and Write Enabled

* Comma Delimited Files (csv)
* Space Delimited Files (prn)
* Text Based Files (sas, dat, cfg, html)"

Whether you can copy and paste will be key.



Kevin Viel
Department of Genetics                  e-mail:
Southwest Foundation                    phone:  (210)258-9884
P.O. Box 760549                         fax:    (210)258-9444
San Antonio, TX 78245-0549

Kevin Viel
PhD Candidate
Department of Epidemiology
Rollins School of Public Health
Emory University
Atlanta, GA 30322 mailing list PLEASE do read the posting guide! Received on Tue Feb 28 03:37:46 2006

This archive was generated by hypermail 2.1.8 : Tue 28 Feb 2006 - 06:08:49 EST