tidyverse / haven

Read SPSS, Stata and SAS files from R
https://haven.tidyverse.org
Other
423 stars 115 forks source link

include metadata from SAS files in read_sas #710

Open rkb965 opened 1 year ago

rkb965 commented 1 year ago

Hello! Would it be possible to include the metadata from SAS files in read_sas?

proc contents in SAS returns information about the given dataset and its variables. AFAIK, this dataset metadata is dropped when reading into R. I would personally appreciate retaining the Created and Last Modified information, if possible.

From the proc contents documentation:

image

Thank you for considering this!

jthomasmock commented 1 year ago

Just wanted to add on a vote to this feature! The underlying C code has a header/metadata only option which has been enabled in pyreadstat already and is mentioned as an enhancement over haven: https://github.com/Roche/pyreadstat#reading-only-the-headers

I'm interested in this feature as metadata contains row/column dimensions and for very large datasets can help with say, determining how many rows to iterate across for batch processing of a larger than memory SAS file into a more open format chunk by chunk.