haven
haven copied to clipboard
read_sas() fails to parse sas7bdat file since v2.2.0
We have a file (from a customer) that can be successfully parsed by haven up to version 2.2.0 (included), and fails starting from version 2.3.0:
> haven::read_sas('/tmp/toto')
Error in df_parse_sas_file(spec_data, spec_cat, encoding = encoding, catalog_encoding = catalog_encoding, :
Failed to parse /tmp/toto: Invalid file, or file has unsupported features.
Unfortunately we can not for now provide a reprex. But in the header there is this string 7.00.00BWIN_95
, probably the OS version.
We will try to provide a sample file, but in the meantime, is there any change between those 2 versions (I suppose in readstat) that could explain this error ?
Hi @kforner, thanks for the report. There were a few changes to the SAS reading code in readstat in that release so this is almost certainly related, but there's nothing that screams out on a first glance.
Unfortunately it's not really possible to investigate without a reprex (particularly with SAS files since there's no solid file format specification), so if there is a way you can provide a file to check it would be very much appreciated.
I've closed this issue due to lack of requested reprex. If you still care about this bug, please open a new issue with a reprex.