@table @asis
@item @code{ACCEPT}
-Accept user-missing values with no change. By default, system-missing
-values still yield an error. Use the @code{SYSMIS} subcommand to
-change this treatment:
+Accept user-missing values with no change.
+
+By default, system-missing values still yield an error. Use the
+@code{SYSMIS} subcommand to change this treatment:
@table @asis
@item @code{OMIT}
{
ss_ltrim (&line, ss_cstr (" ,"));
if (!ss_is_empty (line))
- msg (SW, _("Trailing garbage on line \"%.*s\""),
- (int) line.length, line.string);
+ {
+ /* XXX */
+ msg (SW, _("Trailing garbage on line \"%.*s\""),
+ (int) line.length, line.string);
+ }
}
}
}
{
lex_match (s->lexer, T_EQUALS);
if (lex_match_id (s->lexer, "OMIT"))
- get->user.treatment = MGET_OMIT;
+ get->system.treatment = MGET_OMIT;
else if (lex_is_number (s->lexer))
{
- get->user.treatment = MGET_RECODE;
- get->user.substitute = lex_number (s->lexer);
+ get->system.treatment = MGET_RECODE;
+ get->system.substitute = lex_number (s->lexer);
lex_get (s->lexer);
}
else
goto error;
}
}
+
+ if (get->user.treatment != MGET_ACCEPT)
+ get->system.treatment = MGET_ERROR;
+
return cmd;
error:
}
}
+ if (get->names)
+ {
+ gsl_matrix *names = gsl_matrix_alloc (n_vars, 1);
+ for (size_t i = 0; i < n_vars; i++)
+ {
+ char s[sizeof (double)];
+ double f;
+ buf_copy_str_rpad (s, sizeof s, var_get_name (vars[i]), ' ');
+ memcpy (&f, s, sizeof f);
+ gsl_matrix_set (names, i, 0, f);
+ }
+
+ gsl_matrix_free (get->names->value);
+ get->names->value = names;
+ }
+
size_t n_rows = 0;
gsl_matrix *m = gsl_matrix_alloc (4, n_vars);
long long int casenum = 1;
matrix.sps:21: error: MATRIX: WRITE with MODE=TRIANGULAR requires a square
matrix but the matrix to be written has dimensions 1×2.
])
+AT_CLEANUP
+
+AT_SETUP([MATRIX - GET])
+AT_DATA([matrix.sps], [dnl
+DATA LIST LIST NOTABLE /a b c.
+MISSING VALUES a(1) b(5).
+BEGIN DATA.
+0 0 0
+1 2 3
+4 5 6
+7 8 .
+END DATA.
+SAVE OUTFILE='matrix.sav'.
+
+MATRIX.
+GET x0 /FILE='matrix.sav' /NAMES=names0.
+PRINT x0.
+PRINT names0/FORMAT=A8.
+END MATRIX.
+
+MATRIX.
+GET x1 /FILE='matrix.sav' /VARIABLES=a b c /NAMES=names1 /MISSING=OMIT.
+PRINT x1.
+PRINT names1/FORMAT=A8.
+END MATRIX.
+
+MATRIX.
+GET x2 /FILE='matrix.sav' /VARIABLES=a b /NAMES=names2 /MISSING=OMIT.
+PRINT x2.
+PRINT names2/FORMAT=A8.
+END MATRIX.
+
+MATRIX.
+GET x3 /FILE='matrix.sav' /VARIABLES=a b c /NAMES=names3 /MISSING=5.
+PRINT x3.
+PRINT names3/FORMAT=A8.
+END MATRIX.
+
+MATRIX.
+GET x4 /FILE='matrix.sav' /VARIABLES=a b /NAMES=names4 /MISSING=5.
+PRINT x4.
+PRINT names4/FORMAT=A8.
+END MATRIX.
+
+MATRIX.
+GET x5 /FILE='matrix.sav' /VARIABLES=a b c /NAMES=names5 /MISSING=ACCEPT.
+PRINT x5.
+PRINT names5/FORMAT=A8.
+END MATRIX.
+
+MATRIX.
+GET x6 /FILE='matrix.sav' /VARIABLES=a b c /NAMES=names6 /MISSING=ACCEPT /SYSMIS=9.
+PRINT x6.
+PRINT names6/FORMAT=A8.
+END MATRIX.
+
+MATRIX.
+GET x7 /FILE='matrix.sav' /VARIABLES=a b c /NAMES=names7 /MISSING=ACCEPT /SYSMIS=OMIT.
+PRINT x7.
+PRINT names7/FORMAT=A8.
+END MATRIX.
+])
+AT_CHECK([pspp matrix.sps], [1], [dnl
+matrix.sps:12: error: MATRIX: GET: Variable a in case 2 has user-missing value
+1.
+
+matrix.sps:13: error: MATRIX: Uninitialized variable x0 used in expression.
+
+names0
+ a
+ b
+ c
+
+matrix.sps:18: error: MATRIX: GET: Variable c in case 4 is system-missing.
+
+matrix.sps:19: error: MATRIX: Uninitialized variable x1 used in expression.
+
+names1
+ a
+ b
+ c
+
+x2
+ 0 0
+ 7 8
+
+names2
+ a
+ b
+
+matrix.sps:30: error: MATRIX: GET: Variable c in case 4 is system-missing.
+
+matrix.sps:31: error: MATRIX: Uninitialized variable x3 used in expression.
+
+names3
+ a
+ b
+ c
+
+x4
+ 0 0
+ 5 2
+ 4 5
+ 7 8
+
+names4
+ a
+ b
+
+matrix.sps:42: error: MATRIX: GET: Variable c in case 4 is system-missing.
+
+matrix.sps:43: error: MATRIX: Uninitialized variable x5 used in expression.
+
+names5
+ a
+ b
+ c
+
+x6
+ 0 0 0
+ 1 2 3
+ 4 5 6
+ 7 8 9
+
+names6
+ a
+ b
+ c
+
+x7
+ 0 0 0
+ 1 2 3
+ 4 5 6
+
+names7
+ a
+ b
+ c
+])
AT_CLEANUP
\ No newline at end of file