Repository navigation
Stop reading XPORT rows at the next dataset - #447
Open
yucheng-du wants to merge 2 commits into
Open
yucheng-du wants to merge 2 commits into
yucheng-du wants to merge 2 commits into
Conversation
shun2wang
reviewed
Dec 2, 2026
| if (matches < 2) { | ||
| return READSTAT_ERROR_PARSE; | ||
| const char blank_obsv8[] = "HEADER RECORD*******OBSV8 HEADER RECORD!!!!!!!" | ||
| " "; |
Contributor
There was a problem hiding this comment.
maybe should add a comment for char length here.
Author
There was a problem hiding this comment.
Added a comment in ea60b93 explaining that the 15 spaces are the blank observation count.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A SAS V5 file in tidyverse/haven#795 contains 31 observations in its first dataset. ReadStat returned 239 because it read the next dataset's headers and values as more observations.
Stop after the first member when the row count is unknown. Check the aligned member and descriptor records and the SAS dataset marker so ordinary character values can still contain header text. This also handles V8 files with a blank observation count.
The 31 rows now match
foreign::read.xport()on the reported file.make checkpasses, including tests for padding, header text in data, row offsets, and limits.Addresses the first-member parsing part of #412. Selecting other members remains open.