haven icon indicating copy to clipboard operation
haven copied to clipboard

include metadata from SAS files in read_sas

Open rkb965 opened this issue 2 years ago • 2 comments

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!

rkb965 avatar Jan 26 '23 22:01 rkb965

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.

jthomasmock avatar Feb 25 '23 19:02 jthomasmock