Repository navigation
Conversation
Add a read_csv module for sas7bdat output, alongside the DTA and SAV ones. Numeric columns are written as doubles: DATE as days since 1960-01-01 (DATE9.), DATE_TIME as seconds since 1960 without leap seconds (DATETIME19.), TIME as seconds since midnight (TIME8.), and other numbers unscaled with Fw.d or BEST12. Values listed under "missing" become SAS special missing values .A, .B, ... Value labels are not written, since a sas7bdat file keeps them in a separate SAS catalog; the CLI warns instead. For SAS output, read_csv passes each variable's format as its value-label name, as the SAS readers do, rather than the column name, which the writer would otherwise take as the column's format. readstat_parse_csv no longer crashes when the output format is not supported: it called csv_free() on a parser csv_init() had not set up. Document the SAS metadata in variablemetadata_schema.json and the README, and add a round-trip test that runs when the CSV reader is built.
FlipperPA
marked this pull request as draft
November 2, 2026 21:35
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.
Add a read_csv module for sas7bdat output, alongside the DTA and SAV ones. Numeric columns are written as doubles: DATE as days since 1960-01-01 (DATE9.), DATE_TIME as seconds since 1960 without leap seconds (DATETIME19.), TIME as seconds since midnight (TIME8.), and other numbers unscaled with Fw.d or BEST12. Values listed under "missing" become SAS special missing values .A, .B, ... Value labels are not written, since a sas7bdat file keeps them in a separate SAS catalog; the CLI warns instead.
For SAS output, read_csv passes each variable's format as its value-label name, as the SAS readers do, rather than the column name, which the writer would otherwise take as the column's format.
readstat_parse_csv no longer crashes when the output format is not supported: it called csv_free() on a parser csv_init() had not set up.
Document the SAS metadata in variablemetadata_schema.json and the README, and add a round-trip test that runs when the CSV reader is built.