We can now read and write SPSS v12 system files.
* John Williams originally wrote the T-TEST procedure, which was
subsequently re-written by John Darrington
- * John Darrington wrote the T-TEST and ONEWAY procedures, and made
- numerous revisions to other modules.
+ * John Darrington wrote the T-TEST ONEWAY and EXAMINE procedures,
+ implemented support for long variable names and made numerous
+ revisions to other modules.
+ * AUTHORS: Added note about the long variable names extension.
+
+ * pref.h.orig: Added definitions for variable names lengths.
+
Thu Mar 3 22:06:19 WST 2005 John Darrington <john@darrington.wattle.id.au>
* configure.ac: Added AC_PROG_RANLIB --- needed by autoconf 1.9
Please send PSPP bug reports to bug-gnu-pspp@gnu.org.
\f
+Preliminary list of changes from 0.3.1 to 0.3.2:
+
+ PSPP now reads and writes system files compatible with spssV12.
+
+ New commands: VARIABLE WIDTH, VARIABLE ALIGNMENT, VARIABLE LEVEL.
+
+
Preliminary list of changes from 0.3.0 to 0.3.1:
New build dependencies:
* libplot from GNU plotutils is optional; without it, the new
graphing features will not work.
+
Newly implemented commands and statistical features:
* DATE (as a stub, to enhance compatibility).
* PERMISSIONS.
- * T-TEST.
+ * SHOW.
+
+ * T-TEST (re-written).
* USE (as a stub, to enhance compatibility).
Much of the code has been rewritten and refactored. It is now much
cleaner.
+ lib/julcal has been removed.
+
For developers, the build system now requires Autoconf 2.58 and
Automake 1.7. The included gettext has been updated to version
0.12.1.
currently limited, but growing.
Source code for the latest development release of PSPP is available at
-ftp://alpha.gnu.org/gnu/pspp and ftp://pspp.stat.wisc.edu/pub/PSPP.
+ftp://alpha.gnu.org/gnu/pspp
For information on differences from previous versions, please see file
NEWS. Full documentation on PSPP's language and information on known
dnl Initialize.
AX_PREREQ(2.57)
-AC_INIT(pspp, 0.3.1,bug-gnu-pspp@gnu.org)
+AC_INIT(pspp, 0.3.2,bug-gnu-pspp@gnu.org)
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE
+ * variables.texi: Corrected the entry for VARIABLE LABELS
+
+ * data-file-format.texi: Added documentation about the Long Variable
+ Names record.
+
Thu Mar 3 22:06:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
* expressions.texi: corrected some mismatched parentheses.
@item TMPDIR
-The @code{sort} procedure stores its temporary files in this directory.
+The directory in which PSPP stores its temporary files (used when sorting
+cases or concatenating large numbers of cases).
Default: (UNIX) @file{/tmp}, (MS-DOS) @file{\}, (other OSes) empty string.
@item TEMP
* Document Record::
* Machine int32 Info Record::
* Machine flt64 Info Record::
+* Auxilliary Variable Parameter Record::
+* Long Variable Names Record::
* Miscellaneous Informational Records::
* Dictionary Termination Record::
* Data Record::
indicates 8-bit ASCII, 4 indicates DEC Kanji.
@end table
-@node Machine flt64 Info Record, Miscellaneous Informational Records, Machine int32 Info Record, Data File Format
+@node Machine flt64 Info Record, Auxilliary Variable Parameter Record, Machine int32 Info Record, Data File Format
@section Machine @code{flt64} Info Record
There must be no more than one machine @code{flt64} info record per
The value used for LOWEST in missing values.
@end table
-@node Miscellaneous Informational Records, Dictionary Termination Record, Machine flt64 Info Record, Data File Format
+@node Auxilliary Variable Parameter Record, Long Variable Names Record, Machine flt64 Info Record, Data File Format
+@section Auxilliary Variable Parameter Record
+
+There must be no more than one auxilliary variable parameter record per
+system file. This record must follow the variable
+records and precede the dictionary termination record.
+
+@example
+struct sysfile_aux_var_parameter
+ @{
+ /* Header. */
+ int32 rec_type;
+ int32 subtype;
+ int32 size;
+ int32 count;
+
+ /* Data. */
+ struct aux_params aux_params[/* variable length */];
+ @};
+@end example
+
+@table @code
+@item int32 rec_type;
+Record type. Always set to 7.
+
+@item int32 subtype;
+Record subtype. Always set to 11.
+
+@item int32 size;
+The size @code{int32}. Always set to 4.
+
+@item int32 count;
+The total number of bytes in @code{aux_params} divided by 3.
+
+@item struct aux_params aux_params[];
+An array of @code{struct aux_params}. The order of the elements corresponds
+to the order of the variables in the Variable Records. The @code{struct aux_params} type is defined as follows:
+
+@example
+struct aux_params
+ @{
+ int32 measure;
+ int32 width;
+ int32 alignment;
+ @};
+@end example
+
+@table @code
+@item int32 measure
+The measurement type of the variable:
+@table @asis
+@item 0
+Nominal Scale
+@item 1
+Ordinal Scale
+@item 2
+Continuous Scale
+@end table
+
+@item int32 width
+The width of the display column for the variable in characters.
+
+@item int32 alignment
+The alignment of the variable for display purposes:
+
+@table @asis
+@item 0
+Left aligned
+@item 1
+Right aligned
+@item 2
+Centre aligned
+@end table
+
+@end table
+
+
+
+@end table
+
+
+
+@node Long Variable Names Record, Miscellaneous Informational Records, Auxilliary Variable Parameter Record, Data File Format
+@section Long Variable Names Record
+
+There must be no more than one long variable names record per
+system file. This record must follow the variable
+records and precede the dictionary termination record.
+
+@example
+struct sysfile_long_variable_names
+ @{
+ /* Header. */
+ int32 rec_type;
+ int32 subtype;
+ int32 size;
+ int32 count;
+
+ /* Data. */
+ char var_name_pairs[/* variable length */];
+ @};
+@end example
+
+@table @code
+@item int32 rec_type;
+Record type. Always set to 7.
+
+@item int32 subtype;
+Record subtype. Always set to 13.
+
+@item int32 size;
+The size of each element in the @code{var_name_pairs} member. Always set to 1.
+
+@item int32 count;
+The total number of bytes in @code{var_name_pairs}.
+
+@item char var_name_pairs[/* variable length];
+A list of @var{key}--@var{value} tuples, where @var{key} is the name
+of a variable, and @var{value} is its long variable name.
+The @var{key} field is at most 8 bytes long and must match the
+name of a variable which appears in the variable record @xref{Variable Record}.
+The @var{value} field is at most 64 bytes long.
+The @var{key} and @var{value} fields are separated by a @samp{=} byte.
+Each tuple is separated by a byte whose value is 09. There is no
+trailing separator following the last tuple.
+The total length is @code{count} bytes.
+@end table
+
+
+@node Miscellaneous Informational Records, Dictionary Termination Record, Long Variable Names Record, Data File Format
@section Miscellaneous Informational Records
Miscellaneous informational records must follow the variable records and
/@{COMPRESSED,UNCOMPRESSED@}
/DROP=var_list
/KEEP=var_list
+ /VERSION=version
/RENAME=(src_names=target_names)@dots{}
@end display
the active file. DROP, KEEP, and RENAME only affect the system file
written to disk.
+The VERSION subcommand specifies the version of the file format. Valid
+versions are '3' and '3x'. Version 3x system files are identical to
+version 3 files, except that variable names greater than 8 bytes will
+be truncated. The default version is 3. The VERSION subcommand is
+optional. There is no need ever to use it.
+
@cmd{SAVE} causes the data to be read. It is a procedure.
@node SYSFILE INFO, XSAVE, SAVE, System and Portable Files
@item
@cindex variable names
@cindex names, variable
-Variable names may be any length, but only the first 8 characters are
-significant.
+Variable names may be up any length up to 64 bytes long.
+
@item
@cindex case-sensitivity
@c %**start of header
@setfilename pspp.info
@settitle PSPP
-@set TIMESTAMP Time-stamp: Sat Oct 30 17:30:39 WST 2004
@c For double-sided printing, uncomment:
@c @setchapternewpage odd
@c %**end of header
This file documents the PSPP package for statistical analysis of sampled
data. This is edition @value{EDITION}, for PSPP version
-@value{VERSION}, last modified at @value{TIMESTAMP}.
+@value{VERSION}, last modified on @value{UPDATED}.
@end ifinfo
@node ONEWAY, , T-TEST, Statistics
@comment node-name, next, previous, up
-@section Oneway
+@section ONEWAY
@vindex ONEWAY
@cindex analysis of variance
* VALUE LABELS:: Set value labels for variables.
* STRING:: Create new string variables.
* VARIABLE LABELS:: Set variable labels for variables.
+* VARIABLE ALIGNMENT:: Set the alignment for display.
+* VARIABLE WIDTH:: Set the display width.
+* VARIABLE LEVEL:: Set the measurement level.
* VECTOR:: Declare an array of variables.
* WRITE FORMATS:: Set variable write formats.
@end menu
Created variables are initialized to spaces.
-@node VARIABLE LABELS, VECTOR, STRING, Variable Attributes
+
+@node VARIABLE LABELS, VARIABLE ALIGNMENT, STRING, Variable Attributes
@section VARIABLE LABELS
@vindex VARIABLE LABELS
@display
VARIABLE LABELS
- /var_list 'var_label'.
+ var_list 'var_label'
+ [ /var_list 'var_label']
+ .
+ .
+ .
+ [ /var_list 'var_label']
@end display
@cmd{VARIABLE LABELS} associates explanatory names
with variables. This name, called a @dfn{variable label}, is displayed by
statistical procedures.
-To assign a variable label to a group of variables, specify a slash
-(@samp{/}), followed by the list of variable names and the variable
-label as a string.
+To assign a variable label to a group of variables, specify a
+list of variable names and the variable label as a string.
+To assign different labels to different variables in the same command,
+preceed the subsequent variable list with a slash (@samp{/}).
+
+
+@node VARIABLE ALIGNMENT, VARIABLE WIDTH, VARIABLE LABELS, Variable Attributes
+@comment node-name, next, previous, u
+@section VARIABLE ALIGNMENT
+@vindex VARIABLE ALIGNMENT
+
+@display
+VARIABLE ALIGNMENT
+ var_list ( LEFT | RIGHT | CENTER )
+ [ /var_list ( LEFT | RIGHT | CENTER ) ]
+ .
+ .
+ .
+ [ /var_list ( LEFT | RIGHT | CENTER ) ]
+@end display
+
+@cmd{VARIABLE ALIGNMENT} sets the alignment of variables for display editing
+purposes. This only has effect for third party software. It does not affect
+the display of variables in the PSPP output.
+
+
-@node VECTOR, WRITE FORMATS, VARIABLE LABELS, Variable Attributes
+
+@node VARIABLE WIDTH, VARIABLE LEVEL, VARIABLE ALIGNMENT, Variable Attributes
+@comment node-name, next, previous, up
+@section VARIABLE WIDTH
+@vindex VARIABLE WIDTH
+@display
+VARIABLE WIDTH
+ var_list (width)
+ [ /var_list (width) ]
+ .
+ .
+ .
+ [ /var_list (width) ]
+@end display
+
+@cmd{VARIABLE WIDTH} sets the column width of variables for display editing
+purposes. This only affects third party software. It does not affect
+the display of variables in the PSPP output.
+
+
+@node VARIABLE LEVEL, VECTOR, VARIABLE WIDTH, Variable Attributes
+@comment node-name, next, previous, up
+@section VARIABLE LEVEL
+@vindex VARIABLE LEVEL
+@display
+VARIABLE LEVEL
+ var_list ( SCALE | NOMINAL | ORDINAL )
+ [ /var_list ( SCALE | NOMINAL | ORDINAL ) ]
+ .
+ .
+ .
+ [ /var_list ( SCALE | NOMINAL | ORDINAL ) ]
+@end display
+
+@cmd{VARIABLE LEVEL} sets the measurement level of variables.
+Currently, this has no effect except for certain third party software.
+
+
+@node VECTOR, WRITE FORMATS, VARIABLE LEVEL, Variable Attributes
@section VECTOR
@vindex VECTOR
more vector names followed by a count in parentheses. This will cause
variables named @code{@var{vec}1} through @code{@var{vec}@var{count}}
to be created as numeric variables with print and write format F8.2.
-Variable names including numeric suffixes may not exceed 8 characters
+Variable names including numeric suffixes may not exceed 64 characters
in length, and none of the variables may exist prior to @cmd{VECTOR}.
All the variables in a vector must be the same type.
Variables within a vector may be referenced in expressions using
@code{vector(index)} syntax.
+
+
+
@node WRITE FORMATS, , VECTOR, Variable Attributes
@section WRITE FORMATS
@vindex WRITE FORMATS
msgstr ""
"Project-Id-Version: PSPP 0.3.1\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2005-03-13 22:49-0800\n"
+"POT-Creation-Date: 2005-04-13 06:39+0800\n"
"PO-Revision-Date: 2004-01-23 13:04+0800\n"
"Last-Translator: John Darrington <john@darrington.wattle.id.au>\n"
"Language-Team: John Darrington <john@darrington.wattle.id.au>\n"
msgid "while expecting COLUMNWISE"
msgstr ""
-#: src/aggregate.c:225
+#: src/aggregate.c:227
msgid "expecting BREAK"
msgstr ""
-#: src/aggregate.c:230
+#: src/aggregate.c:232
msgid ""
"When PRESORTED is specified, specifying sorting directions with (A) or (D) "
"has no effect. Output data will be sorted the same way as the input data."
msgstr ""
-#: src/aggregate.c:387
+#: src/aggregate.c:389
msgid "expecting aggregation function"
msgstr ""
-#: src/aggregate.c:403
+#: src/aggregate.c:405
#, c-format
msgid "Unknown aggregation function %s."
msgstr ""
-#: src/aggregate.c:418
+#: src/aggregate.c:420
msgid "expecting `('"
msgstr ""
-#: src/aggregate.c:455
+#: src/aggregate.c:457
#, c-format
msgid "Missing argument %d to %s."
msgstr ""
-#: src/aggregate.c:463
+#: src/aggregate.c:465
#, c-format
msgid "Arguments to %s must be of same type as source variables."
msgstr ""
-#: src/aggregate.c:473
+#: src/aggregate.c:475
msgid "expecting `)'"
msgstr ""
-#: src/aggregate.c:485
+#: src/aggregate.c:487
#, c-format
msgid ""
"Number of source variables (%d) does not match number of target variables (%"
"d)."
msgstr ""
-#: src/aggregate.c:502
+#: src/aggregate.c:504
#, c-format
msgid ""
"The value arguments passed to the %s function are out-of-order. They will "
"be treated as if they had been specified in the correct order."
msgstr ""
-#: src/aggregate.c:570
+#: src/aggregate.c:571
#, c-format
msgid ""
"Variable name %s is not unique within the aggregate file dictionary, which "
msgid "Variable %s is %s in target file, but %s in source file."
msgstr ""
-#: src/apply-dict.c:71 src/apply-dict.c:72 src/format.c:224 src/sfm-read.c:882
-#: src/sfm-read.c:1011 src/sfm-read.c:1012
+#: src/apply-dict.c:71 src/apply-dict.c:72 src/format.c:224 src/sfm-read.c:946
+#: src/sfm-read.c:1075 src/sfm-read.c:1076
msgid "string"
msgstr ""
-#: src/apply-dict.c:71 src/apply-dict.c:72 src/format.c:224 src/sfm-read.c:882
-#: src/sfm-read.c:1011 src/sfm-read.c:1012
+#: src/apply-dict.c:71 src/apply-dict.c:72 src/format.c:224 src/sfm-read.c:946
+#: src/sfm-read.c:1075 src/sfm-read.c:1076
msgid "numeric"
msgstr ""
msgstr ""
#: src/autorecode.c:139 src/command.c:791 src/compute.c:277
-#: src/data-list.c:409 src/data-list.c:899 src/data-list.c:1750
-#: src/do-if.c:253 src/get.c:406 src/lexer.c:420 src/loop.c:241
+#: src/data-list.c:409 src/data-list.c:901 src/data-list.c:1752
+#: src/do-if.c:253 src/get.c:245 src/get.c:456 src/lexer.c:426 src/loop.c:241
#: src/matrix-data.c:527 src/print.c:335 src/print.c:1045 src/recode.c:405
#: src/sel-if.c:54 src/sel-if.c:131 src/vector.c:193 src/file-handle.q:140
msgid "expecting end of command"
msgid "%s: Temporary file ended unexpectedly."
msgstr ""
-#: src/cmdline.c:143 src/cmdline.c:162 src/cmdline.c:174 src/command.c:207
+#: src/cmdline.c:141 src/cmdline.c:160 src/cmdline.c:172 src/command.c:207
#: src/set.q:425 src/set.q:427 src/set.q:994
#, c-format
msgid "%s is not yet implemented."
msgstr ""
-#: src/cmdline.c:245
+#: src/cmdline.c:243
#, c-format
msgid ""
"PSPP, a program for statistical analysis of sample data.\n"
"\n"
msgstr ""
-#: src/cmdline.c:283
+#: src/cmdline.c:281
#, c-format
msgid ""
"\n"
"fields must be listed in order of increasing record number."
msgstr ""
-#: src/data-list.c:385 src/data-list.c:1739
+#: src/data-list.c:385 src/data-list.c:1741
msgid ""
"SPSS-like or FORTRAN-like format specification expected after variable names."
msgstr ""
msgid "Input format %s doesn't accept decimal places."
msgstr ""
-#: src/data-list.c:568 src/data-list.c:664 src/data-list.c:878
+#: src/data-list.c:568 src/data-list.c:664 src/data-list.c:880
#, c-format
msgid "%s is a duplicate variable name."
msgstr ""
"names given."
msgstr ""
-#: src/data-list.c:795 src/data-list.c:921 src/descript.c:880 src/print.c:796
+#: src/data-list.c:795 src/data-list.c:923 src/descript.c:880 src/print.c:796
#: src/sysfile-info.c:134 src/sysfile-info.c:367 src/vfm.c:830
msgid "Variable"
msgstr ""
msgid "Columns"
msgstr ""
-#: src/data-list.c:798 src/data-list.c:922 src/print.c:799
+#: src/data-list.c:798 src/data-list.c:924 src/print.c:799
msgid "Format"
msgstr ""
msgstr[0] ""
msgstr[1] ""
-#: src/data-list.c:938
+#: src/data-list.c:940
#, c-format
msgid "Reading free-form data from file %s."
msgstr ""
-#: src/data-list.c:941
+#: src/data-list.c:943
msgid "Reading free-form data from the command file."
msgstr ""
-#: src/data-list.c:992
+#: src/data-list.c:994
#, c-format
msgid "Quoted string missing terminating `%c'."
msgstr ""
-#: src/data-list.c:1101
+#: src/data-list.c:1103
#, c-format
msgid "Partial case of %d of %d records discarded."
msgstr ""
-#: src/data-list.c:1155
+#: src/data-list.c:1157
#, c-format
msgid "Partial case discarded. The first variable missing was %s."
msgstr ""
-#: src/data-list.c:1199
+#: src/data-list.c:1201
#, c-format
msgid ""
"Missing value(s) for all variables from %s onward. These will be filled "
"with the system-missing value or blanks, as appropriate."
msgstr ""
-#: src/data-list.c:1277
+#: src/data-list.c:1279
msgid "Attempt to read past end of file."
msgstr ""
-#: src/data-list.c:1413
+#: src/data-list.c:1415
msgid ""
"REPEATING DATA must use the same file as its corresponding DATA LIST or FILE "
"TYPE."
msgstr ""
-#: src/data-list.c:1423 src/data-list.c:1458 src/data-list.c:1471
-#: src/data-list.c:1484 src/data-list.c:1517
+#: src/data-list.c:1425 src/data-list.c:1460 src/data-list.c:1473
+#: src/data-list.c:1486 src/data-list.c:1519
#, c-format
msgid "%s subcommand given multiple times."
msgstr ""
-#: src/data-list.c:1447
+#: src/data-list.c:1449
#, c-format
msgid "STARTS beginning column (%d) exceeds STARTS ending column (%d)."
msgstr ""
-#: src/data-list.c:1503
+#: src/data-list.c:1505
#, c-format
msgid "CONTINUED beginning column (%d) exceeds CONTINUED ending column (%d)."
msgstr ""
-#: src/data-list.c:1526
+#: src/data-list.c:1528
#, c-format
msgid "ID beginning column (%ld) must be positive."
msgstr ""
-#: src/data-list.c:1541
+#: src/data-list.c:1543
#, c-format
msgid "ID ending column (%ld) must be positive."
msgstr ""
-#: src/data-list.c:1547
+#: src/data-list.c:1549
#, c-format
msgid "ID ending column (%ld) cannot be less than ID beginning column (%d)."
msgstr ""
-#: src/data-list.c:1587
+#: src/data-list.c:1589
msgid "Missing required specification STARTS."
msgstr ""
-#: src/data-list.c:1589
+#: src/data-list.c:1591
msgid "Missing required specification OCCURS."
msgstr ""
-#: src/data-list.c:1596
+#: src/data-list.c:1598
msgid "ID specified without CONTINUED."
msgstr ""
-#: src/data-list.c:1688
+#: src/data-list.c:1690
msgid "String variable not allowed here."
msgstr ""
-#: src/data-list.c:1698
+#: src/data-list.c:1700
#, c-format
msgid "%s (%d) must be at least 1."
msgstr ""
-#: src/data-list.c:1704
+#: src/data-list.c:1706
#, c-format
msgid "Variable or integer expected for %s."
msgstr ""
-#: src/data-list.c:1842
+#: src/data-list.c:1844
#, c-format
msgid "Encountered mismatched record ID \"%s\" expecting \"%s\"."
msgstr ""
-#: src/data-list.c:1874
+#: src/data-list.c:1876
#, c-format
msgid ""
"Variable %s starting in column %d extends beyond physical record length of %"
"d."
msgstr ""
-#: src/data-list.c:1942
+#: src/data-list.c:1944
#, c-format
msgid "Invalid value %d for OCCURS."
msgstr ""
-#: src/data-list.c:1948
+#: src/data-list.c:1950
#, c-format
msgid "Beginning column for STARTS (%d) must be at least 1."
msgstr ""
-#: src/data-list.c:1956
+#: src/data-list.c:1958
#, c-format
msgid "Ending column for STARTS (%d) is less than beginning column (%d)."
msgstr ""
-#: src/data-list.c:1964
+#: src/data-list.c:1966
#, c-format
msgid "Invalid value %d for LENGTH."
msgstr ""
-#: src/data-list.c:1971
+#: src/data-list.c:1973
#, c-format
msgid "Beginning column for CONTINUED (%d) must be at least 1."
msgstr ""
-#: src/data-list.c:1979
+#: src/data-list.c:1981
#, c-format
msgid "Ending column for CONTINUED (%d) is less than beginning column (%d)."
msgstr ""
-#: src/data-list.c:2011
+#: src/data-list.c:2013
#, c-format
msgid ""
"Number of repetitions specified on OCCURS (%d) exceed number of repetitions "
"available in space on STARTS (%d), and CONTINUED not specified."
msgstr ""
-#: src/data-list.c:2029
+#: src/data-list.c:2031
#, c-format
msgid "Unexpected end of file with %d repetitions remaining out of %d."
msgstr ""
-#: src/data-out.c:235 src/sfm-read.c:426 src/sysfile-info.c:115
+#: src/data-out.c:235 src/sfm-read.c:485 src/sysfile-info.c:115
msgid "Unknown"
msgstr ""
msgid "Error writing file %s: %s."
msgstr ""
-#: src/dictionary.c:597
+#: src/dictionary.c:256
+#, c-format
+msgid ""
+"The entry \"%s\" in the variable name map, has no corresponding variable"
+msgstr ""
+
+#: src/dictionary.c:836
msgid ""
"At least one case in the data file had a weight value that was user-missing, "
"system-missing, zero, or negative. These case(s) were ignored."
msgid "installation error"
msgstr ""
+#: src/filename.c:221
+#, c-format
+msgid "Searching for `%s'..."
+msgstr ""
+
+#: src/filename.c:229 src/filename.c:261
+msgid "Search unsuccessful!"
+msgstr ""
+
+#: src/filename.c:254
+#, c-format
+msgid "Found `%s'."
+msgstr ""
+
+#: src/filename.c:686
+#, c-format
+msgid "Not opening pipe file `%s' because SAFER option set."
+msgstr ""
+
#: src/file-type.c:129
msgid "MIXED, GROUPED, or NESTED expected."
msgstr ""
msgid "YES or NO expected after ORDERED."
msgstr ""
-#: src/file-type.c:248 src/file-type.c:543 src/get.c:390
+#: src/file-type.c:248 src/file-type.c:543 src/get.c:440
msgid "while expecting a valid subcommand"
msgstr ""
msgid "Unknown record type %g."
msgstr ""
-#: src/filename.c:221
-#, c-format
-msgid "Searching for `%s'..."
-msgstr ""
-
-#: src/filename.c:229 src/filename.c:261
-msgid "Search unsuccessful!"
-msgstr ""
-
-#: src/filename.c:254
-#, c-format
-msgid "Found `%s'."
-msgstr ""
-
-#: src/filename.c:686
-#, c-format
-msgid "Not opening pipe file `%s' because SAFER option set."
-msgstr ""
-
#: src/flip.c:82
msgid ""
"FLIP ignores TEMPORARY. Temporary transformations will be made permanent."
msgid "%s variables are not compatible with %s format %s."
msgstr ""
-#: src/format.c:223 src/pfm-read.c:473 src/sfm-read.c:880
+#: src/format.c:223 src/pfm-read.c:473 src/sfm-read.c:944
msgid "String"
msgstr ""
-#: src/format.c:223 src/pfm-read.c:473 src/sfm-read.c:880
+#: src/format.c:223 src/pfm-read.c:473 src/sfm-read.c:944
msgid "Numeric"
msgstr ""
msgid "`)' expected after output format."
msgstr ""
-#: src/get.c:396
-msgid "All variables deleted from system file dictionary."
+#: src/get.c:251
+#, c-format
+msgid "The required %s subcommand was not present"
+msgstr ""
+
+#: src/get.c:257
+#, c-format
+msgid "Unsupported sysfile version: %d. Using version %d instead."
msgstr ""
#: src/get.c:446
+msgid "All variables deleted from system file dictionary."
+msgstr ""
+
+#: src/get.c:496
#, c-format
msgid ""
"Cannot rename %s as %s because there already exists a variable named %s. To "
"as \"/RENAME (A=B)(B=C)(C=A)\", or equivalently, \"/RENAME (A B C=B C A)\"."
msgstr ""
-#: src/get.c:471
+#: src/get.c:521
msgid "`=' expected after variable list."
msgstr ""
-#: src/get.c:478
+#: src/get.c:528
#, c-format
msgid ""
"Number of variables on left side of `=' (%d) does not match number of "
"variables on right side (%d), in parenthesized group %d of RENAME subcommand."
msgstr ""
-#: src/get.c:491
+#: src/get.c:541
#, c-format
msgid "Requested renaming duplicates variable name %s."
msgstr ""
-#: src/get.c:677
+#: src/get.c:728
msgid "The BY subcommand may be given once at most."
msgstr ""
-#: src/get.c:749
+#: src/get.c:800
msgid "The active file may not be specified more than once."
msgstr ""
-#: src/get.c:758
+#: src/get.c:809
msgid "Cannot specify the active file since no active file has been defined."
msgstr ""
-#: src/get.c:766
+#: src/get.c:817
msgid ""
"MATCH FILES may not be used after TEMPORARY when the active file is an input "
"source. Temporary transformations will be made permanent."
msgstr ""
-#: src/get.c:796
+#: src/get.c:847
msgid ""
"IN, FIRST, and LAST subcommands may not occur before the first FILE or TABLE."
msgstr ""
-#: src/get.c:831
+#: src/get.c:882
#, c-format
msgid "Multiple %s subcommands for a single FILE or TABLE."
msgstr ""
-#: src/get.c:841
+#: src/get.c:892
#, c-format
msgid "Duplicate variable name %s while creating %s variable."
msgstr ""
-#: src/get.c:853
+#: src/get.c:904
msgid ""
"RENAME, KEEP, and DROP subcommands may not occur before the first FILE or "
"TABLE."
msgstr ""
-#: src/get.c:880
+#: src/get.c:931
msgid "The BY subcommand is required when a TABLE subcommand is given."
msgstr ""
-#: src/get.c:899
+#: src/get.c:950
#, c-format
msgid "File %s lacks BY variable %s."
msgstr ""
-#: src/get.c:1393
+#: src/get.c:1444
#, c-format
msgid ""
"Variable %s in file %s (%s) has different type or width from the same "
"variable in earlier file (%s)."
msgstr ""
-#: src/get.c:1471
+#: src/get.c:1522
msgid "expecting COMM or TAPE"
msgstr ""
"REREAD: Column numbers must be positive finite numbers. Column set to 1."
msgstr ""
-#: src/lexer.c:253
+#: src/lexer.c:255
#, c-format
msgid "%s does not form a valid number."
msgstr ""
-#: src/lexer.c:370
+#: src/lexer.c:376
#, c-format
msgid "Bad character in input: `%c'."
msgstr ""
-#: src/lexer.c:372
+#: src/lexer.c:378
#, c-format
msgid "Bad character in input: `\\%o'."
msgstr ""
-#: src/lexer.c:393
+#: src/lexer.c:399
msgid "Syntax error at end of file."
msgstr ""
-#: src/lexer.c:403
+#: src/lexer.c:409
#, c-format
msgid "Syntax error %s at `%s'."
msgstr ""
-#: src/lexer.c:406
+#: src/lexer.c:412
#, c-format
msgid "Syntax error at `%s'."
msgstr ""
-#: src/lexer.c:525
+#: src/lexer.c:531
#, c-format
msgid "expecting `%s'"
msgstr ""
-#: src/lexer.c:542
+#: src/lexer.c:548
#, c-format
msgid "expecting %s"
msgstr ""
-#: src/lexer.c:556 src/val-labs.c:154
+#: src/lexer.c:562 src/val-labs.c:154
msgid "expecting string"
msgstr ""
-#: src/lexer.c:570 src/val-labs.c:163
+#: src/lexer.c:576 src/val-labs.c:163
msgid "expecting integer"
msgstr ""
-#: src/lexer.c:584
+#: src/lexer.c:590
msgid "expecting number"
msgstr ""
-#: src/lexer.c:598
+#: src/lexer.c:604
msgid "expecting identifier"
msgstr ""
-#: src/lexer.c:884
+#: src/lexer.c:890
msgid "<ERROR>"
msgstr ""
-#: src/lexer.c:1018 src/repeat.c:214
+#: src/lexer.c:1024 src/repeat.c:214
msgid "Unexpected end of file."
msgstr ""
-#: src/lexer.c:1027
+#: src/lexer.c:1033
msgid "binary"
msgstr ""
-#: src/lexer.c:1027
+#: src/lexer.c:1033
msgid "octal"
msgstr ""
-#: src/lexer.c:1027
+#: src/lexer.c:1033
msgid "hex"
msgstr ""
-#: src/lexer.c:1041
+#: src/lexer.c:1047
#, c-format
msgid "String of %s digits has %d characters, which is not a multiple of %d."
msgstr ""
-#: src/lexer.c:1070
+#: src/lexer.c:1076
#, c-format
msgid "`%c' is not a valid %s digit."
msgstr ""
-#: src/lexer.c:1101
+#: src/lexer.c:1107
msgid "Unterminated string constant."
msgstr ""
-#: src/lexer.c:1173
+#: src/lexer.c:1179
#, c-format
msgid "String exceeds 255 characters in length (%d characters)."
msgstr ""
-#: src/lexer.c:1188
+#: src/lexer.c:1194
msgid ""
"Sorry, literal strings may not contain null characters. Replacing with "
"spaces."
msgid "Bad time string length %d."
msgstr ""
-#: src/pfm-read.c:465 src/sfm-read.c:867 src/sfm-read.c:875
+#: src/pfm-read.c:465 src/sfm-read.c:931 src/sfm-read.c:939
#, c-format
msgid "%s: Bad format specifier byte (%d)."
msgstr ""
msgid "Invalid variable width %d."
msgstr ""
-#: src/pfm-read.c:525
+#: src/pfm-read.c:527
+#, c-format
+msgid "position %d: Variable name has %u characters."
+msgstr ""
+
+#: src/pfm-read.c:531
+#, c-format
+msgid "position %d: Variable name begins with invalid character."
+msgstr ""
+
+#: src/pfm-read.c:535
+#, c-format
+msgid "position %d: Variable name begins with lowercase letter %c."
+msgstr ""
+
+#: src/pfm-read.c:547
#, c-format
msgid "position %d: Invalid variable name `%s'."
msgstr ""
-#: src/pfm-read.c:533
+#: src/pfm-read.c:555
#, c-format
msgid "Duplicate variable name %s."
msgstr ""
-#: src/pfm-read.c:573
+#: src/pfm-read.c:595
#, c-format
msgid "Bad missing values for %s."
msgstr ""
-#: src/pfm-read.c:591
+#: src/pfm-read.c:613
#, c-format
msgid "Weighting variable %s not present in dictionary."
msgstr ""
-#: src/pfm-read.c:638
+#: src/pfm-read.c:660
#, c-format
msgid "Unknown variable %s while parsing value labels."
msgstr ""
-#: src/pfm-read.c:641
+#: src/pfm-read.c:663
#, c-format
msgid ""
"Cannot assign value labels to %s and %s, which have different variable types "
"or widths."
msgstr ""
-#: src/pfm-read.c:665
+#: src/pfm-read.c:687
#, c-format
msgid "Duplicate label for value %g for variable %s."
msgstr ""
-#: src/pfm-read.c:668
+#: src/pfm-read.c:690
#, c-format
msgid "Duplicate label for value `%.*s' for variable %s."
msgstr ""
msgid "%s: Closing portable file: %s."
msgstr ""
-#: src/plot-hist.c:118
+#: src/plot-hist.c:123
msgid "HISTOGRAM"
msgstr ""
-#: src/plot-hist.c:120 src/frequencies.q:1139
+#: src/plot-hist.c:125 src/frequencies.q:1139
msgid "Frequency"
msgstr ""
msgid "corrupt system file: "
msgstr ""
-#: src/sfm-read.c:149 src/sfm-write.c:808
+#: src/sfm-read.c:149 src/sfm-write.c:918
#, c-format
msgid "%s: Closing system file: %s."
msgstr ""
"immediately follow type 3 records."
msgstr ""
-#: src/sfm-read.c:329
+#: src/sfm-read.c:333
+#, c-format
+msgid "%s: Invalid subrecord length. Record: 7; Subrecord: 11"
+msgstr ""
+
+#: src/sfm-read.c:388
#, c-format
msgid "%s: Unrecognized record type 7, subtype %d encountered in system file."
msgstr ""
-#: src/sfm-read.c:354
+#: src/sfm-read.c:413
#, c-format
msgid "%s: Unrecognized record type %d."
msgstr ""
-#: src/sfm-read.c:386
+#: src/sfm-read.c:445
#, c-format
msgid ""
"%s: Bad size (%d) or count (%d) field on record type 7, subtype 3.\tExpected "
"size %d, count 8."
msgstr ""
-#: src/sfm-read.c:397
+#: src/sfm-read.c:456
#, c-format
msgid ""
"%s: Floating-point representation in system file is not IEEE-754. PSPP "
"cannot convert between floating-point formats."
msgstr ""
-#: src/sfm-read.c:413
+#: src/sfm-read.c:472
#, c-format
msgid ""
"%s: File-indicated endianness (%s) does not match endianness intuited from "
"file header (%s)."
msgstr ""
-#: src/sfm-read.c:416 src/sfm-read.c:417
+#: src/sfm-read.c:475 src/sfm-read.c:476
msgid "big-endian"
msgstr ""
-#: src/sfm-read.c:416 src/sfm-read.c:417
+#: src/sfm-read.c:475 src/sfm-read.c:476
msgid "little-endian"
msgstr ""
-#: src/sfm-read.c:418
+#: src/sfm-read.c:477
msgid "unknown"
msgstr ""
-#: src/sfm-read.c:422
+#: src/sfm-read.c:481
#, c-format
msgid "%s: File-indicated character representation code (%s) is not ASCII."
msgstr ""
-#: src/sfm-read.c:426
+#: src/sfm-read.c:485
msgid "DEC Kanji"
msgstr ""
-#: src/sfm-read.c:442
+#: src/sfm-read.c:501
#, c-format
msgid ""
"%s: Bad size (%d) or count (%d) field on record type 7, subtype 4.\tExpected "
"size %d, count 8."
msgstr ""
-#: src/sfm-read.c:457
+#: src/sfm-read.c:516
#, c-format
msgid ""
"%s: File-indicated value is different from internal value for at least one "
"%g; LOWEST: %g, %g."
msgstr ""
-#: src/sfm-read.c:484
+#: src/sfm-read.c:543
#, c-format
msgid ""
"%s: Bad magic. Proper system files begin with the four characters `$FL2'. "
"This file will not be read."
msgstr ""
-#: src/sfm-read.c:526
+#: src/sfm-read.c:585
#, c-format
msgid ""
"%s: File layout code has unexpected value %d. Value should be 2, in big-"
"endian or little-endian format."
msgstr ""
-#: src/sfm-read.c:542
+#: src/sfm-read.c:601
#, c-format
msgid "%s: Number of elements per case (%d) is not between 1 and %d."
msgstr ""
-#: src/sfm-read.c:551
+#: src/sfm-read.c:610
#, c-format
msgid ""
"%s: Index of weighting variable (%d) is not between 0 and number of elements "
"per case (%d)."
msgstr ""
-#: src/sfm-read.c:558
+#: src/sfm-read.c:617
#, c-format
msgid "%s: Number of cases in file (%ld) is not between -1 and %d."
msgstr ""
-#: src/sfm-read.c:563
+#: src/sfm-read.c:622
#, c-format
msgid "%s: Compression bias (%g) is not the usual value of 100."
msgstr ""
-#: src/sfm-read.c:656
+#: src/sfm-read.c:717
#, c-format
msgid "%s: position %d: Bad record type (%d); the expected value was 2."
msgstr ""
-#: src/sfm-read.c:666
+#: src/sfm-read.c:727
#, c-format
msgid ""
"%s: position %d: String variable does not have proper number of continuation "
"records."
msgstr ""
-#: src/sfm-read.c:675
+#: src/sfm-read.c:736
#, c-format
msgid "%s: position %d: Superfluous long string continuation record."
msgstr ""
-#: src/sfm-read.c:681
+#: src/sfm-read.c:742
#, c-format
msgid "%s: position %d: Bad variable type code %d."
msgstr ""
-#: src/sfm-read.c:684
+#: src/sfm-read.c:745
#, c-format
msgid "%s: position %d: Variable label indicator field is not 0 or 1."
msgstr ""
-#: src/sfm-read.c:688
+#: src/sfm-read.c:749
#, c-format
msgid ""
"%s: position %d: Missing value indicator field is not -3, -2, 0, 1, 2, or 3."
msgstr ""
-#: src/sfm-read.c:694
+#: src/sfm-read.c:755
#, c-format
msgid "%s: position %d: Variable name begins with invalid character."
msgstr ""
-#: src/sfm-read.c:698
+#: src/sfm-read.c:759
#, c-format
msgid "%s: position %d: Variable name begins with lowercase letter %c."
msgstr ""
-#: src/sfm-read.c:702
+#: src/sfm-read.c:763
#, c-format
msgid ""
"%s: position %d: Variable name begins with octothorpe (`#'). Scratch "
"variables should not appear in system files."
msgstr ""
-#: src/sfm-read.c:717
+#: src/sfm-read.c:778
#, c-format
msgid "%s: position %d: Variable name character %d is lowercase letter %c."
msgstr ""
-#: src/sfm-read.c:726
+#: src/sfm-read.c:787
#, c-format
msgid ""
"%s: position %d: character `\\%03o' (%c) is not valid in a variable name."
msgstr ""
-#: src/sfm-read.c:735
+#: src/sfm-read.c:796
#, c-format
msgid "%s: Duplicate variable name `%s' within system file."
msgstr ""
-#: src/sfm-read.c:756
+#: src/sfm-read.c:817
#, c-format
msgid "%s: Variable %s indicates variable label of invalid length %d."
msgstr ""
-#: src/sfm-read.c:773
+#: src/sfm-read.c:837
#, c-format
msgid "%s: Long string variable %s may not have missing values."
msgstr ""
-#: src/sfm-read.c:798
+#: src/sfm-read.c:862
#, c-format
msgid ""
"%s: String variable %s may not have missing values specified as a range."
msgstr ""
-#: src/sfm-read.c:846
+#: src/sfm-read.c:910
#, c-format
msgid "%s: Long string continuation records omitted at end of dictionary."
msgstr ""
-#: src/sfm-read.c:850
+#: src/sfm-read.c:914
#, c-format
msgid ""
"%s: System file header indicates %d variable positions but %d were read from "
"file."
msgstr ""
-#: src/sfm-read.c:878
+#: src/sfm-read.c:942
#, c-format
msgid "%s: %s variable %s has %s format specifier %s."
msgstr ""
-#: src/sfm-read.c:957
+#: src/sfm-read.c:1021
#, c-format
msgid ""
"%s: Variable index record (type 4) does not immediately follow value label "
"record (type 3) as it should."
msgstr ""
-#: src/sfm-read.c:968
+#: src/sfm-read.c:1032
#, c-format
msgid ""
"%s: Number of variables associated with a value label (%d) is not between 1 "
"and the number of variables (%d)."
msgstr ""
-#: src/sfm-read.c:984
+#: src/sfm-read.c:1048
#, c-format
msgid ""
"%s: Variable index associated with value label (%d) is not between 1 and the "
"number of values (%d)."
msgstr ""
-#: src/sfm-read.c:991
+#: src/sfm-read.c:1055
#, c-format
msgid ""
"%s: Variable index associated with value label (%d) refers to a continuation "
"of a string variable, not to an actual variable."
msgstr ""
-#: src/sfm-read.c:996
+#: src/sfm-read.c:1060
#, c-format
msgid "%s: Value labels are not allowed on long string variables (%s)."
msgstr ""
-#: src/sfm-read.c:1007
+#: src/sfm-read.c:1071
#, c-format
msgid ""
"%s: Variables associated with value label are not all of identical type. "
"Variable %s has %s type, but variable %s has %s type."
msgstr ""
-#: src/sfm-read.c:1048
+#: src/sfm-read.c:1112
#, c-format
msgid "%s: File contains duplicate label for value %g for variable %s."
msgstr ""
-#: src/sfm-read.c:1052
+#: src/sfm-read.c:1116
#, c-format
msgid "%s: File contains duplicate label for value `%.*s' for variable %s."
msgstr ""
-#: src/sfm-read.c:1087 src/sfm-read.c:1351
+#: src/sfm-read.c:1158 src/sfm-read.c:1422
#, c-format
msgid "%s: Reading system file: %s."
msgstr ""
-#: src/sfm-read.c:1090 src/sfm-read.c:1192 src/sfm-read.c:1234
+#: src/sfm-read.c:1161 src/sfm-read.c:1263 src/sfm-read.c:1305
#, c-format
msgid "%s: Unexpected end of file."
msgstr ""
-#: src/sfm-read.c:1107
+#: src/sfm-read.c:1178
#, c-format
msgid "%s: System file contains multiple type 6 (document) records."
msgstr ""
-#: src/sfm-read.c:1113
+#: src/sfm-read.c:1184
#, c-format
msgid "%s: Number of document lines (%ld) must be greater than 0."
msgstr ""
-#: src/sfm-read.c:1145
+#: src/sfm-read.c:1216
#, c-format
msgid "%s: Error reading file: %s."
msgstr ""
-#: src/sfm-read.c:1182
+#: src/sfm-read.c:1253
#, c-format
msgid "%s: Compressed data is corrupted. Data ends in partial case."
msgstr ""
-#: src/sfm-read.c:1354
+#: src/sfm-read.c:1425
#, c-format
msgid "%s: Partial record at end of system file."
msgstr ""
-#: src/sfm-write.c:143
+#: src/sfm-write.c:153
#, c-format
msgid "Error opening \"%s\" for writing as a system file: %s."
msgstr ""
-#: src/sfm-write.c:628
+#: src/sfm-write.c:738
#, c-format
msgid "%s: Writing system file: %s."
msgstr ""
-#: src/sort.c:203
+#: src/sort.c:103
+msgid "Buffer limit must be at least 2."
+msgstr ""
+
+#: src/sort.c:221
msgid "`A' or `D' expected inside parentheses."
msgstr ""
-#: src/sort.c:208
+#: src/sort.c:226
msgid "`)' expected."
msgstr ""
-#: src/sort.c:572 src/sort.c:750
+#: src/sort.c:573
#, c-format
msgid ""
"Out of memory. Could not allocate room for minimum of %d cases of %d bytes "
msgid "Truncating variable label to 255 characters."
msgstr ""
-#: src/vars-atr.c:248
+#: src/vars-atr.c:249
msgid "Variable names must be at least 1 character long."
msgstr ""
-#: src/vars-atr.c:254
+#: src/vars-atr.c:255
#, c-format
msgid "Variable name %s exceeds %d-character limit."
msgstr ""
-#: src/vars-atr.c:263
+#: src/vars-atr.c:264
#, c-format
msgid "Character `%c' (in %s) may not appear in a variable name."
msgstr ""
-#: src/vars-atr.c:272
+#: src/vars-atr.c:273
#, c-format
msgid ""
"Character `%c' (in %s), may not appear as the first character in a variable "
"name."
msgstr ""
-#: src/vars-atr.c:280
+#: src/vars-atr.c:281
#, c-format
msgid "%s may not be used as a variable name because it is a reserved word."
msgstr ""
msgid "scratch"
msgstr ""
-#: src/vars-prs.c:174
+#: src/vars-prs.c:175
#, c-format
msgid ""
"%s is not a numeric variable. It will not be included in the variable list."
msgstr ""
-#: src/vars-prs.c:177
+#: src/vars-prs.c:178
#, c-format
msgid ""
"%s is not a string variable. It will not be included in the variable list."
msgstr ""
-#: src/vars-prs.c:181
+#: src/vars-prs.c:182
#, c-format
msgid "Scratch variables (such as %s) are not allowed here."
msgstr ""
-#: src/vars-prs.c:184
+#: src/vars-prs.c:185
#, c-format
msgid ""
"%s and %s are not the same type. All variables in this variable list must "
"be of the same type. %s will be omitted from list."
msgstr ""
-#: src/vars-prs.c:189
+#: src/vars-prs.c:190
#, c-format
msgid "Variable %s appears twice in variable list."
msgstr ""
-#: src/vars-prs.c:299
+#: src/vars-prs.c:300
#, c-format
msgid "%s TO %s is not valid syntax since %s precedes %s in the dictionary."
msgstr ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2005-03-13 22:49-0800\n"
+"POT-Creation-Date: 2005-04-13 06:39+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "while expecting COLUMNWISE"
msgstr ""
-#: src/aggregate.c:225
+#: src/aggregate.c:227
msgid "expecting BREAK"
msgstr ""
-#: src/aggregate.c:230
+#: src/aggregate.c:232
msgid ""
"When PRESORTED is specified, specifying sorting directions with (A) or (D) "
"has no effect. Output data will be sorted the same way as the input data."
msgstr ""
-#: src/aggregate.c:387
+#: src/aggregate.c:389
msgid "expecting aggregation function"
msgstr ""
-#: src/aggregate.c:403
+#: src/aggregate.c:405
#, c-format
msgid "Unknown aggregation function %s."
msgstr ""
-#: src/aggregate.c:418
+#: src/aggregate.c:420
msgid "expecting `('"
msgstr ""
-#: src/aggregate.c:455
+#: src/aggregate.c:457
#, c-format
msgid "Missing argument %d to %s."
msgstr ""
-#: src/aggregate.c:463
+#: src/aggregate.c:465
#, c-format
msgid "Arguments to %s must be of same type as source variables."
msgstr ""
-#: src/aggregate.c:473
+#: src/aggregate.c:475
msgid "expecting `)'"
msgstr ""
-#: src/aggregate.c:485
+#: src/aggregate.c:487
#, c-format
msgid ""
"Number of source variables (%d) does not match number of target variables (%"
"d)."
msgstr ""
-#: src/aggregate.c:502
+#: src/aggregate.c:504
#, c-format
msgid ""
"The value arguments passed to the %s function are out-of-order. They will "
"be treated as if they had been specified in the correct order."
msgstr ""
-#: src/aggregate.c:570
+#: src/aggregate.c:571
#, c-format
msgid ""
"Variable name %s is not unique within the aggregate file dictionary, which "
msgid "Variable %s is %s in target file, but %s in source file."
msgstr ""
-#: src/apply-dict.c:71 src/apply-dict.c:72 src/format.c:224 src/sfm-read.c:882
-#: src/sfm-read.c:1011 src/sfm-read.c:1012
+#: src/apply-dict.c:71 src/apply-dict.c:72 src/format.c:224 src/sfm-read.c:946
+#: src/sfm-read.c:1075 src/sfm-read.c:1076
msgid "string"
msgstr ""
-#: src/apply-dict.c:71 src/apply-dict.c:72 src/format.c:224 src/sfm-read.c:882
-#: src/sfm-read.c:1011 src/sfm-read.c:1012
+#: src/apply-dict.c:71 src/apply-dict.c:72 src/format.c:224 src/sfm-read.c:946
+#: src/sfm-read.c:1075 src/sfm-read.c:1076
msgid "numeric"
msgstr ""
msgstr ""
#: src/autorecode.c:139 src/command.c:791 src/compute.c:277
-#: src/data-list.c:409 src/data-list.c:899 src/data-list.c:1750
-#: src/do-if.c:253 src/get.c:406 src/lexer.c:420 src/loop.c:241
+#: src/data-list.c:409 src/data-list.c:901 src/data-list.c:1752
+#: src/do-if.c:253 src/get.c:245 src/get.c:456 src/lexer.c:426 src/loop.c:241
#: src/matrix-data.c:527 src/print.c:335 src/print.c:1045 src/recode.c:405
#: src/sel-if.c:54 src/sel-if.c:131 src/vector.c:193 src/file-handle.q:140
msgid "expecting end of command"
msgid "%s: Temporary file ended unexpectedly."
msgstr ""
-#: src/cmdline.c:143 src/cmdline.c:162 src/cmdline.c:174 src/command.c:207
+#: src/cmdline.c:141 src/cmdline.c:160 src/cmdline.c:172 src/command.c:207
#: src/set.q:425 src/set.q:427 src/set.q:994
#, c-format
msgid "%s is not yet implemented."
msgstr ""
-#: src/cmdline.c:245
+#: src/cmdline.c:243
#, c-format
msgid ""
"PSPP, a program for statistical analysis of sample data.\n"
"\n"
msgstr ""
-#: src/cmdline.c:283
+#: src/cmdline.c:281
#, c-format
msgid ""
"\n"
"fields must be listed in order of increasing record number."
msgstr ""
-#: src/data-list.c:385 src/data-list.c:1739
+#: src/data-list.c:385 src/data-list.c:1741
msgid ""
"SPSS-like or FORTRAN-like format specification expected after variable names."
msgstr ""
msgid "Input format %s doesn't accept decimal places."
msgstr ""
-#: src/data-list.c:568 src/data-list.c:664 src/data-list.c:878
+#: src/data-list.c:568 src/data-list.c:664 src/data-list.c:880
#, c-format
msgid "%s is a duplicate variable name."
msgstr ""
"names given."
msgstr ""
-#: src/data-list.c:795 src/data-list.c:921 src/descript.c:880 src/print.c:796
+#: src/data-list.c:795 src/data-list.c:923 src/descript.c:880 src/print.c:796
#: src/sysfile-info.c:134 src/sysfile-info.c:367 src/vfm.c:830
msgid "Variable"
msgstr ""
msgid "Columns"
msgstr ""
-#: src/data-list.c:798 src/data-list.c:922 src/print.c:799
+#: src/data-list.c:798 src/data-list.c:924 src/print.c:799
msgid "Format"
msgstr ""
msgstr[0] ""
msgstr[1] ""
-#: src/data-list.c:938
+#: src/data-list.c:940
#, c-format
msgid "Reading free-form data from file %s."
msgstr ""
-#: src/data-list.c:941
+#: src/data-list.c:943
msgid "Reading free-form data from the command file."
msgstr ""
-#: src/data-list.c:992
+#: src/data-list.c:994
#, c-format
msgid "Quoted string missing terminating `%c'."
msgstr ""
-#: src/data-list.c:1101
+#: src/data-list.c:1103
#, c-format
msgid "Partial case of %d of %d records discarded."
msgstr ""
-#: src/data-list.c:1155
+#: src/data-list.c:1157
#, c-format
msgid "Partial case discarded. The first variable missing was %s."
msgstr ""
-#: src/data-list.c:1199
+#: src/data-list.c:1201
#, c-format
msgid ""
"Missing value(s) for all variables from %s onward. These will be filled "
"with the system-missing value or blanks, as appropriate."
msgstr ""
-#: src/data-list.c:1277
+#: src/data-list.c:1279
msgid "Attempt to read past end of file."
msgstr ""
-#: src/data-list.c:1413
+#: src/data-list.c:1415
msgid ""
"REPEATING DATA must use the same file as its corresponding DATA LIST or FILE "
"TYPE."
msgstr ""
-#: src/data-list.c:1423 src/data-list.c:1458 src/data-list.c:1471
-#: src/data-list.c:1484 src/data-list.c:1517
+#: src/data-list.c:1425 src/data-list.c:1460 src/data-list.c:1473
+#: src/data-list.c:1486 src/data-list.c:1519
#, c-format
msgid "%s subcommand given multiple times."
msgstr ""
-#: src/data-list.c:1447
+#: src/data-list.c:1449
#, c-format
msgid "STARTS beginning column (%d) exceeds STARTS ending column (%d)."
msgstr ""
-#: src/data-list.c:1503
+#: src/data-list.c:1505
#, c-format
msgid "CONTINUED beginning column (%d) exceeds CONTINUED ending column (%d)."
msgstr ""
-#: src/data-list.c:1526
+#: src/data-list.c:1528
#, c-format
msgid "ID beginning column (%ld) must be positive."
msgstr ""
-#: src/data-list.c:1541
+#: src/data-list.c:1543
#, c-format
msgid "ID ending column (%ld) must be positive."
msgstr ""
-#: src/data-list.c:1547
+#: src/data-list.c:1549
#, c-format
msgid "ID ending column (%ld) cannot be less than ID beginning column (%d)."
msgstr ""
-#: src/data-list.c:1587
+#: src/data-list.c:1589
msgid "Missing required specification STARTS."
msgstr ""
-#: src/data-list.c:1589
+#: src/data-list.c:1591
msgid "Missing required specification OCCURS."
msgstr ""
-#: src/data-list.c:1596
+#: src/data-list.c:1598
msgid "ID specified without CONTINUED."
msgstr ""
-#: src/data-list.c:1688
+#: src/data-list.c:1690
msgid "String variable not allowed here."
msgstr ""
-#: src/data-list.c:1698
+#: src/data-list.c:1700
#, c-format
msgid "%s (%d) must be at least 1."
msgstr ""
-#: src/data-list.c:1704
+#: src/data-list.c:1706
#, c-format
msgid "Variable or integer expected for %s."
msgstr ""
-#: src/data-list.c:1842
+#: src/data-list.c:1844
#, c-format
msgid "Encountered mismatched record ID \"%s\" expecting \"%s\"."
msgstr ""
-#: src/data-list.c:1874
+#: src/data-list.c:1876
#, c-format
msgid ""
"Variable %s starting in column %d extends beyond physical record length of %"
"d."
msgstr ""
-#: src/data-list.c:1942
+#: src/data-list.c:1944
#, c-format
msgid "Invalid value %d for OCCURS."
msgstr ""
-#: src/data-list.c:1948
+#: src/data-list.c:1950
#, c-format
msgid "Beginning column for STARTS (%d) must be at least 1."
msgstr ""
-#: src/data-list.c:1956
+#: src/data-list.c:1958
#, c-format
msgid "Ending column for STARTS (%d) is less than beginning column (%d)."
msgstr ""
-#: src/data-list.c:1964
+#: src/data-list.c:1966
#, c-format
msgid "Invalid value %d for LENGTH."
msgstr ""
-#: src/data-list.c:1971
+#: src/data-list.c:1973
#, c-format
msgid "Beginning column for CONTINUED (%d) must be at least 1."
msgstr ""
-#: src/data-list.c:1979
+#: src/data-list.c:1981
#, c-format
msgid "Ending column for CONTINUED (%d) is less than beginning column (%d)."
msgstr ""
-#: src/data-list.c:2011
+#: src/data-list.c:2013
#, c-format
msgid ""
"Number of repetitions specified on OCCURS (%d) exceed number of repetitions "
"available in space on STARTS (%d), and CONTINUED not specified."
msgstr ""
-#: src/data-list.c:2029
+#: src/data-list.c:2031
#, c-format
msgid "Unexpected end of file with %d repetitions remaining out of %d."
msgstr ""
-#: src/data-out.c:235 src/sfm-read.c:426 src/sysfile-info.c:115
+#: src/data-out.c:235 src/sfm-read.c:485 src/sysfile-info.c:115
msgid "Unknown"
msgstr ""
msgid "Error writing file %s: %s."
msgstr ""
-#: src/dictionary.c:597
+#: src/dictionary.c:256
+#, c-format
+msgid ""
+"The entry \"%s\" in the variable name map, has no corresponding variable"
+msgstr ""
+
+#: src/dictionary.c:836
msgid ""
"At least one case in the data file had a weight value that was user-missing, "
"system-missing, zero, or negative. These case(s) were ignored."
msgid "installation error"
msgstr ""
+#: src/filename.c:221
+#, c-format
+msgid "Searching for `%s'..."
+msgstr ""
+
+#: src/filename.c:229 src/filename.c:261
+msgid "Search unsuccessful!"
+msgstr ""
+
+#: src/filename.c:254
+#, c-format
+msgid "Found `%s'."
+msgstr ""
+
+#: src/filename.c:686
+#, c-format
+msgid "Not opening pipe file `%s' because SAFER option set."
+msgstr ""
+
#: src/file-type.c:129
msgid "MIXED, GROUPED, or NESTED expected."
msgstr ""
msgid "YES or NO expected after ORDERED."
msgstr ""
-#: src/file-type.c:248 src/file-type.c:543 src/get.c:390
+#: src/file-type.c:248 src/file-type.c:543 src/get.c:440
msgid "while expecting a valid subcommand"
msgstr ""
msgid "Unknown record type %g."
msgstr ""
-#: src/filename.c:221
-#, c-format
-msgid "Searching for `%s'..."
-msgstr ""
-
-#: src/filename.c:229 src/filename.c:261
-msgid "Search unsuccessful!"
-msgstr ""
-
-#: src/filename.c:254
-#, c-format
-msgid "Found `%s'."
-msgstr ""
-
-#: src/filename.c:686
-#, c-format
-msgid "Not opening pipe file `%s' because SAFER option set."
-msgstr ""
-
#: src/flip.c:82
msgid ""
"FLIP ignores TEMPORARY. Temporary transformations will be made permanent."
msgid "%s variables are not compatible with %s format %s."
msgstr ""
-#: src/format.c:223 src/pfm-read.c:473 src/sfm-read.c:880
+#: src/format.c:223 src/pfm-read.c:473 src/sfm-read.c:944
msgid "String"
msgstr ""
-#: src/format.c:223 src/pfm-read.c:473 src/sfm-read.c:880
+#: src/format.c:223 src/pfm-read.c:473 src/sfm-read.c:944
msgid "Numeric"
msgstr ""
msgid "`)' expected after output format."
msgstr ""
-#: src/get.c:396
-msgid "All variables deleted from system file dictionary."
+#: src/get.c:251
+#, c-format
+msgid "The required %s subcommand was not present"
+msgstr ""
+
+#: src/get.c:257
+#, c-format
+msgid "Unsupported sysfile version: %d. Using version %d instead."
msgstr ""
#: src/get.c:446
+msgid "All variables deleted from system file dictionary."
+msgstr ""
+
+#: src/get.c:496
#, c-format
msgid ""
"Cannot rename %s as %s because there already exists a variable named %s. To "
"as \"/RENAME (A=B)(B=C)(C=A)\", or equivalently, \"/RENAME (A B C=B C A)\"."
msgstr ""
-#: src/get.c:471
+#: src/get.c:521
msgid "`=' expected after variable list."
msgstr ""
-#: src/get.c:478
+#: src/get.c:528
#, c-format
msgid ""
"Number of variables on left side of `=' (%d) does not match number of "
"variables on right side (%d), in parenthesized group %d of RENAME subcommand."
msgstr ""
-#: src/get.c:491
+#: src/get.c:541
#, c-format
msgid "Requested renaming duplicates variable name %s."
msgstr ""
-#: src/get.c:677
+#: src/get.c:728
msgid "The BY subcommand may be given once at most."
msgstr ""
-#: src/get.c:749
+#: src/get.c:800
msgid "The active file may not be specified more than once."
msgstr ""
-#: src/get.c:758
+#: src/get.c:809
msgid "Cannot specify the active file since no active file has been defined."
msgstr ""
-#: src/get.c:766
+#: src/get.c:817
msgid ""
"MATCH FILES may not be used after TEMPORARY when the active file is an input "
"source. Temporary transformations will be made permanent."
msgstr ""
-#: src/get.c:796
+#: src/get.c:847
msgid ""
"IN, FIRST, and LAST subcommands may not occur before the first FILE or TABLE."
msgstr ""
-#: src/get.c:831
+#: src/get.c:882
#, c-format
msgid "Multiple %s subcommands for a single FILE or TABLE."
msgstr ""
-#: src/get.c:841
+#: src/get.c:892
#, c-format
msgid "Duplicate variable name %s while creating %s variable."
msgstr ""
-#: src/get.c:853
+#: src/get.c:904
msgid ""
"RENAME, KEEP, and DROP subcommands may not occur before the first FILE or "
"TABLE."
msgstr ""
-#: src/get.c:880
+#: src/get.c:931
msgid "The BY subcommand is required when a TABLE subcommand is given."
msgstr ""
-#: src/get.c:899
+#: src/get.c:950
#, c-format
msgid "File %s lacks BY variable %s."
msgstr ""
-#: src/get.c:1393
+#: src/get.c:1444
#, c-format
msgid ""
"Variable %s in file %s (%s) has different type or width from the same "
"variable in earlier file (%s)."
msgstr ""
-#: src/get.c:1471
+#: src/get.c:1522
msgid "expecting COMM or TAPE"
msgstr ""
"REREAD: Column numbers must be positive finite numbers. Column set to 1."
msgstr ""
-#: src/lexer.c:253
+#: src/lexer.c:255
#, c-format
msgid "%s does not form a valid number."
msgstr ""
-#: src/lexer.c:370
+#: src/lexer.c:376
#, c-format
msgid "Bad character in input: `%c'."
msgstr ""
-#: src/lexer.c:372
+#: src/lexer.c:378
#, c-format
msgid "Bad character in input: `\\%o'."
msgstr ""
-#: src/lexer.c:393
+#: src/lexer.c:399
msgid "Syntax error at end of file."
msgstr ""
-#: src/lexer.c:403
+#: src/lexer.c:409
#, c-format
msgid "Syntax error %s at `%s'."
msgstr ""
-#: src/lexer.c:406
+#: src/lexer.c:412
#, c-format
msgid "Syntax error at `%s'."
msgstr ""
-#: src/lexer.c:525
+#: src/lexer.c:531
#, c-format
msgid "expecting `%s'"
msgstr ""
-#: src/lexer.c:542
+#: src/lexer.c:548
#, c-format
msgid "expecting %s"
msgstr ""
-#: src/lexer.c:556 src/val-labs.c:154
+#: src/lexer.c:562 src/val-labs.c:154
msgid "expecting string"
msgstr ""
-#: src/lexer.c:570 src/val-labs.c:163
+#: src/lexer.c:576 src/val-labs.c:163
msgid "expecting integer"
msgstr ""
-#: src/lexer.c:584
+#: src/lexer.c:590
msgid "expecting number"
msgstr ""
-#: src/lexer.c:598
+#: src/lexer.c:604
msgid "expecting identifier"
msgstr ""
-#: src/lexer.c:884
+#: src/lexer.c:890
msgid "<ERROR>"
msgstr ""
-#: src/lexer.c:1018 src/repeat.c:214
+#: src/lexer.c:1024 src/repeat.c:214
msgid "Unexpected end of file."
msgstr ""
-#: src/lexer.c:1027
+#: src/lexer.c:1033
msgid "binary"
msgstr ""
-#: src/lexer.c:1027
+#: src/lexer.c:1033
msgid "octal"
msgstr ""
-#: src/lexer.c:1027
+#: src/lexer.c:1033
msgid "hex"
msgstr ""
-#: src/lexer.c:1041
+#: src/lexer.c:1047
#, c-format
msgid "String of %s digits has %d characters, which is not a multiple of %d."
msgstr ""
-#: src/lexer.c:1070
+#: src/lexer.c:1076
#, c-format
msgid "`%c' is not a valid %s digit."
msgstr ""
-#: src/lexer.c:1101
+#: src/lexer.c:1107
msgid "Unterminated string constant."
msgstr ""
-#: src/lexer.c:1173
+#: src/lexer.c:1179
#, c-format
msgid "String exceeds 255 characters in length (%d characters)."
msgstr ""
-#: src/lexer.c:1188
+#: src/lexer.c:1194
msgid ""
"Sorry, literal strings may not contain null characters. Replacing with "
"spaces."
msgid "Bad time string length %d."
msgstr ""
-#: src/pfm-read.c:465 src/sfm-read.c:867 src/sfm-read.c:875
+#: src/pfm-read.c:465 src/sfm-read.c:931 src/sfm-read.c:939
#, c-format
msgid "%s: Bad format specifier byte (%d)."
msgstr ""
msgid "Invalid variable width %d."
msgstr ""
-#: src/pfm-read.c:525
+#: src/pfm-read.c:527
+#, c-format
+msgid "position %d: Variable name has %u characters."
+msgstr ""
+
+#: src/pfm-read.c:531
+#, c-format
+msgid "position %d: Variable name begins with invalid character."
+msgstr ""
+
+#: src/pfm-read.c:535
+#, c-format
+msgid "position %d: Variable name begins with lowercase letter %c."
+msgstr ""
+
+#: src/pfm-read.c:547
#, c-format
msgid "position %d: Invalid variable name `%s'."
msgstr ""
-#: src/pfm-read.c:533
+#: src/pfm-read.c:555
#, c-format
msgid "Duplicate variable name %s."
msgstr ""
-#: src/pfm-read.c:573
+#: src/pfm-read.c:595
#, c-format
msgid "Bad missing values for %s."
msgstr ""
-#: src/pfm-read.c:591
+#: src/pfm-read.c:613
#, c-format
msgid "Weighting variable %s not present in dictionary."
msgstr ""
-#: src/pfm-read.c:638
+#: src/pfm-read.c:660
#, c-format
msgid "Unknown variable %s while parsing value labels."
msgstr ""
-#: src/pfm-read.c:641
+#: src/pfm-read.c:663
#, c-format
msgid ""
"Cannot assign value labels to %s and %s, which have different variable types "
"or widths."
msgstr ""
-#: src/pfm-read.c:665
+#: src/pfm-read.c:687
#, c-format
msgid "Duplicate label for value %g for variable %s."
msgstr ""
-#: src/pfm-read.c:668
+#: src/pfm-read.c:690
#, c-format
msgid "Duplicate label for value `%.*s' for variable %s."
msgstr ""
msgid "%s: Closing portable file: %s."
msgstr ""
-#: src/plot-hist.c:118
+#: src/plot-hist.c:123
msgid "HISTOGRAM"
msgstr ""
-#: src/plot-hist.c:120 src/frequencies.q:1139
+#: src/plot-hist.c:125 src/frequencies.q:1139
msgid "Frequency"
msgstr ""
msgid "corrupt system file: "
msgstr ""
-#: src/sfm-read.c:149 src/sfm-write.c:808
+#: src/sfm-read.c:149 src/sfm-write.c:918
#, c-format
msgid "%s: Closing system file: %s."
msgstr ""
"immediately follow type 3 records."
msgstr ""
-#: src/sfm-read.c:329
+#: src/sfm-read.c:333
+#, c-format
+msgid "%s: Invalid subrecord length. Record: 7; Subrecord: 11"
+msgstr ""
+
+#: src/sfm-read.c:388
#, c-format
msgid "%s: Unrecognized record type 7, subtype %d encountered in system file."
msgstr ""
-#: src/sfm-read.c:354
+#: src/sfm-read.c:413
#, c-format
msgid "%s: Unrecognized record type %d."
msgstr ""
-#: src/sfm-read.c:386
+#: src/sfm-read.c:445
#, c-format
msgid ""
"%s: Bad size (%d) or count (%d) field on record type 7, subtype 3.\tExpected "
"size %d, count 8."
msgstr ""
-#: src/sfm-read.c:397
+#: src/sfm-read.c:456
#, c-format
msgid ""
"%s: Floating-point representation in system file is not IEEE-754. PSPP "
"cannot convert between floating-point formats."
msgstr ""
-#: src/sfm-read.c:413
+#: src/sfm-read.c:472
#, c-format
msgid ""
"%s: File-indicated endianness (%s) does not match endianness intuited from "
"file header (%s)."
msgstr ""
-#: src/sfm-read.c:416 src/sfm-read.c:417
+#: src/sfm-read.c:475 src/sfm-read.c:476
msgid "big-endian"
msgstr ""
-#: src/sfm-read.c:416 src/sfm-read.c:417
+#: src/sfm-read.c:475 src/sfm-read.c:476
msgid "little-endian"
msgstr ""
-#: src/sfm-read.c:418
+#: src/sfm-read.c:477
msgid "unknown"
msgstr ""
-#: src/sfm-read.c:422
+#: src/sfm-read.c:481
#, c-format
msgid "%s: File-indicated character representation code (%s) is not ASCII."
msgstr ""
-#: src/sfm-read.c:426
+#: src/sfm-read.c:485
msgid "DEC Kanji"
msgstr ""
-#: src/sfm-read.c:442
+#: src/sfm-read.c:501
#, c-format
msgid ""
"%s: Bad size (%d) or count (%d) field on record type 7, subtype 4.\tExpected "
"size %d, count 8."
msgstr ""
-#: src/sfm-read.c:457
+#: src/sfm-read.c:516
#, c-format
msgid ""
"%s: File-indicated value is different from internal value for at least one "
"%g; LOWEST: %g, %g."
msgstr ""
-#: src/sfm-read.c:484
+#: src/sfm-read.c:543
#, c-format
msgid ""
"%s: Bad magic. Proper system files begin with the four characters `$FL2'. "
"This file will not be read."
msgstr ""
-#: src/sfm-read.c:526
+#: src/sfm-read.c:585
#, c-format
msgid ""
"%s: File layout code has unexpected value %d. Value should be 2, in big-"
"endian or little-endian format."
msgstr ""
-#: src/sfm-read.c:542
+#: src/sfm-read.c:601
#, c-format
msgid "%s: Number of elements per case (%d) is not between 1 and %d."
msgstr ""
-#: src/sfm-read.c:551
+#: src/sfm-read.c:610
#, c-format
msgid ""
"%s: Index of weighting variable (%d) is not between 0 and number of elements "
"per case (%d)."
msgstr ""
-#: src/sfm-read.c:558
+#: src/sfm-read.c:617
#, c-format
msgid "%s: Number of cases in file (%ld) is not between -1 and %d."
msgstr ""
-#: src/sfm-read.c:563
+#: src/sfm-read.c:622
#, c-format
msgid "%s: Compression bias (%g) is not the usual value of 100."
msgstr ""
-#: src/sfm-read.c:656
+#: src/sfm-read.c:717
#, c-format
msgid "%s: position %d: Bad record type (%d); the expected value was 2."
msgstr ""
-#: src/sfm-read.c:666
+#: src/sfm-read.c:727
#, c-format
msgid ""
"%s: position %d: String variable does not have proper number of continuation "
"records."
msgstr ""
-#: src/sfm-read.c:675
+#: src/sfm-read.c:736
#, c-format
msgid "%s: position %d: Superfluous long string continuation record."
msgstr ""
-#: src/sfm-read.c:681
+#: src/sfm-read.c:742
#, c-format
msgid "%s: position %d: Bad variable type code %d."
msgstr ""
-#: src/sfm-read.c:684
+#: src/sfm-read.c:745
#, c-format
msgid "%s: position %d: Variable label indicator field is not 0 or 1."
msgstr ""
-#: src/sfm-read.c:688
+#: src/sfm-read.c:749
#, c-format
msgid ""
"%s: position %d: Missing value indicator field is not -3, -2, 0, 1, 2, or 3."
msgstr ""
-#: src/sfm-read.c:694
+#: src/sfm-read.c:755
#, c-format
msgid "%s: position %d: Variable name begins with invalid character."
msgstr ""
-#: src/sfm-read.c:698
+#: src/sfm-read.c:759
#, c-format
msgid "%s: position %d: Variable name begins with lowercase letter %c."
msgstr ""
-#: src/sfm-read.c:702
+#: src/sfm-read.c:763
#, c-format
msgid ""
"%s: position %d: Variable name begins with octothorpe (`#'). Scratch "
"variables should not appear in system files."
msgstr ""
-#: src/sfm-read.c:717
+#: src/sfm-read.c:778
#, c-format
msgid "%s: position %d: Variable name character %d is lowercase letter %c."
msgstr ""
-#: src/sfm-read.c:726
+#: src/sfm-read.c:787
#, c-format
msgid ""
"%s: position %d: character `\\%03o' (%c) is not valid in a variable name."
msgstr ""
-#: src/sfm-read.c:735
+#: src/sfm-read.c:796
#, c-format
msgid "%s: Duplicate variable name `%s' within system file."
msgstr ""
-#: src/sfm-read.c:756
+#: src/sfm-read.c:817
#, c-format
msgid "%s: Variable %s indicates variable label of invalid length %d."
msgstr ""
-#: src/sfm-read.c:773
+#: src/sfm-read.c:837
#, c-format
msgid "%s: Long string variable %s may not have missing values."
msgstr ""
-#: src/sfm-read.c:798
+#: src/sfm-read.c:862
#, c-format
msgid ""
"%s: String variable %s may not have missing values specified as a range."
msgstr ""
-#: src/sfm-read.c:846
+#: src/sfm-read.c:910
#, c-format
msgid "%s: Long string continuation records omitted at end of dictionary."
msgstr ""
-#: src/sfm-read.c:850
+#: src/sfm-read.c:914
#, c-format
msgid ""
"%s: System file header indicates %d variable positions but %d were read from "
"file."
msgstr ""
-#: src/sfm-read.c:878
+#: src/sfm-read.c:942
#, c-format
msgid "%s: %s variable %s has %s format specifier %s."
msgstr ""
-#: src/sfm-read.c:957
+#: src/sfm-read.c:1021
#, c-format
msgid ""
"%s: Variable index record (type 4) does not immediately follow value label "
"record (type 3) as it should."
msgstr ""
-#: src/sfm-read.c:968
+#: src/sfm-read.c:1032
#, c-format
msgid ""
"%s: Number of variables associated with a value label (%d) is not between 1 "
"and the number of variables (%d)."
msgstr ""
-#: src/sfm-read.c:984
+#: src/sfm-read.c:1048
#, c-format
msgid ""
"%s: Variable index associated with value label (%d) is not between 1 and the "
"number of values (%d)."
msgstr ""
-#: src/sfm-read.c:991
+#: src/sfm-read.c:1055
#, c-format
msgid ""
"%s: Variable index associated with value label (%d) refers to a continuation "
"of a string variable, not to an actual variable."
msgstr ""
-#: src/sfm-read.c:996
+#: src/sfm-read.c:1060
#, c-format
msgid "%s: Value labels are not allowed on long string variables (%s)."
msgstr ""
-#: src/sfm-read.c:1007
+#: src/sfm-read.c:1071
#, c-format
msgid ""
"%s: Variables associated with value label are not all of identical type. "
"Variable %s has %s type, but variable %s has %s type."
msgstr ""
-#: src/sfm-read.c:1048
+#: src/sfm-read.c:1112
#, c-format
msgid "%s: File contains duplicate label for value %g for variable %s."
msgstr ""
-#: src/sfm-read.c:1052
+#: src/sfm-read.c:1116
#, c-format
msgid "%s: File contains duplicate label for value `%.*s' for variable %s."
msgstr ""
-#: src/sfm-read.c:1087 src/sfm-read.c:1351
+#: src/sfm-read.c:1158 src/sfm-read.c:1422
#, c-format
msgid "%s: Reading system file: %s."
msgstr ""
-#: src/sfm-read.c:1090 src/sfm-read.c:1192 src/sfm-read.c:1234
+#: src/sfm-read.c:1161 src/sfm-read.c:1263 src/sfm-read.c:1305
#, c-format
msgid "%s: Unexpected end of file."
msgstr ""
-#: src/sfm-read.c:1107
+#: src/sfm-read.c:1178
#, c-format
msgid "%s: System file contains multiple type 6 (document) records."
msgstr ""
-#: src/sfm-read.c:1113
+#: src/sfm-read.c:1184
#, c-format
msgid "%s: Number of document lines (%ld) must be greater than 0."
msgstr ""
-#: src/sfm-read.c:1145
+#: src/sfm-read.c:1216
#, c-format
msgid "%s: Error reading file: %s."
msgstr ""
-#: src/sfm-read.c:1182
+#: src/sfm-read.c:1253
#, c-format
msgid "%s: Compressed data is corrupted. Data ends in partial case."
msgstr ""
-#: src/sfm-read.c:1354
+#: src/sfm-read.c:1425
#, c-format
msgid "%s: Partial record at end of system file."
msgstr ""
-#: src/sfm-write.c:143
+#: src/sfm-write.c:153
#, c-format
msgid "Error opening \"%s\" for writing as a system file: %s."
msgstr ""
-#: src/sfm-write.c:628
+#: src/sfm-write.c:738
#, c-format
msgid "%s: Writing system file: %s."
msgstr ""
-#: src/sort.c:203
+#: src/sort.c:103
+msgid "Buffer limit must be at least 2."
+msgstr ""
+
+#: src/sort.c:221
msgid "`A' or `D' expected inside parentheses."
msgstr ""
-#: src/sort.c:208
+#: src/sort.c:226
msgid "`)' expected."
msgstr ""
-#: src/sort.c:572 src/sort.c:750
+#: src/sort.c:573
#, c-format
msgid ""
"Out of memory. Could not allocate room for minimum of %d cases of %d bytes "
msgid "Truncating variable label to 255 characters."
msgstr ""
-#: src/vars-atr.c:248
+#: src/vars-atr.c:249
msgid "Variable names must be at least 1 character long."
msgstr ""
-#: src/vars-atr.c:254
+#: src/vars-atr.c:255
#, c-format
msgid "Variable name %s exceeds %d-character limit."
msgstr ""
-#: src/vars-atr.c:263
+#: src/vars-atr.c:264
#, c-format
msgid "Character `%c' (in %s) may not appear in a variable name."
msgstr ""
-#: src/vars-atr.c:272
+#: src/vars-atr.c:273
#, c-format
msgid ""
"Character `%c' (in %s), may not appear as the first character in a variable "
"name."
msgstr ""
-#: src/vars-atr.c:280
+#: src/vars-atr.c:281
#, c-format
msgid "%s may not be used as a variable name because it is a reserved word."
msgstr ""
msgid "scratch"
msgstr ""
-#: src/vars-prs.c:174
+#: src/vars-prs.c:175
#, c-format
msgid ""
"%s is not a numeric variable. It will not be included in the variable list."
msgstr ""
-#: src/vars-prs.c:177
+#: src/vars-prs.c:178
#, c-format
msgid ""
"%s is not a string variable. It will not be included in the variable list."
msgstr ""
-#: src/vars-prs.c:181
+#: src/vars-prs.c:182
#, c-format
msgid "Scratch variables (such as %s) are not allowed here."
msgstr ""
-#: src/vars-prs.c:184
+#: src/vars-prs.c:185
#, c-format
msgid ""
"%s and %s are not the same type. All variables in this variable list must "
"be of the same type. %s will be omitted from list."
msgstr ""
-#: src/vars-prs.c:189
+#: src/vars-prs.c:190
#, c-format
msgid "Variable %s appears twice in variable list."
msgstr ""
-#: src/vars-prs.c:299
+#: src/vars-prs.c:300
#, c-format
msgid "%s TO %s is not valid syntax since %s precedes %s in the dictionary."
msgstr ""
#ifndef P_tmpdir
#define P_tmpdir "/tmp"
#endif
+
+#define SHORT_NAME_LEN 8
+#define LONG_NAME_LEN 64
+ * var-display.c: New file.
+
+ * format.h var.h sfm-read.c sfm-write.c dictionary.c : Added
+ display_width, measure and alignment parameters to variables.
+
+ * aggregate.c command.def compute.c count.c data-list.c descript.c
+ dictionary.c dictionary.h expr-prs.c file-type.c flip.c get.c lexer.c
+ lexer.h loop.c modify-vars.c pfm-read.c recode.c repeat.c sfm-read.c
+ sfm-write.c sfm-write.h sfmP.h val-labs.c val.h var.h vars-prs.c
+ vector.c :
+ - Replaced literal constants representing maximum variable name
+ length with macro definitions.
+ - Added support for long variable names.
+ - Changed lexer such that it no longer makes tokens upper case, but
+ relies upon case insensitive behaviour of commands.
+
Mon Apr 4 22:27:34 2005 Ben Pfaff <blp@gnu.org>
* aggregate.c: (parse_aggregate_functions) If dict_create_var()
* flip.c: (cmd_flip) Ditto.
+>>>>>>> 1.161
Sun Mar 13 22:52:05 2005 Ben Pfaff <blp@gnu.org>
* file-handle.q: (struct file_handle) `open_mode' should not be
(initialize_aggregate_info) Fix initialization for MIN, MAX for
strings.
+>>>>>>> 1.160
Sat Mar 12 23:26:21 2005 Ben Pfaff <blp@gnu.org>
Start work on testing and debugging AGGREGATE.
sort.c sort.h split-file.c str.c str.h subclist.c subclist.h \
sysfile-info.c tab.c tab.h temporary.c stat.h mkfile.c mkfile.h \
title.c val.h val-labs.c value-labels.c value-labels.h \
+var-display.c \
var-labs.c var.h vars-atr.c vars-prs.c vector.c version.h \
vfm.c vfm.h vfmP.h weight.c
for (i = 0; i < agr.break_var_cnt; i++)
{
struct variable *v = dict_clone_var (agr.dict, agr.break_vars[i],
- agr.break_vars[i]->name);
+ agr.break_vars[i]->name,
+ agr.break_vars[i]->longname
+ );
assert (v != NULL);
}
}
else
{
- agr.writer = sfm_open_writer (out_file, agr.dict, get_scompression ());
+ agr.writer = sfm_open_writer (out_file, agr.dict, get_scompression (), 0);
if (agr.writer == NULL)
goto error;
}
for (function = agr_func_tab; function->name; function++)
- if (!strcmp (function->name, tokid))
+ if (!strcasecmp (function->name, tokid))
break;
if (NULL == function->name)
{
}
if (function->alpha_type == ALPHA)
- destvar = dict_clone_var (agr->dict, v->src, dest[i]);
+ destvar = dict_clone_var (agr->dict, v->src, 0, dest[i] );
else if (v->src->type == NUMERIC
|| function->alpha_type == NUMERIC)
{
DEFCMD ("AGGREGATE", ERRO, ERRO, PROC, TRAN, cmd_aggregate)
UNIMPL ("ANOVA", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("APPLY DICTIONARY", ERRO, ERRO, TRAN, TRAN, cmd_apply_dictionary)
+UNIMPL ("AREG", ERRO, ERRO, ERRO, ERRO)
+UNIMPL ("ARIMA", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("AUTORECODE", ERRO, ERRO, PROC, PROC, cmd_autorecode)
SPCCMD ("BEGIN DATA", ERRO, ERRO, PROC, PROC, cmd_begin_data)
DEFCMD ("BREAK", ERRO, INPU, TRAN, TRAN, cmd_break)
UNIMPL ("CCF", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("CLEAR TRANSFORMATIONS", ERRO, INPU, TRAN, TRAN, cmd_clear_transformations)
UNIMPL ("CLUSTER", ERRO, ERRO, ERRO, ERRO)
-UNIMPL ("COMMENT", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("COMPUTE", ERRO, INPU, TRAN, TRAN, cmd_compute)
UNIMPL ("CONJOINT", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("CORRELATIONS", ERRO, ERRO, PROC, PROC, cmd_correlations)
+UNIMPL ("COXREG", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("COUNT", ERRO, INPU, TRAN, TRAN, cmd_count)
UNIMPL ("CREATE", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("CROSSTABS", ERRO, ERRO, PROC, PROC, cmd_crosstabs)
DBGCMD ("DEBUG EVALUATE", INIT, INPU, TRAN, PROC, cmd_debug_evaluate)
DBGCMD ("DEBUG MOMENTS", INIT, INPU, TRAN, PROC, cmd_debug_moments)
DBGCMD ("DEBUG POOL", INIT, INPU, TRAN, PROC, cmd_debug_pool)
+UNIMPL ("DELETE VARIABLES", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("DESCRIPTIVES", ERRO, ERRO, PROC, PROC, cmd_descriptives)
UNIMPL ("DISCRIMINANT", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("DISPLAY", ERRO, INPU, TRAN, PROC, cmd_display)
DEFCMD ("FLIP", ERRO, ERRO, PROC, PROC, cmd_flip)
DEFCMD ("FORMATS", INIT, INPU, TRAN, PROC, cmd_formats)
DEFCMD ("FREQUENCIES", ERRO, ERRO, PROC, PROC, cmd_frequencies)
+UNIMPL ("GENLOG", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("GET", TRAN, ERRO, TRAN, TRAN, cmd_get)
UNIMPL ("GET TRANSLATE", ERRO, ERRO, ERRO, ERRO)
UNIMPL ("GLM", ERRO, ERRO, ERRO, ERRO)
UNIMPL ("GRAPH", ERRO, ERRO, ERRO, ERRO)
+UNIMPL ("HILOGLINEAR", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("HOST", INIT, INPU, TRAN, PROC, cmd_host)
DEFCMD ("IF", ERRO, INPU, TRAN, TRAN, cmd_if)
UNIMPL ("IGRAPH", ERRO, ERRO, ERRO, ERRO)
UNIMPL ("KEYED DATA LIST", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("LEAVE", ERRO, INPU, TRAN, TRAN, cmd_leave)
DEFCMD ("LIST", ERRO, ERRO, PROC, PROC, cmd_list)
+UNIMPL ("LOGLINEAR", ERRO, ERRO, ERRO, ERRO)
+UNIMPL ("LOGISITIC REGRESSION", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("LOOP", ERRO, INPU, TRAN, TRAN, cmd_loop)
DEFCMD ("MATCH FILES", TRAN, ERRO, TRAN, PROC, cmd_match_files)
DEFCMD ("MATRIX DATA", TRAN, ERRO, TRAN, TRAN, cmd_matrix_data)
DEFCMD ("MISSING VALUES", ERRO, INPU, TRAN, TRAN, cmd_missing_values)
DEFCMD ("MODIFY VARS", ERRO, ERRO, TRAN, PROC, cmd_modify_vars)
UNIMPL ("MULT RESPONSE", ERRO, ERRO, ERRO, ERRO)
+UNIMPL ("MVA", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("NEW FILE", INIT, ERRO, INIT, INIT, cmd_new_file)
DEFCMD ("N", INIT, INPU, TRAN, TRAN, cmd_n_of_cases)
DEFCMD ("N OF CASES", INIT, INPU, TRAN, TRAN, cmd_n_of_cases)
+UNIMPL ("NLR", ERRO, ERRO, ERRO, ERRO)
UNIMPL ("NONPAR CORR", ERRO, ERRO, ERRO, ERRO)
UNIMPL ("NPAR TESTS", ERRO, ERRO, ERRO, ERRO)
UNIMPL ("NUMBERED", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("NUMERIC", ERRO, INPU, TRAN, TRAN, cmd_numeric)
+UNIMPL ("OLAP CUBES", ERRO, ERRO, ERRO, ERRO)
+UNIMPL ("OMS", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("ONEWAY", ERRO, ERRO, PROC, PROC, cmd_oneway)
+UNIMPL ("ORTHOPLAN", ERRO, ERRO, ERRO, ERRO)
UNIMPL ("PACF", ERRO, ERRO, ERRO, ERRO)
UNIMPL ("PARTIAL CORR", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("PEARSON CORRELATIONS", ERRO, ERRO, PROC, PROC, cmd_correlations)
UNIMPL ("UPDATE", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("USE", ERRO, ERRO, TRAN, TRAN, cmd_use)
DEFCMD ("VALUE LABELS", ERRO, INPU, TRAN, TRAN, cmd_value_labels)
+DEFCMD ("VARIABLE ALIGNMENT", ERRO, INPU, TRAN, TRAN, cmd_variable_alignment)
DEFCMD ("VARIABLE LABELS", ERRO, INPU, TRAN, TRAN, cmd_variable_labels)
-UNIMPL ("VARIABLE LEVEL", ERRO, ERRO, ERRO, ERRO)
+DEFCMD ("VARIABLE LEVEL", ERRO, INPU, TRAN, TRAN, cmd_variable_level)
+DEFCMD ("VARIABLE WIDTH", ERRO, INPU, TRAN, TRAN, cmd_variable_width)
UNIMPL ("VARSTOCASES", ERRO, ERRO, ERRO, ERRO)
DEFCMD ("VECTOR", ERRO, INPU, TRAN, TRAN, cmd_vector)
UNIMPL ("VERIFY", ERRO, ERRO, ERRO, ERRO)
/* COMPUTE or IF target variable or vector element. */
struct lvalue
{
- char var_name[9]; /* Destination variable name, or "". */
+ char var_name[LONG_NAME_LEN + 1]; /* Destination variable name, or "". */
const struct vector *vector; /* Destination vector, if any, or NULL. */
struct expression *element; /* Destination vector element, or NULL. */
};
else
{
/* Variable name. */
- strncpy (lvalue->var_name, tokid, 8);
- lvalue->var_name[8] = '\0';
+ strncpy (lvalue->var_name, tokid, LONG_NAME_LEN);
+ lvalue->var_name[LONG_NAME_LEN] = '\0';
lex_get ();
}
return lvalue;
struct cnt_var_info *next;
struct variable *d; /* Destination variable. */
- char n[9]; /* Name of dest var. */
+ char n[SHORT_NAME_LEN + 1]; /* Name of dest var. */
struct counting *c; /* The counting specifications. */
};
int fc, lc; /* Column numbers in record. */
/* Free format only. */
- char name[9]; /* Name of variable. */
+ char name[SHORT_NAME_LEN + 1]; /* Name of variable. */
};
/* Constants for DATA LIST type. */
if (!parse_DATA_LIST_vars (&name, &name_cnt, PV_NONE))
return 0;
+
if (lex_match ('('))
{
if (!parse_format_specifier (&input, 0)
struct variable *v;
v = dict_create_var (default_dict, name[i], width);
+
if (!v)
{
msg (SE, _("%s is a duplicate variable name."), name[i]);
spec->input = input;
spec->v = v;
spec->fv = v->fv;
- strcpy (spec->name, name[i]);
+ strcpy (spec->name, v->name);
append_var_spec (first, last, spec);
}
for (i = 0; i < name_cnt; i++)
struct dsc_var
{
struct variable *v; /* Variable to calculate on. */
- char z_name[9]; /* Name for z-score variable. */
+ char z_name[SHORT_NAME_LEN + 1];/* Name for z-score variable. */
double valid, missing; /* Valid, missing counts. */
struct moments *moments; /* Moments. */
double min, max; /* Maximum and mimimum values. */
/* Try a name based on the original variable name. */
name[0] = 'Z';
strcpy (name + 1, var_name);
- name[8] = '\0';
+ name[SHORT_NAME_LEN] = '\0';
if (try_name (dsc, name))
{
strcpy (z_name, name);
#include <config.h>
#include "dictionary.h"
#include <stdlib.h>
+#include <ctype.h>
#include "algorithm.h"
#include "alloc.h"
#include "case.h"
struct variable **var; /* Variables. */
size_t var_cnt, var_cap; /* Number of variables, capacity. */
struct hsh_table *name_tab; /* Variable index by name. */
+ struct hsh_table *long_name_tab; /* Variable indexed by long name */
int next_value_idx; /* Index of next `union value' to allocate. */
struct variable **split; /* SPLIT FILE vars. */
size_t split_cnt; /* SPLIT FILE count. */
size_t vector_cnt; /* Number of vectors. */
};
+
+
+
+
+int
+compare_long_names(const void *a_, const void *b_, void *aux UNUSED)
+{
+ const struct name_table_entry *a = a_;
+ const struct name_table_entry *b = b_;
+
+ return strcasecmp(a->longname, b->longname);
+}
+
+
+/* Long names use case insensitive comparison */
+unsigned int
+hash_long_name (const void *e_, void *aux UNUSED)
+{
+ const struct name_table_entry *e = e_;
+ unsigned int hash;
+ int i;
+
+ char *s = strdup(e->longname);
+
+ for ( i = 0 ; i < strlen(s) ; ++i )
+ s[i] = toupper(s[i]);
+
+ hash = hsh_hash_string (s);
+
+ free (s);
+
+ return hash;
+}
+
+static char *make_short_name(struct dictionary *dict, const char *longname) ;
+
+
/* Creates and returns a new dictionary. */
struct dictionary *
dict_create (void)
d->var = NULL;
d->var_cnt = d->var_cap = 0;
d->name_tab = hsh_create (8, compare_var_names, hash_var_name, NULL, NULL);
+ d->long_name_tab = hsh_create (8, compare_long_names, hash_long_name, NULL, NULL);
d->next_value_idx = 0;
d->split = NULL;
d->split_cnt = 0;
{
struct dictionary *d;
size_t i;
-
+
assert (s != NULL);
-
+
d = dict_create ();
+
for (i = 0; i < s->var_cnt; i++)
- dict_clone_var (d, s->var[i], s->var[i]->name);
+ dict_clone_var (d, s->var[i], s->var[i]->name, s->var[i]->longname);
+
d->next_value_idx = s->next_value_idx;
d->split_cnt = s->split_cnt;
d->var = NULL;
d->var_cnt = d->var_cap = 0;
hsh_clear (d->name_tab);
+ if ( d->long_name_tab)
+ hsh_clear (d->long_name_tab);
d->next_value_idx = 0;
free (d->split);
d->split = NULL;
dict_clear_vectors (d);
}
+/* Allocate the pointer TEXT and fill it with text representing the
+ long variable name buffer. SIZE will contain the size of TEXT.
+ TEXT must be freed by the caller when no longer required.
+*/
+void
+dict_get_varname_block(const struct dictionary *dict, char **text, int *size)
+{
+ char *buf = 0;
+ int bufsize = 0;
+ struct hsh_iterator hi;
+ struct name_table_entry *nte;
+ short first = 1;
+
+ for ( nte = hsh_first(dict->long_name_tab, &hi);
+ nte;
+ nte = hsh_next(dict->long_name_tab, &hi))
+ {
+ bufsize += strlen(nte->name) + strlen(nte->longname) + 2;
+ buf = xrealloc(buf, bufsize + 1);
+ if ( first )
+ strcpy(buf, "");
+ first = 0;
+
+ strcat(buf, nte->name);
+ strcat(buf, "=");
+ strcat(buf, nte->longname);
+ strcat(buf, "\t");
+ }
+
+ if ( bufsize > 0 )
+ {
+ /* Loose the final delimiting TAB */
+ buf[bufsize]='\0';
+ bufsize--;
+ }
+
+ *text = buf;
+ *size = bufsize;
+}
+
+
+/* Add a new entry into the dictionary's long name table, and update the
+ corresponding varible with the relevant long name.
+*/
+void
+dict_add_longvar_entry(struct dictionary *d,
+ const char *name,
+ const char *longname)
+{
+ struct variable *v;
+ assert ( name ) ;
+ assert ( longname );
+ struct name_table_entry *nte = xmalloc (sizeof (struct name_table_entry));
+ nte->longname = strdup(longname);
+ nte->name = strdup(name);
+
+
+ /* Look up the name in name_tab */
+ v = hsh_find ( d->name_tab, name);
+ if ( !v )
+ {
+ msg (FE, _("The entry \"%s\" in the variable name map, has no corresponding variable"), name);
+ return ;
+ }
+ assert ( 0 == strcmp(v->name, name) );
+ v->longname = nte->longname;
+
+ hsh_insert(d->long_name_tab, nte);
+
+
+}
+
/* Destroys the aux data for every variable in D, by calling
var_clear_aux() for each variable. */
void
{
dict_clear (d);
hsh_destroy (d->name_tab);
+ hsh_destroy (d->long_name_tab);
free (d);
}
}
assert (*cnt == count);
}
-/* Creates and returns a new variable in D with the given NAME
- and WIDTH. Returns a null pointer if the given NAME would
- duplicate that of an existing variable in the dictionary. */
+
+static struct variable * dict_create_var_x (struct dictionary *d,
+ const char *name, int width,
+ short name_is_short) ;
+
+/* Creates and returns a new variable in D with the given LONGNAME
+ and WIDTH. Returns a null pointer if the given LONGNAME would
+ duplicate that of an existing variable in the dictionary.
+*/
struct variable *
-dict_create_var (struct dictionary *d, const char *name, int width)
+dict_create_var (struct dictionary *d, const char *longname, int width)
+{
+ return dict_create_var_x(d, longname, width, 0);
+}
+
+
+/* Creates and returns a new variable in D with the given SHORTNAME and
+ WIDTH. The long name table is not updated */
+struct variable *
+dict_create_var_from_short (struct dictionary *d, const char *shortname,
+ int width)
+{
+ return dict_create_var_x(d, shortname, width, 1);
+}
+
+
+
+/* Creates and returns a new variable in D with the given NAME
+ and WIDTH.
+ If NAME_IS_SHORT, assume NAME is the short name. Otherwise assumes
+ NAME is the long name, and creates the corresponding entry in the
+ Dictionary's lookup name table .
+ Returns a null pointer if the given NAME would
+ duplicate that of an existing variable in the dictionary.
+
+*/
+static struct variable *
+dict_create_var_x (struct dictionary *d, const char *name, int width,
+ short name_is_short)
{
struct variable *v;
assert (d != NULL);
assert (name != NULL);
- assert (strlen (name) >= 1 && strlen (name) <= 8);
+
+ assert (strlen (name) >= 1);
+
assert (width >= 0 && width < 256);
+
+ if ( name_is_short )
+ assert(strlen (name) <= SHORT_NAME_LEN);
+ else
+ assert(strlen (name) <= LONG_NAME_LEN);
/* Make sure there's not already a variable by that name. */
if (dict_lookup_var (d, name) != NULL)
/* Allocate and initialize variable. */
v = xmalloc (sizeof *v);
- strncpy (v->name, name, sizeof v->name);
- v->name[8] = '\0';
+
+ if ( name_is_short )
+ {
+ strncpy (v->name, name, sizeof v->name);
+ v->name[SHORT_NAME_LEN] = '\0';
+ }
+ else
+ strcpy(v->name,make_short_name(d, name));
+
+
v->index = d->var_cnt;
v->type = width == 0 ? NUMERIC : ALPHA;
v->width = width;
v->fv = d->next_value_idx;
v->nv = width == 0 ? 1 : DIV_RND_UP (width, 8);
v->init = 1;
- v->reinit = dict_class_from_id (name) != DC_SCRATCH;
+ v->reinit = dict_class_from_id (v->name) != DC_SCRATCH;
v->miss_type = MISSING_NONE;
if (v->type == NUMERIC)
{
v->print.type = FMT_F;
v->print.w = 8;
v->print.d = 2;
+
+ v->alignment = ALIGN_RIGHT;
+ v->display_width = 8;
+ v->measure = MEASURE_SCALE;
}
else
{
v->print.type = FMT_A;
v->print.w = v->width;
v->print.d = 0;
+
+ v->alignment = ALIGN_LEFT;
+ v->display_width = 8;
+ v->measure = MEASURE_NOMINAL;
}
v->write = v->print;
v->val_labs = val_labs_create (v->width);
d->var[v->index] = v;
d->var_cnt++;
hsh_force_insert (d->name_tab, v);
+
+ if ( ! name_is_short)
+ dict_add_longvar_entry(d, v->name, name);
+
d->next_value_idx += v->nv;
return v;
and WIDTH. Assert-fails if the given NAME would duplicate
that of an existing variable in the dictionary. */
struct variable *
-dict_create_var_assert (struct dictionary *d, const char *name, int width)
+dict_create_var_assert (struct dictionary *d, const char *longname, int width)
{
- struct variable *v = dict_create_var (d, name, width);
+ struct variable *v = dict_create_var (d, longname, width);
assert (v != NULL);
return v;
}
-/* Creates a new variable in D named NAME, as a copy of existing
- variable OV, which need not be in D or in any dictionary. */
+/* Creates a new variable in D with longname LONGNAME, as a copy of
+ existing variable OV, which need not be in D or in any
+ dictionary.
+ If SHORTNAME is non null, it will be used as the short name
+ otherwise a new short name will be generated.
+*/
struct variable *
dict_clone_var (struct dictionary *d, const struct variable *ov,
- const char *name)
+ const char *name, const char *longname)
{
struct variable *nv;
assert (d != NULL);
assert (ov != NULL);
- assert (name != NULL);
- assert (strlen (name) >= 1 && strlen (name) <= 8);
+ assert (strlen (longname) <= LONG_NAME_LEN);
+
+ struct name_table_entry *nte = xmalloc (sizeof (struct name_table_entry));
+
+ nte->longname = strdup(longname);
+ if ( name )
+ {
+ assert (strlen (name) >= 1);
+ assert (strlen (name) <= SHORT_NAME_LEN);
+ nte->name = strdup(name);
+ }
+ else
+ nte->name = make_short_name(d, longname);
- nv = dict_create_var (d, name, ov->width);
+
+ nv = dict_create_var_from_short (d, nte->name, ov->width);
if (nv == NULL)
return NULL;
+ hsh_insert(d->long_name_tab, nte);
+ nv->longname = nte->longname;
+
nv->init = 1;
nv->reinit = ov->reinit;
nv->miss_type = ov->miss_type;
if (ov->label != NULL)
nv->label = xstrdup (ov->label);
+ nv->alignment = ov->alignment;
+ nv->measure = ov->measure;
+ nv->display_width = ov->display_width;
+
return nv;
}
assert (d != NULL);
assert (v != NULL);
assert (new_name != NULL);
- assert (strlen (new_name) >= 1 && strlen (new_name) <= 8);
+ assert (strlen (new_name) >= 1 && strlen (new_name) <= SHORT_NAME_LEN);
assert (dict_contains_var (d, v));
if (!strcmp (v->name, new_name))
hsh_force_delete (d->name_tab, v);
strncpy (v->name, new_name, sizeof v->name);
- v->name[8] = '\0';
+ v->name[SHORT_NAME_LEN] = '\0';
hsh_force_insert (d->name_tab, v);
}
dict_lookup_var (const struct dictionary *d, const char *name)
{
struct variable v;
+ struct variable *vr;
+ char *short_name;
+ struct name_table_entry key;
+ struct name_table_entry *nte;
+
assert (d != NULL);
assert (name != NULL);
- assert (strlen (name) >= 1 && strlen (name) <= 8);
+ assert (strlen (name) >= 1 && strlen (name) <= LONG_NAME_LEN);
+
+ key.longname = name;
+ nte = hsh_find (d->long_name_tab, &key);
+
+ if ( ! nte )
+ {
+ return 0;
+ }
+
+ short_name = nte->name ;
- strncpy (v.name, name, sizeof v.name);
- v.name[8] = '\0';
+ strncpy (v.name, short_name, sizeof v.name);
+ v.name[SHORT_NAME_LEN] = '\0';
- return hsh_find (d->name_tab, &v);
+ vr = hsh_find (d->name_tab, &v);
+
+ return vr;
}
+
/* Returns the variable named NAME in D. Assert-fails if no
variable has that name. */
struct variable *
size_t i;
int success = 1;
+
assert (d != NULL);
assert (count == 0 || vars != NULL);
assert (count == 0 || new_names != NULL);
+
old_names = xmalloc (count * sizeof *old_names);
for (i = 0; i < count; i++)
{
for (i = 0; i < count; i++)
{
+ struct name_table_entry key;
+ struct name_table_entry *nte;
assert (new_names[i] != NULL);
assert (*new_names[i] != '\0');
- assert (strlen (new_names[i]) < 9);
- strcpy (vars[i]->name, new_names[i]);
- if (hsh_insert (d->name_tab, vars[i]) != NULL)
+ assert (strlen (new_names[i]) <= LONG_NAME_LEN );
+ strcpy (vars[i]->name, make_short_name(d, new_names[i]));
+
+
+ key.longname = vars[i]->longname;
+ nte = hsh_find (d->long_name_tab, &key);
+
+ free( nte->longname ) ;
+ nte->longname = strdup ( new_names[i]);
+ vars[i]->longname = nte->longname;
+
+ if (hsh_insert (d->name_tab, vars[i]) != NULL )
{
size_t fail_idx = i;
if (err_name != NULL)
{
strcpy (vars[i]->name, old_names[i]);
hsh_force_insert (d->name_tab, vars[i]);
+
+ key.longname = vars[i]->longname;
+ nte = hsh_find (d->long_name_tab, &key);
+
+ free( nte->longname ) ;
+ nte->longname = strdup ( old_names[i]);
+ vars[i]->longname = nte->longname;
+
}
success = 0;
assert (d != NULL);
assert (name != NULL);
- assert (strlen (name) > 0 && strlen (name) < 9);
+ assert (strlen (name) > 0 && strlen (name) <= SHORT_NAME_LEN );
assert (var != NULL);
assert (cnt > 0);
d->vector = xrealloc (d->vector, (d->vector_cnt + 1) * sizeof *d->vector);
vector = d->vector[d->vector_cnt] = xmalloc (sizeof *vector);
vector->idx = d->vector_cnt++;
- strncpy (vector->name, name, 8);
- vector->name[8] = '\0';
+ strncpy (vector->name, name, SHORT_NAME_LEN);
+ vector->name[SHORT_NAME_LEN] = '\0';
vector->var = xmalloc (cnt * sizeof *var);
memcpy (vector->var, var, cnt * sizeof *var);
vector->cnt = cnt;
d->vector = NULL;
d->vector_cnt = 0;
}
+
+
+static const char * quasi_base27(int i);
+
+
+/* Convert I to quasi base 27
+ The result is a staticly allocated string.
+*/
+static const char *
+quasi_base27(int i)
+{
+ static char result[SHORT_NAME_LEN + 1];
+ static char reverse[SHORT_NAME_LEN + 1];
+
+ /* FIXME: check the result cant overflow these arrays */
+
+ char *s = result ;
+ const int radix = 27;
+ int units;
+
+ /* and here's the quasi-ness of this routine */
+ i = i + ( i / radix );
+
+ strcpy(result,"");
+ do {
+ units = i % radix;
+ *s++ = (units > 0 ) ? units + 'A' - 1 : 'A';
+ i = i / radix;
+ } while (i > 0 ) ;
+ *s = '\0';
+
+ /* Reverse the result */
+ i = strlen(result);
+ s = reverse;
+ while(i >= 0)
+ *s++ = result[--i];
+ *s = '\0';
+
+ return reverse;
+}
+
+
+/* Generate a short name, given a long name.
+ The return value of this function must be freed by the caller.
+*/
+static char *
+make_short_name(struct dictionary *dict, const char *longname)
+{
+ int i = 0;
+ char *p;
+
+
+ char *d = xmalloc ( SHORT_NAME_LEN + 1);
+
+ /* Truncate the name */
+ strncpy(d, longname, SHORT_NAME_LEN);
+ d[SHORT_NAME_LEN] = '\0';
+
+ /* Convert to upper case */
+ for ( p = d; *p ; ++p )
+ *p = toupper(*p);
+
+ /* If a variable with that name already exists, then munge it
+ until there's no conflict */
+ while (0 != hsh_find (dict->name_tab, d))
+ {
+ const char *suffix = quasi_base27(i++);
+
+ d[SHORT_NAME_LEN - strlen(suffix) - 1 ] = '_';
+ d[SHORT_NAME_LEN - strlen(suffix) ] = '\0';
+ strcat(d, suffix);
+ }
+
+ return d;
+}
+
+
+
+
struct variable *dict_create_var (struct dictionary *, const char *,
int width);
+
+struct variable *dict_create_var_from_short (struct dictionary *d,
+ const char *shortname,
+ int width);
+
struct variable *dict_create_var_assert (struct dictionary *, const char *,
int width);
struct variable *dict_clone_var (struct dictionary *, const struct variable *,
- const char *);
+ const char *shortname, const char *longname);
void dict_rename_var (struct dictionary *, struct variable *, const char *);
struct variable *dict_lookup_var (const struct dictionary *, const char *);
const char *name);
void dict_clear_vectors (struct dictionary *);
+void dict_get_varname_block(const struct dictionary *dict, char **buf, int *size);
+
+void dict_add_longvar_entry(struct dictionary *d, const char *name,
+ const char *longname);
+
+
+
+
#endif /* dictionary.h */
dump_postfix = 1;
else if (lex_match ('('))
{
- char name[MAX_VAR_NAME_LEN + 1];
+ char name[LONG_NAME_LEN + 1];
struct variable *v;
size_t old_value_cnt;
int width;
void
fh_done(void)
{
- assert(handle_list);
-
- ll_destroy(handle_list);
- handle_list = 0;
+ if ( handle_list )
+ {
+ ll_destroy(handle_list);
+ handle_list = 0;
+ }
}
/* Limited variable column specifications. */
struct col_spec
{
- char name[9]; /* Variable name. */
+ char name[SHORT_NAME_LEN + 1]; /* Variable name. */
int fc, nc; /* First column (1-based), # of columns. */
int fmt; /* Format type. */
struct variable *v; /* Variable. */
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include <config.h>
+#include "config.h"
#include "error.h"
#include <ctype.h>
#include <errno.h>
#include "misc.h"
#include "settings.h"
#include "str.h"
+#include "val.h"
#include "var.h"
#include "vfm.h"
+
/* List of variable names. */
struct varname
{
struct varname *next;
- char name[9];
+ char name[SHORT_NAME_LEN + 1];
};
/* Represents a FLIP input program. */
/* Add numeric extensions until acceptable. */
{
- int len = (int) strlen (name);
- char n[9];
+ const int len = (int) strlen (name);
+ char n[SHORT_NAME_LEN + 1];
int i;
for (i = 1; i < 10000000; i++)
for (i = 0; i < flip->case_cnt; i++)
{
struct variable *v;
- char s[9];
+ char s[SHORT_NAME_LEN + 1];
sprintf (s, "VAR%03d", i);
v = dict_create_var_assert (default_dict, s, 0);
/* Write variable names as first case. */
for (i = 0; i < flip->var_cnt; i++)
- st_bare_pad_copy (info->output_buf[i].s, flip->var[i]->name, 8);
+ st_bare_pad_copy (info->output_buf[i].s, flip->var[i]->name, MAX_SHORT_STRING);
if (fwrite (info->output_buf, sizeof *info->output_buf,
flip->var_cnt, flip->file) != (size_t) flip->var_cnt)
msg (FE, _("Error writing FLIP file: %s."), strerror (errno));
{
char name[INT_DIGITS + 2];
sprintf (name, "V%d", (int) f);
- strncpy (v->name, name, 8);
- name[8] = 0;
+ strncpy (v->name, name, SHORT_NAME_LEN);
+ name[SHORT_NAME_LEN] = 0;
}
}
else
{
- int width = min (flip->new_names->width, 8);
+ int width = min (flip->new_names->width, MAX_SHORT_STRING);
memcpy (v->name, case_str (c, flip->idx_to_fv[flip->new_names->index]),
width);
v->name[width] = 0;
int d; /* Number of implied decimal places. */
};
+
+enum alignment
+ {
+ ALIGN_LEFT = 0,
+ ALIGN_RIGHT = 1,
+ ALIGN_CENTRE = 2
+ };
+
+
+enum measure
+ {
+ MEASURE_NOMINAL=1,
+ MEASURE_ORDINAL=2,
+ MEASURE_SCALE=3
+ };
+
+
+
/* Descriptions of all the display formats above. */
extern struct fmt_desc formats[];
static struct save_trns *
cmd_save_internal (void)
{
- struct file_handle *fh;
+ struct file_handle *fh = NULL;
struct dictionary *dict = NULL;
struct save_trns *t = NULL;
int compress = get_scompression ();
+ const int default_version = 3;
+ int version = default_version;
+ short no_name_table = 0;
t = xmalloc (sizeof *t);
t->h.proc = save_trns_proc;
t->map = NULL;
case_nullify (&t->bounce);
- lex_match ('/');
- if (lex_match_id ("OUTFILE"))
- lex_match ('=');
- fh = fh_parse ();
- if (fh == NULL)
- goto error;
+
+ /* Read most of the subcommands. */
+ for (;;)
+ {
+ if (lex_match_id ("VERSION"))
+ {
+ lex_match ('=');
+ if ( lex_force_num() )
+ {
+ lex_get();
+ version = tokval;
+
+ if ( 0 == strncasecmp (tokid,"x", 1) )
+ {
+ lex_get();
+ no_name_table = 1;
+ }
+
+ }
+ }
+ else if (lex_match_id ("OUTFILE"))
+ {
+ lex_match ('=');
+
+ fh = fh_parse ();
+ if (fh == NULL)
+ goto error;
+
+ }
+ if ( ! lex_match('/') )
+ break;
+
+ }
+
+ if (token != '.')
+ {
+ lex_error (_("expecting end of command"));
+ goto error;
+ }
+
+ if ( fh == NULL )
+ {
+ msg ( ME, _("The required %s subcommand was not present"), "OUTFILE");
+ goto error;
+ }
+
+ if ( version != default_version )
+ {
+ msg (MW, _("Unsupported sysfile version: %d. Using version %d instead."),
+ version, default_version);
+
+ version = default_version;
+ }
dict = dict_clone (default_dict);
start_case_map (dict);
if (t->map != NULL)
case_create (&t->bounce, dict_get_next_value_idx (dict));
- t->writer = sfm_open_writer (fh, dict, compress);
+ t->writer = sfm_open_writer (fh, dict, compress, no_name_table);
if (t->writer == NULL)
goto error;
if (!lex_force_match ('=')
|| !lex_force_id ())
return 0;
- if (!strncmp (tokid, v->name, 8))
+ if (!strncmp (tokid, v->name, SHORT_NAME_LEN))
return 1;
if (dict_lookup_var (dict, tokid) != NULL)
{
struct file_handle *handle; /* File handle. */
struct sfm_reader *reader; /* System file reader. */
struct dictionary *dict; /* Dictionary from system file. */
- char in[9]; /* Name of the variable from IN=. */
- char first[9], last[9]; /* Name of the variables from FIRST=, LAST=. */
+ char in[SHORT_NAME_LEN + 1]; /* Name of the variable from IN=. */
+ char first[SHORT_NAME_LEN + 1];
+ char last[SHORT_NAME_LEN + 1]; /* Name of the variables from FIRST=, LAST=. */
struct ccase input; /* Input record. */
};
mv->label = xstrdup (dv->label);
if (!mv)
{
- mv = dict_clone_var (m, dv, dv->name);
+ mv = dict_clone_var (m, dv, dv->name, dv->longname);
assert (mv != NULL);
}
else if (mv->width != dv->width)
double tokval;
/* T_ID: the identifier. */
-char tokid[9];
+char tokid[LONG_NAME_LEN + 1];
/* T_ID, T_STRING: token string value.
- For T_ID, this is not truncated to 8 characters as is tokid. */
+ For T_ID, this is not truncated to SHORT_NAME_LEN characters as is tokid. */
struct string tokstr;
\f
/* Static variables. */
assert (put_token != 0);
token = put_token;
ds_replace (&tokstr, ds_c_str (&put_tokstr));
- strncpy (tokid, ds_c_str (&put_tokstr), 8);
- tokid[8] = 0;
+ strncpy (tokid, ds_c_str (&put_tokstr), SHORT_NAME_LEN);
+ tokid[SHORT_NAME_LEN] = 0;
tokval = put_tokval;
put_token = 0;
}
void
lex_get (void)
{
+ int i;
+
/* If a token was pushed ahead, return it. */
if (put_token)
{
}
/* Copy id to tokstr. */
- ds_putc (&tokstr, toupper ((unsigned char) *prog++));
+ ds_putc (&tokstr, *prog++);
while (CHAR_IS_IDN (*prog))
- ds_putc (&tokstr, toupper ((unsigned char) *prog++));
+ ds_putc (&tokstr, *prog++);
+
+ /* Copy tokstr to tokid, truncating it to LONG_NAME_LEN characters.*/
+ strncpy (tokid, ds_c_str (&tokstr), LONG_NAME_LEN);
+ tokid[LONG_NAME_LEN] = 0;
- /* Copy tokstr to tokid, truncating it to 8 characters. */
- strncpy (tokid, ds_c_str (&tokstr), 8);
- tokid[8] = 0;
+ /* Convert to upper case */
+ for ( i = 0 ; i < ds_length(&tokstr) ; ++i )
+ tokstr.string[i] = toupper(tokstr.string[i]);
token = lex_id_to_token (ds_c_str (&tokstr), ds_length (&tokstr));
break;
save_token ();
token = T_ID;
ds_replace (&tokstr, id);
- strncpy (tokid, ds_c_str (&tokstr), 8);
- tokid[8] = 0;
+ strncpy (tokid, ds_c_str (&tokstr), SHORT_NAME_LEN);
+ tokid[SHORT_NAME_LEN] = 0;
}
\f
/* Weird line processing functions. */
#if !lexer_h
#define lexer_h 1
+#include "var.h"
#include <ctype.h>
#include "bool.h"
T_N_KEYWORDS = T_LAST_KEYWORD - T_FIRST_KEYWORD + 1
};
-
extern int token;
extern double tokval;
-extern char tokid[9];
+extern char tokid[LONG_NAME_LEN + 1];
extern struct string tokstr;
#include <stddef.h>
internal_cmd_loop (void)
{
/* Name of indexing variable if applicable. */
- char name[9];
+ char name[SHORT_NAME_LEN + 1];
/* Create and initialize transformations to facilitate
error-handling. */
struct var_renaming
{
struct variable *var;
- char new_name[9];
+ char new_name[SHORT_NAME_LEN + 1];
};
/* A algo_compare_func that compares new_name members in struct
if (match (r, '6'))
{
weight_name = read_pool_string (r);
- if (strlen (weight_name) > 8)
+ if (strlen (weight_name) > SHORT_NAME_LEN)
error (r, _("Weight variable name (%s) truncated."), weight_name);
}
read_string (r, name);
for (j = 0; j < 6; j++)
fmt[j] = read_int (r);
+#if 0
+ /* Weirdly enough, there is no # character in the SPSS portable
+ character set, so we can't check for it. */
+ if (strlen (name) > SHORT_NAME_LEN)
+ lose ((r, _("position %d: Variable name has %u characters."),
+ i, strlen (name)));
+ if ((name[0] < 74 /* A */ || name[0] > 125 /* Z */)
+ && name[0] != 152 /* @ */)
+ lose ((r, _("position %d: Variable name begins with invalid "
+ "character."), i));
+ if (name[0] >= 100 /* a */ && name[0] <= 125 /* z */)
+ {
+ corrupt_msg (r, _("position %d: Variable name begins with "
+ "lowercase letter %c."),
+ i, name[0] - 100 + 'a');
+ name[0] -= 26 /* a - A */;
+ }
+ /* Verify remaining characters of variable name. */
+ for (j = 1; j < (int) strlen (name); j++)
+ {
+ int c = name[j];
+#endif
if (!var_is_valid_name (name, false) || *name == '#')
error (r, _("position %d: Invalid variable name `%s'."), name);
st_uppercase (name);
va_list ap;
char buf[100];
- assert(chart);
+ if ( ! chart )
+ return ;
pl_savestate_r(chart->lp);
pl_ffontsize_r(chart->lp,chart->font_size * 1.5);
chart_rounded_tick( (smax - smin) / (double) ticks);
- assert (ch) ;
-
+ if ( !ch )
+ return;
ch->y_max = ceil ( smax / tick_interval ) * tick_interval ;
ch->y_min = floor ( smin / tick_interval ) * tick_interval ;
histogram_write_legend(struct chart *ch, const struct normal_curve *norm)
{
char buf[100];
+ if ( !ch )
+ return ;
+
pl_savestate_r(ch->lp);
sprintf(buf,"N = %.2f",norm->N);
double lower;
double height;
+ if ( !ch )
+ return ;
const size_t bins = gsl_histogram_bins(hist);
const double x_pos = (ch->data_right - ch->data_left) * bar / (double) bins ;
const double width = (ch->data_right - ch->data_left) / (double) bins ;
struct variable *src; /* Source variable. */
struct variable *dest; /* Destination variable. */
- char dest_name[9]; /* Name of dest variable if we're creating it. */
+ char dest_name[SHORT_NAME_LEN + 1]; /* Name of dest variable if we're creating it. */
int has_sysmis; /* Do we recode for SYSMIS? */
union value sysmis; /* Coding for SYSMIS (if src is numeric). */
struct repeat_entry
{
int type; /* 1=variable names, 0=any other. */
- char id[9]; /* Macro identifier. */
+ char id[SHORT_NAME_LEN + 1]; /* Macro identifier. */
char **replacement; /* Macro replacement. */
struct repeat_entry *next;
};
internal_cmd_do_repeat (void)
{
/* Name of first DO REPEAT macro. */
- char first_name[9];
+ char first_name[SHORT_NAME_LEN + 1];
/* Current filename. */
const char *current_filename = NULL;
/* Collect an identifier. */
{
- char name[9];
+ char name[SHORT_NAME_LEN + 1];
char *start = cp;
char *np = name;
char *substitution;
- while (CHAR_IS_IDN (*cp) && np < &name[8])
+ while (CHAR_IS_IDN (*cp) && np < &name[SHORT_NAME_LEN])
*np++ = *cp++;
while (CHAR_IS_IDN (*cp))
cp++;
break;
case 5:
- case 6:
- case 11: /* ?? Used by SPSS 8.0. */
+ case 6: /* ?? Used by SPSS 8.0. */
skip = 1;
break;
+
+ case 11: /* Variable display parameters */
+ {
+ const int n_vars = data.count / 3 ;
+ int i;
+ if ( data.count % 3 )
+ {
+ msg (MW, _("%s: Invalid subrecord length. "
+ "Record: 7; Subrecord: 11"),
+ handle_get_filename (r->fh));
+ skip = 1;
+ }
+
+ for ( i = 0 ; i < n_vars ; ++i )
+ {
+ struct
+ {
+ int32 measure P;
+ int32 width P;
+ int32 align P;
+ }
+ params;
+
+ struct variable *v;
+
+ assertive_buf_read (r, ¶ms, sizeof(params), 0);
+
+ v = dict_get_var(*dict, i);
+
+ v->measure = params.measure;
+ v->display_width = params.width;
+ v->alignment = params.align;
+ }
+ }
+ break;
+
+ case 13: /* SPSS 12.0 Long variable name map */
+ {
+
+ char *s;
+ char *buf = xmalloc(data.size * data.count + 1);
+ char *tbuf ;
+ assertive_buf_read (r, buf, data.size * data.count, 0);
+ buf[data.size * data.count]='\0';
+
+ s = strtok_r(buf, "\t", &tbuf);
+ while ( s )
+ {
+ char *shortname, *longname;
+ shortname = strsep(&s,"=");
+ longname = strsep(&s,"=");
+
+ dict_add_longvar_entry(*dict, shortname, longname);
+
+ s = strtok_r(0,"\t", &tbuf);
+ }
+
+ free (buf);
+ }
+ break;
default:
msg (MW, _("%s: Unrecognized record type 7, subtype %d "
int next_value = 0; /* Index to next `value' structure. */
size_t var_cap = 0;
+ assert(r);
+
/* Allocate variables. */
*var_by_idx = xmalloc (sizeof **var_by_idx * r->value_cnt);
name[0] = toupper ((unsigned char) (sv.name[0]));
/* Copy remaining characters of variable name. */
- for (j = 1; j < 8; j++)
+ for (j = 1; j < SHORT_NAME_LEN; j++)
{
int c = (unsigned char) sv.name[j];
name[j] = 0;
/* Create variable. */
- vv = (*var_by_idx)[i] = dict_create_var (dict, name, sv.type);
+ vv = (*var_by_idx)[i] = dict_create_var_from_short (dict, name, sv.type);
if (vv == NULL)
lose ((ME, _("%s: Duplicate variable name `%s' within system file."),
handle_get_filename (r->fh), name));
"length %d."),
handle_get_filename (r->fh), vv->name, len));
- /* Read label into variable structure. */
- vv->label = buf_read (r, NULL, ROUND_UP (len, sizeof (int32)), len + 1);
- if (vv->label == NULL)
- goto error;
- vv->label[len] = '\0';
+ if ( len != 0 )
+ {
+ /* Read label into variable structure. */
+ vv->label = buf_read (r, NULL, ROUND_UP (len, sizeof (int32)), len + 1);
+ if (vv->label == NULL)
+ goto error;
+ vv->label[len] = '\0';
+ }
}
/* Set missing values. */
static void *
buf_read (struct sfm_reader *r, void *buf, size_t byte_cnt, size_t min_alloc)
{
- if (buf == NULL)
+ assert (r);
+
+ if (buf == NULL && byte_cnt > 0 )
buf = xmalloc (max (byte_cnt, min_alloc));
+
+ if ( byte_cnt == 0 )
+ return buf;
+
+
if (1 != fread (buf, byte_cnt, 1, r->file))
{
if (ferror (r->file))
static int write_value_labels (struct sfm_writer *,
struct variable *, int idx);
static int write_rec_7_34 (struct sfm_writer *);
+
+static int write_longvar_table (struct sfm_writer *w,
+ const struct dictionary *dict);
+
+static int write_variable_display_parameters (struct sfm_writer *w,
+ const struct dictionary *dict);
+
+
static int write_documents (struct sfm_writer *, const struct dictionary *);
static int does_dict_need_translation (const struct dictionary *);
/* Opens the system file designated by file handle FH for writing
cases from dictionary D. If COMPRESS is nonzero, the
- system file will be compressed.
+ system file will be compressed. If OMIT_LONGNAMES is nonzero, the
+ long name table will be omitted.
No reference to D is retained, so it may be modified or
destroyed at will after this function returns. */
struct sfm_writer *
sfm_open_writer (struct file_handle *fh,
- const struct dictionary *d, int compress)
+ const struct dictionary *d, int compress,
+ short omit_longnames)
{
struct sfm_writer *w = NULL;
int idx;
if (dict_get_documents (d) != NULL && !write_documents (w, d))
goto error;
+
if (!write_rec_7_34 (w))
goto error;
+
+ /* Write variable display info. */
+ if ( !write_variable_display_parameters(w, d))
+ goto error;
+
+
+ if ( ! omit_longnames )
+ {
+ if (!write_longvar_table (w, d))
+ goto error;
+ }
+
/* Write record 999. */
{
struct
write_format_spec (&v->print, &sv.print);
write_format_spec (&v->write, &sv.write);
memcpy (sv.name, v->name, strlen (v->name));
- memset (&sv.name[strlen (v->name)], ' ', 8 - strlen (v->name));
+ memset (&sv.name[strlen (v->name)], ' ', SHORT_NAME_LEN - strlen (v->name));
if (!buf_write (w, &sv, sizeof sv))
return 0;
return 1;
}
+/* Write the alignment, width and scale values */
+static int
+write_variable_display_parameters (struct sfm_writer *w,
+ const struct dictionary *dict)
+{
+ int i;
+
+ struct
+ {
+ int32 rec_type P;
+ int32 subtype P;
+ int32 elem_size P;
+ int32 n_elem P;
+ } vdp_hdr;
+
+ vdp_hdr.rec_type = 7;
+ vdp_hdr.subtype = 11;
+ vdp_hdr.elem_size = 4;
+ vdp_hdr.n_elem = w->var_cnt * 3;
+
+ if (!buf_write (w, &vdp_hdr, sizeof vdp_hdr))
+ return 0;
+
+ for ( i = 0 ; i < w->var_cnt ; ++i )
+ {
+ struct variable *v;
+ struct
+ {
+ int32 measure P;
+ int32 width P;
+ int32 align P;
+ }
+ params;
+
+ v = dict_get_var(dict, i);
+
+ params.measure = v->measure;
+ params.width = v->display_width;
+ params.align = v->alignment;
+
+ if (!buf_write (w, ¶ms, sizeof(params)))
+ return 0;
+ }
+
+ return 1;
+}
+
+/* Writes the long variable name table */
+static int
+write_longvar_table (struct sfm_writer *w, const struct dictionary *dict)
+{
+ char *buf = 0;
+ int bufsize = 0;
+
+ struct
+ {
+ int32 rec_type P;
+ int32 subtype P;
+ int32 elem_size P;
+ int32 n_elem P;
+ } lv_hdr;
+
+ lv_hdr.rec_type = 7;
+ lv_hdr.subtype = 13;
+ lv_hdr.elem_size = 1;
+
+
+ dict_get_varname_block(dict, &buf, &bufsize);
+
+ if ( bufsize == 0 )
+ return 1;
+
+ lv_hdr.n_elem = bufsize ;
+
+ if (!buf_write (w, &lv_hdr, sizeof(lv_hdr) ))
+ goto error;
+
+ if (!buf_write (w, buf, bufsize))
+ goto error;
+
+ return 1;
+
+ error:
+ free ( buf ) ;
+ return 0;
+}
+
/* Writes record type 7, subtypes 3 and 4. */
static int
write_rec_7_34 (struct sfm_writer *w)
struct dictionary;
struct ccase;
struct sfm_writer *sfm_open_writer (struct file_handle *,
- const struct dictionary *, int compress);
+ const struct dictionary *,
+ int compress, short omit_longnames);
+
int sfm_write_case (struct sfm_writer *, struct ccase *);
void sfm_close_writer (struct sfm_writer *);
int32 n_missing_values P; /* Missing value code of -3,-2,0,1,2, or 3. */
int32 print P; /* Print format. */
int32 write P; /* Write format. */
- char name[8] P; /* Variable name. */
+ char name[SHORT_NAME_LEN] P; /* Variable name. */
/* The rest of the structure varies. */
};
{
struct variable *vp = vars[i];
- if (vp->type == ALPHA && vp->width > 8)
+ if (vp->type == ALPHA && vp->width > MAX_SHORT_STRING)
{
msg (SE, _("It is not possible to assign value labels to long "
"string variables such as %s."), vp->name);
then short string missing values can be truncated in system files
because there's only room for as many characters as can fit in a
flt64. */
-#if MAX_SHORT_STRING > 8
-#error MAX_SHORT_STRING must be less than 8.
+#if MAX_SHORT_STRING > SHORT_NAME_LEN
+#error MAX_SHORT_STRING must be less than or equal to SHORT_NAME_LEN.
#endif
/* Special values. */
--- /dev/null
+/* PSPP - computes sample statistics.
+ Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
+ Written by John Darrington <john@darrington.wattle.id.au>
+
+ 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 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., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "alloc.h"
+#include "command.h"
+#include "error.h"
+#include "lexer.h"
+#include "str.h"
+#include "var.h"
+
+#include "debug-print.h"
+
+/* Set variables' alignment
+ This is the alignment for GUI display only.
+ It affects nothing but GUIs
+*/
+int
+cmd_variable_alignment (void)
+{
+ do
+ {
+ struct variable **v;
+ int nv;
+
+ int i;
+ enum alignment align;
+
+
+ if (!parse_variables (default_dict, &v, &nv, PV_NONE))
+ return CMD_PART_SUCCESS_MAYBE;
+
+ if ( lex_force_match('(') )
+ {
+ if ( lex_match_id("LEFT"))
+ align = ALIGN_LEFT;
+ else if ( lex_match_id("RIGHT"))
+ align = ALIGN_RIGHT;
+ else if ( lex_match_id("CENTER"))
+ align = ALIGN_CENTRE;
+ else
+ return CMD_FAILURE;
+
+ lex_force_match(')');
+ }
+
+ for( i = 0 ; i < nv ; ++i )
+ v[i]->alignment = align;
+
+
+ while (token == '/')
+ lex_get ();
+ free (v);
+
+ }
+ while (token != '.');
+ return CMD_SUCCESS;
+}
+
+/* Set variables' display width.
+ This is the width for GUI display only.
+ It affects nothing but GUIs
+*/
+int
+cmd_variable_width (void)
+{
+ do
+ {
+ struct variable **v;
+ int nv;
+ int i;
+
+ if (!parse_variables (default_dict, &v, &nv, PV_NONE))
+ return CMD_PART_SUCCESS_MAYBE;
+
+ if ( lex_force_match('(') )
+ {
+ if ( lex_force_int())
+ lex_get();
+ else
+ return CMD_FAILURE;
+ lex_force_match(')');
+ }
+
+ for( i = 0 ; i < nv ; ++i )
+ v[i]->display_width = tokval;
+
+ while (token == '/')
+ lex_get ();
+ free (v);
+
+ }
+ while (token != '.');
+ return CMD_SUCCESS;
+}
+
+/* Set variables' measurement level */
+int
+cmd_variable_level (void)
+{
+ do
+ {
+ struct variable **v;
+ int nv;
+ enum measure level;
+ int i;
+
+ if (!parse_variables (default_dict, &v, &nv, PV_NONE))
+ return CMD_PART_SUCCESS_MAYBE;
+
+ if ( lex_force_match('(') )
+ {
+ if ( lex_match_id("SCALE"))
+ level = MEASURE_SCALE;
+ else if ( lex_match_id("ORDINAL"))
+ level = MEASURE_ORDINAL;
+ else if ( lex_match_id("NOMINAL"))
+ level = MEASURE_NOMINAL;
+ else
+ return CMD_FAILURE;
+
+ lex_force_match(')');
+ }
+
+ for( i = 0 ; i < nv ; ++i )
+ v[i]->measure = level ;
+
+
+ while (token == '/')
+ lex_get ();
+ free (v);
+
+ }
+ while (token != '.');
+ return CMD_SUCCESS;
+}
#if !var_h
#define var_h 1
+
#include <stddef.h>
+#include "config.h"
#include "bool.h"
#include "format.h"
#include "val.h"
+
+
/* Script variables. */
/* Variable type. */
MISSING_COUNT
};
-#define MAX_VAR_NAME_LEN 8
/* A variable's dictionary entry. */
struct variable
{
- char name[MAX_VAR_NAME_LEN + 1]; /* As a string. */
+ char name[SHORT_NAME_LEN + 1]; /* As a string. */
+ char *longname; /* Pointer to entry in dictionary's table */
int index; /* Index into its dictionary's var[]. */
int type; /* NUMERIC or ALPHA. */
struct val_labs *val_labs; /* Value labels. */
char *label; /* Variable label. */
+
+ /* GUI display parameters */
+ enum measure measure; /* Nominal ordinal or continuous */
+ int display_width; /* Width of data editor column */
+ enum alignment alignment; /* Alignment of data in gui */
+
/* Per-command info. */
void *aux;
void (*aux_dtor) (struct variable *);
};
+
+/* A tuple containing short names and longnames */
+struct name_table_entry
+{
+ char *longname;
+ char *name;
+};
+
bool var_is_valid_name (const char *, bool issue_error);
int compare_var_names (const void *, const void *, void *);
unsigned hash_var_name (const void *, void *);
+
+
+unsigned hash_long_name (const void *e_, void *aux UNUSED) ;
+int compare_long_names(const void *a_, const void *b_, void *aux);
+
+
int compare_var_ptr_names (const void *, const void *, void *);
unsigned hash_var_ptr_name (const void *, void *);
struct vector
{
int idx; /* Index for dict_get_vector(). */
- char name[9]; /* Name. */
+ char name[SHORT_NAME_LEN + 1]; /* Name. */
struct variable **var; /* Vector of variables. */
int cnt; /* Number of variables. */
};
msg (SE, _("Variable names must be at least 1 character long."));
return false;
}
- else if (length > MAX_VAR_NAME_LEN)
+ else if (length > SHORT_NAME_LEN)
{
if (issue_error)
msg (SE, _("Variable name %s exceeds %d-character limit."),
- (int) MAX_VAR_NAME_LEN);
+ (int) SHORT_NAME_LEN);
return false;
}
assert (var != NULL);
assert (cnt != NULL);
+
vs = var_set_create_from_dict (d);
success = parse_var_set_vars (vs, var, cnt, opts);
if ( success == 0 )
else
included = NULL;
- if (lex_match (T_ALL))
+if (lex_match (T_ALL))
add_variables (v, nv, &mv, included, pv_opts,
vs, 0, var_set_get_cnt (vs) - 1, DC_ORDINARY);
else
first_var->name, last_var->name);
goto fail;
}
-
if (class != last_class)
{
msg (SE, _("When using the TO keyword to specify several "
*names = NULL;
}
- name1 = xmalloc (36);
- name2 = &name1[1 * 9];
- root1 = &name1[2 * 9];
- root2 = &name1[3 * 9];
+ name1 = xmalloc (4 * (SHORT_NAME_LEN + 1));
+ name2 = &name1[1 * SHORT_NAME_LEN + 1];
+ root1 = &name1[2 * SHORT_NAME_LEN + 1];
+ root2 = &name1[3 * SHORT_NAME_LEN + 1];
do
{
if (token != T_ID)
for (n = n1; n <= n2; n++)
{
- (*names)[nvar] = xmalloc (9);
+ (*names)[nvar] = xmalloc (SHORT_NAME_LEN + 1);
sprintf ((*names)[nvar], "%s%0*d", root1, d1, n);
nvar++;
}
{
assert (vs != NULL);
assert (name != NULL);
- assert (strlen (name) < 9);
+ assert (strlen (name) <= LONG_NAME_LEN );
return vs->lookup_var_idx (vs, name);
}
struct variable *const *var;/* Array of variables. */
size_t var_cnt; /* Number of elements in var. */
struct hsh_table *name_tab; /* Hash from variable names to variables. */
+ struct hsh_table *longname_tab; /* Hash of short names indexed by long names */
};
/* Returns the number of variables in VS. */
static int
array_var_set_lookup_var_idx (const struct var_set *vs, const char *name)
{
+ char *short_name ;
struct array_var_set *avs = vs->aux;
struct variable v, *vp, *const *vpp;
- strcpy (v.name, name);
+ struct name_table_entry key;
+ key.longname = name;
+
+ struct name_table_entry *nte;
+
+ assert (avs->longname_tab);
+
+
+ nte = hsh_find (avs->longname_tab, &key);
+
+ if (!nte)
+ return -1;
+
+ short_name = nte->name;
+
+ strcpy (v.name, short_name);
vp = &v;
vpp = hsh_find (avs->name_tab, &vp);
return vpp != NULL ? vpp - avs->var : -1;
struct array_var_set *avs = vs->aux;
hsh_destroy (avs->name_tab);
+ hsh_destroy (avs->longname_tab);
free (avs);
free (vs);
}
avs->var = var;
avs->var_cnt = var_cnt;
avs->name_tab = hsh_create (2 * var_cnt,
- compare_var_ptr_names, hash_var_ptr_name, NULL,
- NULL);
- for (i = 0; i < var_cnt; i++)
- if (hsh_insert (avs->name_tab, (void *) &var[i]) != NULL)
- {
- var_set_destroy (vs);
- return NULL;
- }
+ compare_var_ptr_names, hash_var_ptr_name,
+ NULL, NULL);
+
+ avs->longname_tab = hsh_create (2 * var_cnt,
+ compare_long_names, hash_long_name,
+ NULL, NULL);
+ for (i = 0; i < var_cnt; i++)
+ {
+ struct name_table_entry *nte ;
+
+ if (hsh_insert (avs->name_tab, &var[i]) != NULL)
+ {
+ var_set_destroy (vs);
+ return NULL;
+ }
+
+ nte = xmalloc (sizeof (*nte));
+ nte->name = strdup(var[i]->name);
+ nte->longname = strdup(var[i]->longname);
+
+ if (hsh_insert (avs->longname_tab, nte) != NULL)
+ {
+ var_set_destroy (vs);
+ free (nte);
+ return NULL;
+ }
+
+ }
+
return vs;
}
int ndig;
/* Name of an individual variable to be created. */
- char name[9];
+ char name[SHORT_NAME_LEN + 1];
/* Vector variables. */
struct variable **v;
if (!lex_force_match (')'))
goto fail;
- /* First check that all the generated variable names are 8
+ /* First check that all the generated variable names are SHORT_NAME_LEN
characters or shorter. */
ndig = intlog10 (nv);
for (cp = vecnames; *cp;)
{
int len = strlen (cp);
- if (len + ndig > 8)
+ if (len + ndig > SHORT_NAME_LEN)
{
msg (SE, _("%s%d is too long for a variable name."), cp, nv);
goto fail;
command/lag.sh \
command/list.sh \
command/loop.sh \
+ command/longvars.sh \
command/oneway.sh \
command/oneway-missing.sh \
command/oneway-with-splits.sh \
command/permissions.sh \
command/print.sh \
+ command/rename.sh \
command/sample.sh \
command/sort.sh \
+ command/sysfiles.sh \
+ command/sysfiles-old.sh \
command/split-file.sh \
command/t-test-1-indep-val.sh \
command/t-test-1-sample-missing-anal.sh \
bugs/val-labs-trailing-slash.sh \
bugs/recode-copy-bug.sh \
bugs/computebug.sh \
+ bugs/compute-lv.sh \
bugs/temp-freq.sh \
xforms/casefile.sh \
stats/descript-basic.sh \
--- /dev/null
+#!/bin/sh
+
+# This program tests for a bug involving COMPUTE and long variable names
+
+TEMPDIR=/tmp/pspp-tst-$$
+TESTFILE=$TEMPDIR/`basename $0`.sps
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+
+cleanup()
+{
+ rm -rf $TEMPDIR
+}
+
+
+fail()
+{
+ echo $activity
+ echo FAILED
+ cleanup;
+ exit 1;
+}
+
+
+no_result()
+{
+ echo $activity
+ echo NO RESULT;
+ cleanup;
+ exit 2;
+}
+
+pass()
+{
+ cleanup;
+ exit 0;
+}
+
+mkdir -p $TEMPDIR
+
+cd $TEMPDIR
+
+activity="Create prog"
+cat > $TESTFILE <<EOF
+DATA LIST LIST /longVariablename * x *.
+BEGIN DATA.
+1 2
+3 4
+END DATA.
+
+
+COMPUTE longvariableName=100-longvariablename.
+
+LIST.
+
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+
+activity="run prog"
+$SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
+if [ $? -ne 0 ] ; then fail ; fi
+
+
+activity="compare output"
+diff -B -b pspp.list - << EOF
+1.1 DATA LIST. Reading free-form data from the command file.
++--------+------+
+|Variable|Format|
+#========#======#
+|LONGVARI|F8.0 |
+|X |F8.0 |
++--------+------+
+
+LONGVARI X
+-------- --------
+ 99.00 2.00
+ 97.00 4.00
+EOF
+if [ $? -ne 0 ] ; then fail ; fi
+
+
+pass;
#!/bin/sh
# This program tests for a bug which caused
-# the second procedure after GET FILE to corrupt it's output
+# the second procedure after GET FILE to corrupt its output
TEMPDIR=/tmp/pspp-tst-$$
cd $TEMPDIR
activity="create program"
-cat > $TEMPDIR/prog.sps <<EOF
+cat > $TESTFILE <<EOF
DATA LIST LIST NOTABLE /location * editor * shell * freq * .
BEGIN DATA.
1.00 1.00 1.0 2.00
EOF
if [ $? -ne 0 ] ; then no_result ; fi
+
activity="run program"
-$SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
+$SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE
if [ $? -ne 0 ] ; then no_result ; fi
+
+
activity="compare output"
diff -b -B -w $TEMPDIR/pspp.list - << EOF
LOCATION EDITOR SHELL FREQ
cd $TEMPDIR
activity="create program"
-cat > $TEMPDIR/file-lab.stat << EOF
-
+cat > $TESTFILE << EOF
/* Set up a dummy active file in memory.
data list /x 1 y 2.
display file label. /* undocumented feature of PSPP
/* Save the active file then get it and display the documents again.
-save 'foo.save'.
-get 'foo.save'.
+save /OUTFILE='foo.save'.
+get /FILE='foo.save'.
display documents.
display file label. /* undocumented feature of PSPP
display documents.
/* Save and get.
-save 'foo.save'.
-get 'foo.save'.
+save /OUTFILE='foo.save'.
+get /FILE='foo.save'.
display documents.
display file label. /* undocumented feature of PSPP
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program"
-$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TEMPDIR/file-lab.stat
+$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
if [ $? -ne 0 ] ; then no_result ; fi
# We need to filter out the dates/times
cd $TEMPDIR
activity="create program"
-cat > $TEMPDIR/filter.stat << EOF
+cat > $TESTFILE << EOF
data list notable /x 1-2.
begin data.
1
activity="run program"
-$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TEMPDIR/filter.stat
+$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
if [ $? -ne 0 ] ; then no_result ; fi
activity="create program"
-cat > $TEMPDIR/list.stat << foobar
+cat > $TESTFILE << EOF
*** Single lines.
data list file='$top_srcdir/tests/weighting.data'/AVAR 1-5 BVAR 6-10.
weight by BVAR.
list /format numbered weight.
*** Multiple lines.
-data list file='$top_srcdir/tests/list.data' notable /X000 to X126 1-127.
+data list file='$top_srcdir/tests/list.data' notable /x000 to x126 1-127.
*list /cases=from 1 to 25 by 5 /format numbered.
list x000 to x030.
list /cases=from 1 to 25.
-foobar
+EOF
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program"
-$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TEMPDIR/list.stat
+$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
if [ $? -ne 0 ] ; then no_result ; fi
activity="create prog"
cat > $TEMPDIR/loop.stat <<EOF
-data list /x 1 y 2 z 3.
+data list /x 1 y 2 zoological 3.
begin data.
125
256
397
401
end data.
-loop i=y to z by abs(z-y)/(z-y).
-print /x i.
+loop iterative_Variable=y to zoological by abs(zoological-y)/(zoological-y).
+print /x iterative_Variable.
break. /* Generates warning.
end loop.
execute.
#========#======#=======#======#
|X | 1| 1- 1|F1.0 |
|Y | 1| 2- 2|F1.0 |
-|Z | 1| 3- 3|F1.0 |
+|ZOOLOGIC| 1| 3- 3|F1.0 |
+--------+------+-------+------+
1 2.00
2 5.00
ONEWAY
quality BY brand
/STATISTICS descriptives homogeneity
- /CONTRASTS = -2 2
- /CONTRASTS = -1 1
+ /CONTRAST = -2 2
+ /CONTRAST = -1 1
.
EOF
if [ $? -ne 0 ] ; then no_result ; fi
ONEWAY
quality BY brand
/STATISTICS descriptives homogeneity
- /CONTRASTS = -2 1 1
- /CONTRASTS = 0 -1 1
+ /CONTRAST = -2 1 1
+ /CONTRAST = 0 -1 1
.
EOF
if [ $? -ne 0 ] ; then no_result ; fi
cleanup()
{
+ if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then return ; fi
rm -rf $TEMPDIR
}
weight by BVAR.
descriptives AVAR /statistics all /format serial.
-frequencies AVAR /statistics all /format condensed.
+frequencies AVAR /statistics all /format condense.
EOF
if [ $? -ne 0 ] ; then no_result ; fi
--- /dev/null
+#!/bin/sh
+
+# This little script can be used in conjunction with gcov to see how well
+# the regression test suite is covering the PSPP code.
+#
+# To use it:
+#
+# make distclean
+# export CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
+# ./configure
+# make check
+# tests/coverage.sh
+
+export TEMPDIR=/tmp/pspp-cov-$$
+
+mkdir -p $TEMPDIR
+
+files=`find src -name '*.c'`
+
+export summary_file="$TEMPDIR/coverage.txt"
+
+rm -f $summary_file
+
+for f in $files ; do
+ dir=`dirname $f`
+ gcov -p -l -n -o $dir $f | grep -v '^Creat' >> $summary_file
+done
+
+cat > "$TEMPDIR/cov.sps" << EOF
+DATA LIST FREE FILE='$summary_file' /COVERAGE (PCT8) d1 (a2) lines * d2 (a10) d3 (a10) d4 (a10) d5 (a10) file (a25).
+
+
+AGGREGATE OUTFILE=*
+ /BREAK=file
+ /COVERAGE=MIN(COVERAGE).
+
+SORT CASES BY COVERAGE.
+
+LIST /COVERAGE file.
+
+FREQUENCIES /COVERAGE
+ /HISTOGRAM
+ /PERCENTILES=25,50,75,90.
+
+EOF
+
+src/pspp -o html $TEMPDIR/cov.sps
+
+rm -rf $TEMPDIR
cleanup()
{
+ if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
+ echo NOT removing directory $TEMPDIR
+ return ;
+ fi
rm -rf $TEMPDIR
- :
}