Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

There are gov't data files: http://www.cdc.gov/EpiInfo/

Available in this weird SAS format. How can I convert them into XML/CSV, something much simpler that can be read by scripts/etc.???

share|improve this question
    
Is ftp.cdc.gov/pub/health_statistics/NCHS/Datasets/NSFG/sas/… an example of the SAS files you're looking at? CDC seems to use this extension for code as well as data. –  ayrnieu Oct 12 '09 at 18:49
1  
search.cpan.org/~mlf/SAS-Parser-0.93/lib/SAS/Parser.pm deals with them –  ayrnieu Oct 12 '09 at 18:54
1  
SAS is an integrated programming/data management tool. Unless specifically done otherwise, the code & data are stored in the same file/type. –  DaveE Oct 12 '09 at 20:19

4 Answers 4

up vote 2 down vote accepted

StatTransfer will convert SAS files to a variety of formats and it includes options to filter variables or observations, customize the delimiter, and change variable storage formats during the transfer.

AM will also covert data, but it's less powerful/flexible. AM is freeware and written for Windows.

share|improve this answer

SAS Institute (the company that makes SAS) produces a viewer for SAS data sets.

Note that SAS program files usually have the extension .sas, whereas the data files themselves usually have the extension .sas7bdat.

share|improve this answer
    
Does this program perform a conversion? How does this answer the question? –  ftrotter Jun 22 '13 at 6:29
    
It seems it can export to csv scriptogr.am/richie/post/convert-sas7bdat-to-csv –  radek Jun 5 at 15:06

You can do this with R-cran, if you have SAS xpt files. Use the foreign and hmisc packages.

xpt = sasxport.get("xpt/DEMO.xpt")
write.csv(xpt, file="demo.csv")
share|improve this answer
1  
What's R-cran? Maybe you could add a link to this? –  Journeyman Geek Jun 24 '12 at 6:23
    
the R-project open source statistical software. Added a link. –  Skylar Saveland Jun 24 '12 at 22:24

You can extract data from .SAS7BDAT files using dsread from Oceanview Consultancy, see

http://www.oview.co.uk/dsread

It handles files from most platforms though may require registration for some platforms. It's a fast and easy-to-use command-line Windows program that also runs under Wine on Linux. No installation required, just run the .exe.

I realise that this is an old question but it shows up in relevant web searches so including this answer will help anyone else looking to extract data from the proprietary SAS7BDAT format.

Disclaimer: I am the developer of dsread.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.