-/* PSPP - computes sample statistics.
+/* PSPP - a program for statistical analysis.
Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
if (dls->type == -1)
dls->type = DLS_FIXED;
+ if (dls->type != DLS_FIXED && dls->end != NULL)
+ {
+ msg (SE, _("The END keyword may be used only with DATA LIST FIXED."));
+ goto error;
+ }
+
if (table == -1)
table = dls->type != DLS_FREE;
line = dfm_get_record (dls->reader);
ll_for_each_continue (spec, struct dls_var_spec, ll, &dls->specs)
- data_in (ss_substr (line, spec->first_column - 1, spec->input.w),
- spec->input.type, spec->input.d, spec->first_column,
- case_data_rw_idx (c, spec->fv), fmt_var_width (&spec->input));
+ {
+ if (row < spec->record)
+ break;
+
+ data_in (ss_substr (line, spec->first_column - 1, spec->input.w),
+ spec->input.type, spec->input.d, spec->first_column,
+ case_data_rw_idx (c, spec->fv),
+ fmt_var_width (&spec->input));
+ }
dfm_forward_record (dls->reader);
}
if (dls->end != NULL)
{
double *end = &case_data_rw (c, dls->end)->f;
- if (retval == TRNS_DROP_CASE)
+ if (retval == TRNS_END_FILE)
{
*end = 1.0;
- retval = TRNS_END_FILE;
+ retval = TRNS_CONTINUE;
}
else
*end = 0.0;