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 at
+all. 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?)
+
@item
One line feed (byte 0x0a). Sometimes multiple, even hundreds, of line
feeds are present.
raw_var_name = text_get_token (text, ss_cstr (" \n"), &delimiter);
if (raw_var_name == NULL)
{
- sys_warn (r, record->pos,
- _("Missing new-line parsing variable names "
- "at offset %zu in MRSETS record."),
- text_pos (text));
+ if (delimiter != '\n')
+ sys_warn (r, record->pos,
+ _("Missing new-line parsing variable names "
+ "at offset %zu in MRSETS record."),
+ text_pos (text));
break;
}
var_name = recode_string ("UTF-8", r->encoding, raw_var_name, -1);
done
AT_CLEANUP
-AT_SETUP([only one variable in mrset])
+AT_SETUP([zero or one variable in mrset])
AT_KEYWORDS([sack synthetic system file negative multiple response])
AT_DATA([sys-file.sack], [dnl
dnl File header.
2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
dnl Multiple response sets.
-7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10);
+7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10; "$b=C 0 "; i8 10);
999; 0;
])
for variant in \
- "be 3a891e0a467afb3d622629c70f329ada" \
- "le 432998ec08370510411af4f5207c015e"
+ "be d94549fece75560fe5b47f32713b63a1" \
+ "le 63028521d460df9e998b40a75a93c330"
do
set $variant
AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
])
AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
warning: `sys-file.sav' near offset 0xd8: MRSET $a has only 1 variables.
+
+warning: `sys-file.sav' near offset 0xd8: MRSET $b has only 0 variables.
])
done
AT_CLEANUP
break;
variables = text_tokenize (text, '\n');
- if (variables == NULL)
- {
- sys_warn (r, "missing variable names following label "
- "at offset %zu in mrsets record", text_pos (text));
- break;
- }
printf ("\t\"%s\": multiple %s set",
name, type == MRSET_MC ? "category" : "dichotomy");
printf (", label \"%s\"", label);
if (label_from_var_label)
printf (", label from variable label");
- printf(", variables \"%s\"\n", variables);
+ if (variables != NULL)
+ printf(", variables \"%s\"\n", variables);
+ else
+ printf(", no variables\n");
}
close_text_record (text);
}