Next: , Previous: , Up: System File Format   [Contents][Index]


B.8 Multiple Response Sets Records

The system file format has two different types of records that represent multiple response sets (see MRSETS in PSPP Users Guide). The first type of record describes multiple response sets that can be understood by SPSS before version 14. The second type of record, with a closely related format, is used for multiple dichotomy sets that use the CATEGORYLABELS=COUNTEDVALUES feature added in version 14.

/* Header. */
int32               rec_type;
int32               subtype;
int32               size;
int32               count;

/* Exactly count bytes of data. */
char                mrsets[];
int32 rec_type;

Record type. Always set to 7.

int32 subtype;

Record subtype. Set to 7 for records that describe multiple response sets understood by SPSS before version 14, or to 19 for records that describe dichotomy sets that use the CATEGORYLABELS=COUNTEDVALUES feature added in version 14.

int32 size;

The size of each element in the mrsets member. Always set to 1.

int32 count;

The total number of bytes in mrsets.

char mrsets[];

Zero or more line feeds (byte 0x0a), followed by a series of multiple response sets, each of which consists of the following:

  • The set’s name (an identifier that begins with ‘$’), in mixed upper and lower case.
  • An equals sign (‘=’).
  • C’ for a multiple category set, ‘D’ for a multiple dichotomy set with CATEGORYLABELS=VARLABELS, or ‘E’ for a multiple dichotomy set with CATEGORYLABELS=COUNTEDVALUES.
  • For a multiple dichotomy set with CATEGORYLABELS=COUNTEDVALUES, a space, followed by a number expressed as decimal digits, followed by a space. If LABELSOURCE=VARLABEL was specified on MRSETS, then the number is 11; otherwise it is 1.2
  • For either kind of multiple dichotomy set, the counted value, as a positive integer count specified as decimal digits, followed by a space, followed by as many string bytes as specified in the count. If the set contains numeric variables, the string consists of the counted integer value expressed as decimal digits. If the set contains string variables, the string contains the counted string value. Either way, the string may be padded on the right with spaces (older versions of SPSS seem to always pad to a width of 8 bytes; newer versions don’t).
  • A space.
  • The multiple response set’s label, using the same format as for the counted value for multiple dichotomy sets. A string of length 0 means that the set does not have a label. A string of length 0 is also written if LABELSOURCE=VARLABEL was specified.
  • A space.
  • The short names of the variables in the set, converted to lowercase, each separated from the previous by a single space.

    Even though a multiple response set must have at least two variables, some system files contain multiple response sets with no variables or one variable. The source and meaning of these multiple response sets is unknown. (Perhaps they arise from creating a multiple response set then deleting all the variables that it contains?)

  • One line feed (byte 0x0a). Sometimes multiple, even hundreds, of line feeds are present.

Example: Given appropriate variable definitions, consider the following MRSETS command:

MRSETS /MCGROUP NAME=$a LABEL='my mcgroup' VARIABLES=a b c
       /MDGROUP NAME=$b VARIABLES=g e f d VALUE=55
       /MDGROUP NAME=$c LABEL='mdgroup #2' VARIABLES=h i j VALUE='Yes'
       /MDGROUP NAME=$d LABEL='third mdgroup' CATEGORYLABELS=COUNTEDVALUES
        VARIABLES=k l m VALUE=34
       /MDGROUP NAME=$e CATEGORYLABELS=COUNTEDVALUES LABELSOURCE=VARLABEL
        VARIABLES=n o p VALUE='choice'.

The above would generate the following multiple response set record of subtype 7:

$a=C 10 my mcgroup a b c
$b=D2 55 0  g e f d
$c=D3 Yes 10 mdgroup #2 h i j

It would also generate the following multiple response set record with subtype 19:

$d=E 1 2 34 13 third mdgroup k l m
$e=E 11 6 choice 0  n o p

Footnotes

(2)

This part of the format may not be fully understood, because only a single example of each possibility has been examined.


Next: Extra Product Info Record, Previous: Machine Floating-Point Info Record, Up: System File Format   [Contents][Index]