Skip to content

Support for type 'E' multiple response sets in SPSS SAV files #346

@slobodan-ilic

Description

@slobodan-ilic

Issue

ReadStat currently doesn't properly handle type 'E' multiple response sets in SPSS SAV files. These are dichotomies with CATEGORYLABELS=COUNTEDVALUES and appear in subtype 19 records in addition to the already supported subtype 7.

Reproduction

When trying to parse an SPSS SAV file containing type 'E' multiple response sets, ReadStat fails to properly process them.

Solution

I've implemented a fix that:

  1. Adds support for subtype 19 (SAV_RECORD_SUBTYPE_MULTIPLE_RESPONSE_SETS_V14)
  2. Modifies the Ragel grammar to handle type 'E' format with its additional parameters
  3. Updates the code to set is_dichotomy flag for both types 'D' and 'E'

The changes are minimal and focused on the specific issue:

  • Added a constant in
  • Modified the Ragel grammar in
  • Updated the condition in to handle both subtypes

Testing

I've tested the changes with files containing type 'E' multiple response sets, and they are now correctly parsed.

I can submit a pull request with these changes if desired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions