Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading sas7bdat gets "A row in the file was not the expected length" #307

Open
jhen1115 opened this issue Dec 7, 2023 · 0 comments
Open

Comments

@jhen1115
Copy link

jhen1115 commented Dec 7, 2023

Hi,

When using R haven package version 2.5.4 (ReadStat version 1.1.9), getting the below errors:
ReadStat: Row #0 decompressed to -1 bytes (expected 8264 bytes)
ReadStat: Error parsing page 0, bytes 8192-73727
Error: Failed to parse dummy_data_set_8256.sas7bdat: A row in the file was not the expected length.

The SAS data set consists of two variables: TEST1 (a numeric variable with length 8, containing missing value) and TEST2 (a character variable with length 8256, containing 8256 characters which repeat the string 'test' 2064 times).
However, if any of following modifications are made to the data set, it can be read without errors:

  • Removal of TEST1
  • Removal of TEST2
  • Changing the string of TEST2 to remove the tailing 'est' (8253 characters)
  • Changing the string of TEST2 to 'a' (8256 characters) by repeating the character 'a' 8256 times

Could you please help to investigate the issue and provide a resolution?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant