More sas7bdat progress

September 13, 2011
By

(This article was first published on BioStatMatt » R, and kindly contributed to R-bloggers)

The development version of the read.sas7bdat function (in the sas7bdat package) now reads field labels and formats. In addition, errors of the type "found <x> <type> subheaders where 1 expected" are now a thing of the past. These improvements are largely due to work by Clint Cummins. The function also works on some files generated by 64 bit builds of SAS for Windows. Of 280 test files, the read.sas7bdat function works for all but 6, and these were generated on a Linux platform. Here is a preview of the sas7bdat package, version 0.2: sas7bdat_0.2.tar.gz

For those interested in C programming, it appears that the sas7bdat header corresponds to a C structure. There is evidence for this because the header fields are aligned at 4 byte boundaries when the file was written by SAS for 32 bit platforms, but 8 byte aligned for 64bit platforms. In addition, C structures are often padded with extra bytes by the compiler so that the entire structure is aligned to some multiple of the virtual memory page size. The overall length of the sas7bdat header differs from Windows to non-Windows platforms. This would make it difficult for the Windows version of SAS to read files written by the Linux version of SAS.

Does anyone know whether SAS can read sas7bdat datasets independent of the platform where the file was written? For example, is it possible using SAS for 32 bit Windows to read a file written by SAS for 64 bit Windows?

To leave a comment for the author, please follow the link and comment on his blog: BioStatMatt » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , , , ,

Comments are closed.