[R] Read SAS .sd2 file into R?

Kevin Viel kviel at darwin.sfbr.org
Mon Feb 27 17:27:15 CET 2006



Peter Dalgaard wrote:
> "mtb954 mtb954" <mtb954 at gmail.com> 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.


Peter,

   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:

http://www.sas.com/apps/demosdownloads/sassysview_PROD_8.2_sysdep.jsp?packageID=000176


"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.

Regards,

Kevin

----------------------------------------------------------------------
Kevin Viel
Department of Genetics                  e-mail: kviel at darwin.sfbr.org
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




More information about the R-help mailing list