1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
17 AT_BANNER([system file reader - positive])
19 AT_SETUP([variable labels and missing values])
20 AT_KEYWORDS([sack synthetic system file positive])
21 AT_DATA([sys-file.sack], [dnl
23 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
25 28; dnl Nominal case size
30 "01 Jan 11"; "20:53:52";
31 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
34 dnl Numeric variable, no label or missing values.
35 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
37 dnl Numeric variable, variable label.
38 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
39 32; "Numeric variable 2's label ("; i8 249; i8 250; i8 251; ")";
41 dnl Numeric variable, one missing value.
42 2; 0; 0; 1; 0x050800 *2; s8 "NUM3";
45 dnl Numeric variable, variable label and missing value.
46 2; 0; 1; 1; 0x050800 *2; s8 "NUM4";
47 30; "Another numeric variable label"; i8 0 * 2;
50 dnl Numeric variable, two missing values.
51 2; 0; 0; 2; 0x050800 *2; s8 "NUM5"; 1.0; 2.0;
53 dnl Numeric variable, three missing values.
54 2; 0; 0; 3; 0x050800 *2; s8 "NUM6"; 1.0; 2.0; 3.0;
56 dnl Numeric variable, range of missing values.
57 2; 0; 0; -2; 0x050800 *2; s8 "NUM7"; 1.0; 3.0;
59 dnl Numeric variables, range of missing values plus discrete value.
60 2; 0; 0; -3; 0x050800 *2; s8 "NUM8"; 1.0; 3.0; 5.0;
61 2; 0; 0; -3; 0x050800 *2; s8 "NUM9"; 1.0; HIGHEST; -5.0;
62 2; 0; 0; -3; 0x050800 *2; "NUM"; i8 192; i8 200; i8 204; i8 209; i8 210;
65 dnl String variable, no label or missing values.
66 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
68 dnl String variable, variable label.
69 2; 4; 1; 0; 0x010400 *2; s8 "STR2";
70 25; "String variable 2's label"; i8 0 * 3;
72 dnl String variable, one missing value.
73 2; 4; 0; 1; 0x010400 *2; s8 "STR3"; s8 "MISS";
75 dnl String variable, variable label and missing value.
76 2; 4; 1; 1; 0x010400 *2; s8 "STR4";
77 29; "Another string variable label"; i8 0 * 3;
80 dnl String variable, two missing values.
81 2; 4; 0; 2; 0x010400 *2; s8 "STR5"; s8 "MISS"; s8 "OTHR";
83 dnl String variable, three missing values.
84 2; 4; 0; 3; 0x010400 *2; s8 "STR6"; s8 "MISS"; s8 "OTHR"; s8 "MORE";
86 dnl Long string variable, one missing value.
87 dnl (This is not how SPSS represents missing values for long strings--it
88 dnl uses a separate record as shown later below--but old versions of PSPP
89 dnl did use this representation so we continue supporting it for backward
91 2; 11; 0; 1; 0x010b00 *2; s8 "STR7"; "first8by";
92 2; -1; 0; 0; 0; 0; s8 "";
94 dnl Long string variables that will have missing values added with a
96 2; 9; 0; 0; 0x010900 *2; s8 "STR8";
97 2; -1; 0; 0; 0; 0; s8 "";
98 2; 10; 0; 0; 0x010a00 *2; s8 "STR9";
99 2; -1; 0; 0; 0; 0; s8 "";
100 2; 11; 0; 0; 0x010b00 *2; s8 "STR10";
101 2; -1; 0; 0; 0; 0; s8 "";
103 dnl Long string variable, value label.
104 2; 25; 1; 0; 0x011900 *2; s8 "STR11"; 14; "25-byte string"; i8 0 * 2;
105 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
106 dnl Variable label fields on continuation records have been spotted in system
107 dnl files created by "SPSS Power Macintosh Release 6.1".
108 2; -1; 1; 0; 0; 0; s8 ""; 20; "dummy variable label";
110 dnl Machine integer info record.
111 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
113 dnl Machine floating-point info record.
114 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
116 dnl Long string variable missing values record.
118 dnl One missing value for STR8.
119 COUNT("STR8"); i8 1; 8; "abcdefgh";
121 dnl Two missing values for STR9.
122 COUNT("STR9"); i8 2; 8; "abcdefgh"; 8; "01234567";
124 dnl Three missing values for STR9.
125 COUNT("STR10"); i8 3; 8; "abcdefgh"; 8; "01234567"; 8; "0 ";
128 dnl Character encoding record.
129 7; 20; 1; 12; "windows-1252";
131 dnl Dictionary termination record.
135 1.0; 2.0; 3.0; 4.0; 5.0; 6.0; 7.0; 8.0; 9.0; 10.0;
136 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
137 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
138 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
140 for variant in be le; do
141 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
142 AT_DATA([sys-file.sps], [dnl
143 GET FILE='sys-file.sav'.
148 AT_CHECK([pspp -o pspp.csv sys-file.sps])
149 AT_CHECK([cat pspp.csv], [0], [dnl
150 File label: PSPP synthetic test file: ôõöø
152 Variable,Description,Position
154 num2,"Label: Numeric variable 2's label (ùúû)
158 num4,"Label: Another numeric variable label
162 Missing Values: 1; 2",5
164 Missing Values: 1; 2; 3",6
166 Missing Values: 1 THRU 3",7
168 Missing Values: 1 THRU 3; 5",8
170 Missing Values: 1 THRU HIGHEST; -5",9
171 numàèìñò,"Format: F8.0
172 Missing Values: LOWEST THRU 1; 5",10
174 str2,"Label: String variable 2's label
177 Missing Values: ""MISS""",13
178 str4,"Label: Another string variable label
180 Missing Values: ""OTHR""",14
182 Missing Values: ""MISS""; ""OTHR""",15
184 Missing Values: ""MISS""; ""OTHR""; ""MORE""",16
186 Missing Values: ""first8by""",17
188 Missing Values: ""abcdefgh""",18
190 Missing Values: ""abcdefgh""; ""01234567""",19
192 Missing Values: ""abcdefgh""; ""01234567""; ""0 """,20
193 str11,"Label: 25-byte string
197 num1,num2,num3,num4,num5,num6,num7,num8,num9,numàèìñò,str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11
198 1,2,3,4,5,6,7,8,9,10,abcd,efgh,ijkl,mnop,qrst,uvwx,yzABCDEFGHI,JKLMNOPQR,STUVWXYZ01,23456789abc,defghijklmnopqstuvwxyzABC
203 AT_SETUP([unspecified number of variable positions])
204 AT_KEYWORDS([sack synthetic system file positive])
205 AT_DATA([sys-file.sack], [dnl
207 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
209 -1; dnl Nominal case size (unspecified)
210 0; dnl Not compressed
214 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
217 dnl Numeric variable, no label or missing values.
218 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
220 dnl Numeric variable, variable label.
221 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
222 26; "Numeric variable 2's label"; i8 0 *2;
224 dnl Character encoding record.
225 7; 20; 1; 12; "windows-1252";
227 dnl Dictionary termination record.
233 for variant in be le; do
234 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
235 AT_DATA([sys-file.sps], [dnl
236 GET FILE='sys-file.sav'.
240 AT_CHECK([pspp -o pspp.csv sys-file.sps])
241 AT_CHECK([cat pspp.csv], [0], [dnl
242 Variable,Description,Position
244 num2,"Label: Numeric variable 2's label
254 AT_SETUP([wrong number of variable positions but version 13])
255 AT_KEYWORDS([sack synthetic system file positive])
256 AT_DATA([sys-file.sack], [dnl
258 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
260 -1; dnl Nominal case size (unspecified)
261 0; dnl Not compressed
265 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
268 dnl Numeric variable, no label or missing values.
269 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
271 dnl Numeric variable, variable label.
272 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
273 26; "Numeric variable 2's label"; i8 0 *2;
275 dnl Machine integer info record (SPSS 13).
276 7; 3; 4; 8; 13; 2; 3; -1; 1; 1; ENDIAN; 1252;
278 dnl Character encoding record.
279 7; 20; 1; 12; "windows-1252";
281 dnl Dictionary termination record.
287 for variant in be le; do
288 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
289 AT_DATA([sys-file.sps], [dnl
290 GET FILE='sys-file.sav'.
294 AT_CHECK([pspp -o pspp.csv sys-file.sps])
295 AT_CHECK([cat pspp.csv], [0], [dnl
296 Variable,Description,Position
298 num2,"Label: Numeric variable 2's label
308 AT_SETUP([value labels])
309 AT_KEYWORDS([sack synthetic system file positive])
310 AT_DATA([sys-file.sack], [dnl
312 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
314 22; dnl Nominal case size
315 0; dnl Not compressed
319 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
322 dnl Numeric variables.
323 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
324 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
325 2; 0; 0; 0; 0x050800 *2; s8 "NUM3";
326 2; 0; 0; 0; 0x050800 *2; s8 "NUM4";
327 2; 0; 0; 0; 0x050800 *2; s8 "NUM5";
329 dnl String variables.
330 2; 1; 0; 0; 0x010100 *2; s8 "STR1"; dnl index 6
331 2; 2; 0; 0; 0x010200 *2; s8 "STR2"; dnl index 7
332 2; 3; 0; 0; 0x010300 *2; s8 "STR3"; dnl index 8
333 2; 4; 0; 0; 0x010400 *2; s8 "STR4"; dnl index 9
334 2; 4; 0; 0; 0x010400 *2; s8 "STR5"; dnl index 10
335 2; 6; 0; 0; 0x010600 *2; s8 "STR6"; dnl index 11
336 2; 7; 0; 0; 0x010700 *2; s8 "STR7"; dnl index 12
337 2; 8; 0; 0; 0x010800 *2; s8 "STR8"; dnl index 13
338 2; 9; 0; 0; 0x010900 *2; "STR9"; i8 230; s3 ""; dnl index 14
339 2; -1; 0; 0; 0; 0; s8 "";
340 2; 12; 0; 0; 0x010c00 *2; s8 "STR12"; dnl index 16
341 2; -1; 0; 0; 0; 0; s8 "";
342 2; 16; 0; 0; 0x011000 *2; s8 "STR16"; dnl index 18
343 2; -1; 0; 0; 0; 0; s8 "";
344 2; 17; 0; 0; 0x011100 *2; s8 "STR17"; dnl index 20
345 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
347 dnl One value label for NUM1.
348 3; 1; 1.0; i8 17; i8 238; i8 228; i8 232; i8 237; s19 " (in Russian)"; 4; 1; 1;
350 dnl Two value labels for NUM2, as a single pair of type 3 and type 4 records.
351 3; 2; 1.0; i8 3; s7 "one"; 2.0; i8 3; s7 "two"; 4; 1; 2;
353 dnl Two value labels for NUM3, as two pairs of type 3 and type 4 records.
354 3; 1; 3.0; i8 5; s7 "three"; 4; 1; 3;
355 3; 1; 4.0; i8 4; s7 "four"; 4; 1; 3;
357 dnl Two common value labels for NUM4 and NUM5, plus two different ones for each.
358 3; 1; 5.0; i8 4; s7 "five"; 4; 1; 4;
359 3; 1; 6.0; i8 3; s7 "six"; 4; 1; 5;
360 3; 2; 7.0; i8 5; s7 "seven"; 8.0; i8 5; s7 "eight"; 4; 2; 4; 5;
361 3; 1; 9.0; i8 4; s7 "nine"; 4; 1; 4;
362 3; 1; 10.0; i8 3; s7 "ten"; 4; 1; 5;
364 dnl One value label for STR1.
365 3; 1; s8 "a"; i8 19; s23 "value label for `a'"; 4; 1; 6;
367 dnl Two value labels for STR2, as a single pair of type 3 and type 4 records.
369 s8 "bc"; i8 20; s23 "value label for `bc'";
370 s8 "de"; i8 20; s23 "value label for `de'";
373 dnl Two value labels for STR3, as two pairs of type 3 and type 4 records.
374 3; 1; s8 "fgh"; i8 21; s23 "value label for `fgh'"; 4; 1; 8;
375 3; 1; s8 "ijk"; i8 21; s23 "value label for `ijk'"; 4; 1; 8;
377 dnl Two common value labels for STR4 and STR5, plus two different ones for each.
378 3; 1; s8 "lmno"; i8 22; s23 "value label for `lmno'"; 4; 1; 9;
379 3; 1; s8 "pqrs"; i8 22; s23 "value label for `pqrs'"; 4; 1; 10;
381 s8 "tuvw"; i8 22; s23 "value label for `tuvw'";
382 s8 "xyzA"; i8 22; s23 "value label for `xyzA'";
384 3; 1; s8 "BCDE"; i8 22; s23 "value label for `BCDE'"; 4; 1; 9;
385 3; 1; s8 "FGHI"; i8 22; s23 "value label for `FGHI'"; 4; 1; 10;
387 dnl One value label for STR6, STR7, STR8.
388 3; 1; s8 "JKLMNO"; i8 24; s31 "value label for `JKLMNO'"; 4; 1; 11;
389 3; 1; s8 "JKLMNOP"; i8 25; s31 "value label for `JKLMNOP'"; 4; 1; 12;
390 3; 1; s8 "JKLMNOPQ"; i8 26; s31 "value label for `JKLMNOPQ'"; 4; 1; 13;
392 dnl Machine integer info record.
393 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1251;
395 dnl Character encoding record.
396 7; 20; 1; 12; "windows-1251";
399 dnl One value label for STR9ж,
400 COUNT("STR9"; i8 230); 9; 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
402 dnl Two value labels for STR12.
403 COUNT("STR12"); 12; 2;
404 COUNT("0123456789ab"); COUNT("value label for `0123456789ab'");
405 COUNT("cdefghijklmn"); COUNT("value label for `cdefghijklmn'");
407 dnl Three value labels for STR16.
408 COUNT("STR16"); 16; 3;
409 COUNT("opqrstuvwxyzABCD"); COUNT("value label for `opqrstuvwxyzABCD'");
410 COUNT("EFGHIJKLMNOPQRST"); COUNT("value label for `EFGHIJKLMNOPQRST'");
411 COUNT("UVWXYZ0123456789"); COUNT("value label for `UVWXYZ0123456789' with Cyrillic letters: `"; i8 244; i8 245; i8 246; "'");
413 dnl One value label for STR17.
414 COUNT("STR17"); 17; 1;
415 COUNT("abcdefghijklmnopq"); COUNT("value label for `abcdefghijklmnopq'");
418 dnl Dictionary termination record.
421 for variant in be le; do
422 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
423 AT_DATA([sys-file.sps], [dnl
424 GET FILE='sys-file.sav'.
427 AT_CHECK([pspp -o pspp.csv sys-file.sps])
428 AT_CHECK([cat pspp.csv], [0], [dnl
429 Variable,Description,Position
433 1,один (in Russian)",1
461 a,value label for `a'",6
465 bc,value label for `bc'
466 de,value label for `de'",7
470 fgh,value label for `fgh'
471 ijk,value label for `ijk'",8
475 BCDE,value label for `BCDE'
476 lmno,value label for `lmno'
477 tuvw,value label for `tuvw'
478 xyzA,value label for `xyzA'",9
482 FGHI,value label for `FGHI'
483 pqrs,value label for `pqrs'
484 tuvw,value label for `tuvw'
485 xyzA,value label for `xyzA'",10
489 JKLMNO,value label for `JKLMNO'",11
493 JKLMNOP,value label for `JKLMNOP'",12
497 JKLMNOPQ,value label for `JKLMNOPQ'",13
501 RSTUVWXYZ,value label for `RSTUVWXYZ'",14
505 0123456789ab,value label for `0123456789ab'
506 cdefghijklmn,value label for `cdefghijklmn'",15
510 EFGHIJKLMNOPQRST,value label for `EFGHIJKLMNOPQRST'
511 UVWXYZ0123456789,value label for `UVWXYZ0123456789' with Cyrillic letters: `фхц'
512 opqrstuvwxyzABCD,value label for `opqrstuvwxyzABCD'",16
516 abcdefghijklmnopq,value label for `abcdefghijklmnopq'",17
521 AT_SETUP([documents])
522 AT_KEYWORDS([sack synthetic system file positive])
523 AT_DATA([sys-file.sack], [dnl
525 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
527 1; dnl Nominal case size
528 0; dnl Not compressed
532 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
535 dnl Numeric variable, no label or missing values.
536 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
538 dnl Machine integer info record.
539 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
543 s80 "First line of documents";
544 s80 "Second line of documents";
545 "abb"; i8 233; " appliqu"; i8 233; " attach"; i8 233; " blas"; i8 233; " caf"; i8 233; " canap"; i8 233; " clich"; i8 233; " consomm"; i8 233;
548 s80 "Last line of documents";
550 dnl Character encoding record.
551 7; 20; 1; 12; "windows-1252";
553 dnl Dictionary termination record.
559 for variant in be le; do
560 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
561 AT_DATA([sys-file.sps], [dnl
562 GET FILE='sys-file.sav'.
566 AT_CHECK([pspp -o pspp.csv sys-file.sps])
567 AT_CHECK([cat pspp.csv], [0], [dnl
568 Documents in the active dataset:
570 First line of documents
572 Second line of documents
574 abbé appliqué attaché blasé café canapé cliché consommé
578 Last line of documents
587 AT_SETUP([empty document record])
588 AT_KEYWORDS([sack synthetic system file positive])
589 AT_DATA([sys-file.sack], [dnl
591 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
593 1; dnl Nominal case size
594 0; dnl Not compressed
598 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
601 dnl Numeric variable, no label or missing values.
602 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
604 dnl Machine integer info record.
605 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
610 dnl Character encoding record.
611 7; 20; 1; 12; "windows-1252";
613 dnl Dictionary termination record.
619 for variant in be le; do
620 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
621 AT_DATA([sys-file.sps], [dnl
622 GET FILE='sys-file.sav'.
625 AT_CHECK([pspp -o pspp.csv sys-file.sps])
626 AT_CHECK([cat pspp.csv], [0], [dnl
634 AT_SETUP([multiple response sets])
635 AT_KEYWORDS([sack synthetic system file positive])
636 AT_DATA([sys-file.sack], [dnl
638 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
640 16; dnl Nominal case size
641 0; dnl Not compressed
645 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
649 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
650 2; 0; 0; 0; 0x050800 *2; s8 "B";
651 2; 0; 0; 0; 0x050800 *2; s8 "C";
654 2; 0; 0; 0; 0x050800 *2; s8 "D";
655 2; 0; 0; 0; 0x050800 *2; s8 "E";
656 2; 0; 0; 0; 0x050800 *2; s8 "F";
657 2; 0; 0; 0; 0x050800 *2; s8 "G";
660 2; 4; 0; 0; 0x010400 *2; s8 "H";
661 2; 4; 0; 0; 0x010400 *2; s8 "I";
662 2; 4; 0; 0; 0x010400 *2; s8 "J";
665 2; 0; 0; 0; 0x050800 *2; s8 "K";
666 2; 0; 0; 0; 0x050800 *2; s8 "L";
667 2; 0; 0; 0; 0x050800 *2; s8 "M";
670 2; 6; 0; 0; 0x010600 *2; s8 "N";
671 2; 6; 0; 0; 0x010600 *2; s8 "O";
672 2; 6; 0; 0; 0x010600 *2; s8 "P";
674 dnl Machine integer info record.
675 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
679 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
680 "$b=D2 55 0 g e f d"; i8 10; i8 10;
681 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
686 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
687 "$e=E 11 6 choice 0 n o p"; i8 10; i8 10; i8 10; i8 10);
689 dnl Character encoding record.
690 7; 20; 1; 9; "shift_jis";
692 dnl Dictionary termination record.
695 for variant in be le; do
696 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
697 AT_DATA([sys-file.sps], [dnl
698 GET FILE='sys-file.sav'.
699 MRSETS /DISPLAY NAME=ALL.
701 AT_CHECK([pspp -o pspp.csv sys-file.sps])
702 AT_CHECK([cat pspp.csv], [0], [dnl
703 Table: Multiple Response Sets
704 Name,Variables,Details
708 ","Multiple category set
715 ","Multiple dichotomy set
717 Category label source: Variable labels
722 ","Multiple dichotomy set
724 Label source: Provided by user
726 Category label source: Variable labels
731 ","Multiple dichotomy set
733 Label source: Provided by user
735 Category label source: Value labels of counted value
740 ","Multiple dichotomy set
741 Label source: First variable label among variables
742 Counted value: `choice'
743 Category label source: Value labels of counted value
749 dnl Also checks for handling of CR-only line ends in file label and
750 dnl extra product info.
751 AT_SETUP([extra product info])
752 AT_KEYWORDS([sack synthetic system file positive])
753 AT_DATA([sys-file.sack], [dnl
755 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
757 4; dnl Nominal case size
758 0; dnl Not compressed
762 "01 Jan 11"; "20:53:52"; "PSPP synthetic"; i8 13; s49 "test file";
765 dnl Numeric variables.
766 2; 0; 0; 0; 0x050800 *2; s8 "A";
767 2; 0; 0; 0; 0x050800 *2; s8 "B";
768 2; 0; 0; 0; 0x050800 *2; s8 "C";
769 2; 0; 0; 0; 0x050800 *2; s8 "D";
771 dnl Extra product info.
772 7; 10; 1; COUNT ("Extra product info"; i8 13; "another line"; i8 13; "blah");
774 dnl Character encoding record.
775 7; 20; 1; 12; "windows-1252";
777 dnl Dictionary termination record.
780 for variant in be le; do
781 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
782 AT_DATA([sys-file.sps], [dnl
783 SYSFILE INFO FILE='sys-file.sav'.
785 AT_CHECK([pspp -o pspp.csv sys-file.sps])
786 AT_CHECK([sed 7q pspp.csv], [0], [dnl
788 Label:,"PSPP synthetic
790 Created:,01 Jan 11 20:53:52 by $(@%:@) SPSS DATA FILE PSPP synthetic test file
791 Product:,"Extra product info
798 AT_SETUP([variable display parameters, without width])
799 AT_KEYWORDS([sack synthetic system file positive])
800 AT_DATA([sys-file.sack], [dnl
802 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
804 19; dnl Nominal case size
805 0; dnl Not compressed
809 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
812 dnl Numeric variables.
813 2; 0; 0; 0; 0x050800 *2; s8 "A";
814 2; 0; 0; 0; 0x050800 *2; s8 "B";
815 2; 0; 0; 0; 0x050800 *2; s8 "C";
816 2; 0; 0; 0; 0x050800 *2; s8 "D";
818 dnl Short string variables.
819 2; 3; 0; 0; 0x010300 *2; s8 "H";
820 2; 3; 0; 0; 0x010300 *2; s8 "I";
821 2; 3; 0; 0; 0x010300 *2; s8 "J";
822 2; 3; 0; 0; 0x010300 *2; s8 "K";
824 dnl Long string variables.
825 2; 9; 0; 0; 0x010900 *2; s8 "L";
826 2; -1; 0; 0; 0; 0; s8 "";
827 2; 10; 0; 0; 0x010a00 *2; s8 "M";
828 2; -1; 0; 0; 0; 0; s8 "";
829 2; 17; 0; 0; 0x011100 *2; s8 "N";
830 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
831 2; 25; 0; 0; 0x011900 *2; s8 "O";
832 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
834 dnl Variable display parameters
849 dnl Character encoding record.
850 7; 20; 1; 12; "windows-1252";
852 dnl Dictionary termination record.
855 for variant in be le; do
856 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
857 AT_DATA([sys-file.sps], [dnl
858 GET FILE='sys-file.sav'.
861 AT_CHECK([pspp -o pspp.csv sys-file.sps])
862 AT_CHECK([cat pspp.csv], [0], [dnl
863 Variable,Description,Position
866 Display Alignment: Left",1
869 Display Alignment: Left",2
872 Display Alignment: Left",3
875 Display Alignment: Right",4
878 Display Alignment: Right",5
881 Display Alignment: Right",6
884 Display Alignment: Center",7
887 Display Alignment: Center",8
890 Display Alignment: Center",9
893 Display Alignment: Left",10
896 Display Alignment: Right",11
899 Display Alignment: Center",12
904 AT_SETUP([variable display parameters, with width])
905 AT_KEYWORDS([sack synthetic system file positive])
906 AT_DATA([sys-file.sack], [dnl
908 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
910 19; dnl Nominal case size
911 0; dnl Not compressed
915 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
918 dnl Numeric variables.
919 2; 0; 0; 0; 0x050800 *2; s8 "A";
920 2; 0; 0; 0; 0x050800 *2; s8 "B";
921 2; 0; 0; 0; 0x050800 *2; s8 "C";
922 2; 0; 0; 0; 0x050800 *2; s8 "D";
924 dnl Short string variables.
925 2; 3; 0; 0; 0x010300 *2; s8 "H";
926 2; 3; 0; 0; 0x010300 *2; s8 "I";
927 2; 3; 0; 0; 0x010300 *2; s8 "J";
928 2; 3; 0; 0; 0x010300 *2; s8 "K";
930 dnl Long string variables.
931 2; 9; 0; 0; 0x010900 *2; s8 "L";
932 2; -1; 0; 0; 0; 0; s8 "";
933 2; 10; 0; 0; 0x010a00 *2; s8 "M";
934 2; -1; 0; 0; 0; 0; s8 "";
935 2; 17; 0; 0; 0x011100 *2; s8 "N";
936 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
937 2; 25; 0; 0; 0x011900 *2; s8 "O";
938 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
940 dnl Variable display parameters
955 dnl Character encoding record.
956 7; 20; 1; 12; "windows-1252";
958 dnl Dictionary termination record.
961 for variant in be le; do
962 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
963 AT_DATA([sys-file.sps], [dnl
964 GET FILE='sys-file.sav'.
967 AT_CHECK([pspp -o pspp.csv sys-file.sps])
968 AT_CHECK([cat pspp.csv], [0], [dnl
969 Variable,Description,Position
972 Display Alignment: Left
976 Display Alignment: Left
980 Display Alignment: Left
984 Display Alignment: Right
988 Display Alignment: Right
992 Display Alignment: Right
996 Display Alignment: Center
1000 Display Alignment: Center
1004 Display Alignment: Center
1008 Display Alignment: Left
1009 Display Width: 10",10
1012 Display Alignment: Right
1013 Display Width: 11",11
1016 Display Alignment: Center
1017 Display Width: 12",12
1022 AT_SETUP([long variable names])
1023 AT_KEYWORDS([sack synthetic system file positive])
1024 AT_DATA([sys-file.sack], [dnl
1026 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1028 7; dnl Nominal case size
1029 0; dnl Not compressed
1033 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1036 dnl Numeric variables.
1037 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
1038 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
1039 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
1040 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
1041 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDINA";
1042 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_A";
1043 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_B";
1045 dnl Machine integer info record.
1046 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1048 dnl Machine floating-point info record.
1049 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
1051 dnl Long variable names.
1053 "LONGVARI=LongVariableName1"; i8 9;
1054 "LONGVA_A=LongVariableName2"; i8 9;
1055 "LONGVA_B=LongVariableName3"; i8 9;
1056 "LONGVA_C=LongVariableName4"; i8 9;
1057 "CO"; i8 214; "RDINA=Co"; i8 246; "rdinate_X"; i8 9;
1058 "CO"; i8 214; "RDI_A=Co"; i8 246; "rdinate_Y"; i8 9;
1059 "CO"; i8 214; "RDI_B=Co"; i8 246; "rdinate_Z";
1062 dnl Character encoding record.
1063 7; 20; 1; 12; "windows-1252";
1065 dnl Dictionary termination record.
1068 for variant in be le; do
1069 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1070 AT_DATA([sys-file.sps], [dnl
1071 GET FILE='sys-file.sav'.
1074 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1075 AT_CHECK([cat pspp.csv], [0], [dnl
1076 Variable,Description,Position
1077 LongVariableName1,Format: F8.0,1
1078 LongVariableName2,Format: F8.0,2
1079 LongVariableName3,Format: F8.0,3
1080 LongVariableName4,Format: F8.0,4
1081 Coördinate_X,Format: F8.0,5
1082 Coördinate_Y,Format: F8.0,6
1083 Coördinate_Z,Format: F8.0,7
1088 AT_SETUP([very long strings])
1089 AT_KEYWORDS([sack synthetic system file positive])
1090 AT_DATA([sys-file.sack], [dnl
1092 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1094 109; dnl Nominal case size
1095 0; dnl Not compressed
1099 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1102 dnl 256-byte string.
1103 2; 255; 0; 0; 0x01FF00 *2; "S"; i8 201; s6 "Q256";
1104 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1105 2; 4; 0; 0; 0x010400 *2; "S"; i8 201; "Q256_1";
1107 dnl 600-byte string.
1108 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600";
1109 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1110 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600_1";
1111 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1112 2; 96; 0; 0; 0x016000 *2; s8 "STR600_2";
1113 (2; -1; 0; 0; 0; 0; s8 "") * 11;
1115 dnl Machine integer info record.
1116 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1118 dnl Very long string record.
1120 "S"; i8 201; "Q256=00256"; i8 0; i8 9;
1121 "STR600=00600"; i8 0; i8 9;
1124 dnl Character encoding record.
1125 7; 20; 1; 12; "windows-1252";
1127 dnl Dictionary termination record.
1131 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 4;
1133 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 9;
1134 "abcdefghijklmnopqrstuvwxyzABCDEF";
1136 for variant in be le; do
1137 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1138 AT_DATA([sys-file.sps], [dnl
1139 GET FILE='sys-file.sav'.
1143 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1144 AT_CHECK([cat pspp.csv], [0], [dnl
1145 Variable,Description,Position
1146 séq256,Format: A256,1
1147 str600,Format: A600,2
1151 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@a,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyz
1156 AT_SETUP([data file and variable attributes])
1157 AT_KEYWORDS([sack synthetic system file positive])
1158 AT_DATA([sys-file.sack], [dnl
1160 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1162 3; dnl Nominal case size
1163 0; dnl Not compressed
1167 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1171 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
1172 2; 0; 0; 0; 0x050800 *2; s8 "SECONDVA";
1173 2; 0; 0; 0; 0x050800 *2; s8 "THIRDVAR";
1175 dnl Machine integer info record.
1176 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1178 dnl Long variable names.
1180 "FIRSTVAR=FirstVariable"; i8 9;
1181 "SECONDVA=S"; i8 233; "condVariable"; i8 9;
1182 "THIRDVAR=ThirdVariable"; i8 9
1185 dnl Data file attributes record.
1187 "Attr1('Value1'"; i8 10; "''d"; i8 233; "claration''"; i8 10; ")";
1188 "S"; i8 233; "condAttr('123'"; i8 10; "'456'"; i8 10; ")";
1191 dnl Variable attributes record.
1194 "ad"; i8 232; "le('23'"; i8 10; "'34'"; i8 10; ")";
1195 "bert('123'"; i8 10; ")";
1196 "$@Role('1'"; i8 10; ")";
1197 "/S"; i8 233; "condVariable:";
1198 "xyzzy('quux'"; i8 10; ")";
1201 dnl Another variable attributes record.
1202 dnl Only system files written by "Stata 14.1/-savespss- 1.77 by S.Radyakin"
1203 dnl include multiple variable attributes records.
1204 7; 18; 1; COUNT ("ThirdVariable:fizz('buzz'"; i8 10; ")";);
1206 dnl Character encoding record.
1207 7; 20; 1; 12; "windows-1252";
1209 dnl Dictionary termination record.
1212 for variant in be le; do
1213 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1214 AT_DATA([sys-file.sps], [dnl
1215 GET FILE='sys-file.sav'.
1216 DISPLAY @ATTRIBUTES.
1218 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1219 AT_CHECK([cat pspp.csv], [0],
1220 [[Variable,Description
1221 FirstVariable,"Attribute,Value
1226 SécondVariable,"Attribute,Value
1228 ThirdVariable,"Attribute,Value
1231 Table: Custom data file attributes.
1234 Attr1[2],'déclaration'
1238 AT_DATA([sys-file.sps], [dnl
1239 GET FILE='sys-file.sav'.
1242 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1243 AT_CHECK([cat pspp.csv], [0],
1244 [[Variable,Description,Position
1245 FirstVariable,"Format: F8.0
1252 SécondVariable,"Format: F8.0
1257 ThirdVariable,"Format: F8.0
1263 Table: Custom data file attributes.
1266 Attr1[2],'déclaration'
1273 AT_SETUP([variable roles])
1274 AT_KEYWORDS([sack synthetic system file positive])
1275 AT_DATA([sys-file.sack], [dnl
1277 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1279 7; dnl Nominal case size
1280 0; dnl Not compressed
1284 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1288 2; 0; 0; 0; 0x050800 *2; s8 "I";
1289 2; 0; 0; 0; 0x050800 *2; s8 "O";
1290 2; 0; 0; 0; 0x050800 *2; s8 "B";
1291 2; 0; 0; 0; 0x050800 *2; s8 "N";
1292 2; 0; 0; 0; 0x050800 *2; s8 "P";
1293 2; 0; 0; 0; 0x050800 *2; s8 "S";
1294 2; 0; 0; 0; 0x050800 *2; s8 "X";
1296 dnl Machine integer info record.
1297 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1299 dnl Variable attributes record.
1301 "I:$@Role('0'"; i8 10; ")";
1302 "/O:$@Role('1'"; i8 10; ")";
1303 "/B:$@Role('2'"; i8 10; ")";
1304 "/N:$@Role('3'"; i8 10; ")";
1305 "/P:$@Role('4'"; i8 10; ")";
1306 "/S:$@Role('5'"; i8 10; ")";
1307 "/X:$@Role('6'"; i8 10; ")";
1310 dnl Character encoding record.
1311 7; 20; 1; 12; "windows-1252";
1313 dnl Dictionary termination record.
1316 for variant in be le; do
1317 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1318 AT_DATA([sys-file.sps], [dnl
1319 GET FILE='sys-file.sav'.
1322 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [dnl
1323 warning: `sys-file.sav': Invalid role for variable x.
1325 AT_CHECK([cat pspp.csv], [0], [dnl
1326 warning: `sys-file.sav': Invalid role for variable x.
1328 Variable,Description,Position
1347 AT_SETUP([compressed data])
1348 AT_KEYWORDS([sack synthetic system file positive])
1349 AT_DATA([sys-file.sack], [dnl
1351 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1353 6; dnl Nominal case size
1354 1; dnl Simple compression
1356 -1; dnl Unspecified number of cases.
1358 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1361 dnl Numeric variables.
1362 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1363 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1365 dnl String variable.
1366 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1367 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1368 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1369 2; -1; 0; 0; 0; 0; s8 "";
1371 dnl Character encoding record.
1372 7; 20; 1; 12; "windows-1252";
1374 dnl Dictionary termination record.
1377 dnl Compressed data.
1378 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1379 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1380 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1381 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1384 for variant in be le; do
1385 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1386 AT_DATA([sys-file.sps], [dnl
1387 GET FILE='sys-file.sav'.
1391 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1392 AT_CHECK([cat pspp.csv], [0], [dnl
1393 Variable,Description,Position
1401 num1,num2,str4,str8,str15
1402 -99,0,,abcdefgh,0123 @&t@
1403 .,151,jklm,nopqrstu,vwxyzABC @&t@
1404 1,2,DEFG,HIJKLMNO,PQRSTUV
1409 AT_SETUP([compressed data, zero bias])
1410 AT_KEYWORDS([sack synthetic system file positive])
1411 AT_DATA([sys-file.sack], [dnl
1413 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1415 6; dnl Nominal case size
1416 1; dnl Simple compression.
1418 -1; dnl Unspecified number of cases.
1420 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1423 dnl Numeric variables.
1424 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1425 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1427 dnl String variable.
1428 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1429 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1430 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1431 2; -1; 0; 0; 0; 0; s8 "";
1433 dnl Character encoding record.
1434 7; 20; 1; 12; "windows-1252";
1436 dnl Dictionary termination record.
1439 dnl Compressed data.
1440 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1441 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1442 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1443 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1446 for variant in be le; do
1447 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1448 AT_DATA([sys-file.sps], [dnl
1449 GET FILE='sys-file.sav'.
1453 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1454 AT_CHECK([cat pspp.csv], [0], [dnl
1455 Variable,Description,Position
1463 num1,num2,str4,str8,str15
1464 1,100,,abcdefgh,0123 @&t@
1465 .,251,jklm,nopqrstu,vwxyzABC @&t@
1466 101,102,DEFG,HIJKLMNO,PQRSTUV
1471 AT_SETUP([compressed data, other bias])
1472 AT_KEYWORDS([sack synthetic system file positive])
1473 AT_DATA([sys-file.sack], [dnl
1475 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1477 6; dnl Nominal case size
1478 1; dnl Simple compression.
1480 -1; dnl Unspecified number of cases.
1482 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1485 dnl Numeric variables.
1486 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1487 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1489 dnl String variable.
1490 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1491 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1492 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1493 2; -1; 0; 0; 0; 0; s8 "";
1495 dnl Character encoding record.
1496 7; 20; 1; 12; "windows-1252";
1498 dnl Dictionary termination record.
1501 dnl Compressed data.
1502 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1503 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1504 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1505 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1508 for variant in be le; do
1509 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1510 AT_DATA([sys-file.sps], [dnl
1511 GET FILE='sys-file.sav'.
1515 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0],
1516 [warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1518 AT_CHECK([cat pspp.csv], [0], [dnl
1519 "warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1521 Variable,Description,Position
1529 num1,num2,str4,str8,str15
1530 -49,50,,abcdefgh,0123 @&t@
1531 .,201,jklm,nopqrstu,vwxyzABC @&t@
1532 51,52,DEFG,HIJKLMNO,PQRSTUV
1537 m4_divert_push([PREPARE_TESTS])
1538 zcompressed_sack () {
1541 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1543 6; dnl Nominal case size
1544 2; dnl zlib compressed
1546 -1; dnl Unspecified number of cases.
1548 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1551 dnl Numeric variables.
1552 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1553 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1555 dnl String variable.
1556 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1557 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1558 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1559 2; -1; 0; 0; 0; 0; s8 "";
1561 dnl Character encoding record.
1562 7; 20; 1; 12; "windows-1252";
1564 dnl Dictionary termination record.
1567 dnl ZLIB data header.
1568 i64 0x194; # zheader_ofs
1569 i64 0x205; # ztrailer_ofs
1570 i64 48; # ztrailer_len
1572 dnl ZLIB data block.
1574 dnl This is the compressed form of:
1576 dnl 01 64 fe fd fe fd ff fb 61 62 63 64 65 66 67 68 |.d......abcdefgh|
1577 dnl 30 31 32 33 20 20 20 20 fd fd fd fe 65 66 fd fd |0123 ....ef..|
1578 dnl 6a 6b 6c 6d 20 20 20 20 6e 6f 70 71 72 73 74 75 |jklm nopqrstu|
1579 dnl 76 77 78 79 7a 41 42 43 44 45 46 47 20 20 20 20 |vwxyzABCDEFG |
1580 dnl 48 49 4a 4b 4c 4d 4e 4f fe fd fc 00 00 00 00 00 |HIJKLMNO........|
1581 dnl 50 51 52 53 54 55 56 57 |PQRSTUVW|
1583 dnl which is the data from the "compressed data" test.
1584 hex "78 01 63 4c f9 f7 f7 df df ff bf 13 93 92 53 52";
1585 hex "d3 d2 33 0c 0c 8d 8c 15 80 e0 ef df bf ff 52 d3";
1586 hex "fe fe cd ca ce c9 05 f1 f3 f2 0b 0a 8b 8a 4b 4a";
1587 hex "cb ca 2b 2a ab 1c 9d 9c 5d 5c dd dc 41 e2 1e 9e";
1588 hex "5e de 3e be 7e fe ff fe fe 61 00 81 80 c0 a0 e0";
1589 hex "90 d0 b0 70 00 0f 3f 23 d7";
1591 dnl ZLIB data trailer fixed header:
1592 i64 -100; # ztrailer_bias
1593 i64 0; # ztrailer_zero
1594 0x3ff000; # block_size
1597 dnl ZLIB block descriptor:
1598 i64 0x194; # uncompressed_ofs
1599 i64 0x1ac; # compressed_ofs
1600 88; # uncompressed_size
1601 89; # compressed_size
1604 m4_divert_pop([PREPARE_TESTS])
1606 AT_SETUP([zcompressed data])
1607 AT_KEYWORDS([sack synthetic system file positive zlib])
1608 zcompressed_sack > sys-file.sack
1609 for variant in be le; do
1610 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1611 AT_DATA([sys-file.sps], [dnl
1612 GET FILE='sys-file.sav'.
1616 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1617 AT_CHECK([cat pspp.csv], [0], [dnl
1618 Variable,Description,Position
1626 num1,num2,str4,str8,str15
1627 -99,0,,abcdefgh,0123 @&t@
1628 .,151,jklm,nopqrstu,vwxyzABC @&t@
1629 1,2,DEFG,HIJKLMNO,PQRSTUV
1634 AT_BANNER([system file reader - negative])
1636 AT_SETUP([no variables])
1637 AT_KEYWORDS([sack synthetic system file negative])
1638 AT_DATA([sys-file.sack], [dnl
1640 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1642 0; dnl Nominal case size (empty)
1643 0; dnl Not compressed
1647 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1650 dnl Character encoding record.
1651 7; 20; 1; 12; "windows-1252";
1653 dnl Dictionary termination record.
1656 for variant in be le; do
1657 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1658 AT_DATA([sys-file.sps], [dnl
1659 GET FILE='sys-file.sav'.
1661 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1662 sys-file.sps:1: error: GET: `sys-file.sav': Data file dictionary has no variables.
1665 dnl At one point pspp-convert would hang forever if there were no variables,
1666 dnl so check against regression.
1667 AT_CHECK([pspp-convert sys-file.sav sys-file.txt])
1668 AT_CHECK([cat sys-file.txt], [0], [
1673 AT_SETUP([unspecified character encoding])
1674 AT_KEYWORDS([sack synthetic system file positive])
1675 AT_DATA([sys-file.sack], [dnl
1677 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1679 4; dnl Nominal case size
1680 0; dnl Not compressed
1684 "01 Jan 11"; "20:53:52";
1685 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1688 dnl Numeric variables.
1689 2; 0; 0; 0; 0x050800 *2; s8 "A";
1690 2; 0; 0; 0; 0x050800 *2; s8 "B";
1691 2; 0; 0; 0; 0x050800 *2; s8 "C";
1692 2; 0; 0; 0; 0x050800 *2; s8 "D";
1694 dnl Dictionary termination record.
1697 for variant in be le; do
1698 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1699 AT_DATA([sys-file.sps], [dnl
1702 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [stdout])
1703 AT_CHECK([sed 's/default encoding.*For/default encoding. For/' stdout], [0], [dnl
1704 "warning: `sys-file.sav': This system file does not indicate its own character encoding. Using default encoding. For best results, specify an encoding explicitly. Use SYSFILE INFO with ENCODING=""DETECT"" to analyze the possible encodings."
1709 AT_SETUP([misplaced type 4 record])
1710 AT_KEYWORDS([sack synthetic system file negative])
1711 AT_DATA([sys-file.sack], [dnl
1713 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1714 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1716 dnl Numeric variable.
1717 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1722 for variant in be le; do
1723 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1724 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1726 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1727 [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1732 AT_SETUP([bad record type])
1733 AT_KEYWORDS([sack synthetic system file negative])
1734 AT_DATA([sys-file.sack], [dnl
1736 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1737 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1739 dnl Numeric variable.
1740 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1742 dnl Type 8 record (not a valid type).
1745 for variant in be le; do
1746 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1747 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1749 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1750 [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1755 AT_SETUP([wrong number of variable positions])
1756 AT_KEYWORDS([sack synthetic system file negative])
1757 AT_DATA([sys-file.sack], [dnl
1759 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1760 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1762 dnl Numeric variable.
1763 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1765 dnl Character encoding record.
1766 7; 20; 1; 12; "windows-1252";
1768 dnl End of dictionary.
1771 for variant in be le; do
1772 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1773 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1775 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1776 [warning: `sys-file.sav': File header claims 2 variable positions but 1 were read from file.
1781 AT_SETUP([variable name may not begin with `#'])
1782 AT_KEYWORDS([sack synthetic system file negative])
1783 AT_DATA([sys-file.sack], [dnl
1785 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1786 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1788 dnl Numeric variable.
1789 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1791 dnl Character encoding record.
1792 7; 20; 1; 12; "windows-1252";
1794 dnl End of dictionary.
1797 for variant in be le; do
1798 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1799 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1801 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1802 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `$UM1'.
1807 AT_SETUP([variable name may not be reserved word])
1808 AT_KEYWORDS([sack synthetic system file negative])
1809 AT_DATA([sys-file.sack], [dnl
1811 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1812 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1814 dnl Numeric variable.
1815 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1817 dnl Character encoding record.
1818 7; 20; 1; 12; "windows-1252";
1820 dnl End of dictionary.
1823 for variant in be le; do
1824 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1825 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1827 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1828 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `TO'.
1833 AT_SETUP([variable width must be between 0 and 255])
1834 AT_KEYWORDS([sack synthetic system file negative])
1835 AT_DATA([sys-file.sack], [dnl
1837 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1838 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1840 dnl String variable with invalid width 256.
1841 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1843 dnl Character encoding record.
1844 7; 20; 1; 12; "windows-1252";
1846 dnl End of dictionary.
1849 for variant in be le; do
1850 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1851 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1853 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1854 [error: `sys-file.sav' near offset 0xb4: Bad width 256 for variable VAR1.
1859 dnl SPSS-generated system file can contain duplicate variable names
1860 dnl (see bug #41475).
1861 AT_SETUP([duplicate variable name])
1862 AT_KEYWORDS([sack synthetic system file negative])
1863 AT_DATA([sys-file.sack], [dnl
1865 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1866 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1868 dnl Numeric variables.
1869 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1870 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1872 dnl Character encoding record.
1873 7; 20; 1; 12; "windows-1252";
1875 dnl End of dictionary.
1878 for variant in be le; do
1879 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1880 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1883 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1884 [warning: `sys-file.sav' near offset 0xd4: Renaming variable with duplicate name `VAR1' to `VAR001'.
1886 Variable,Description,Position
1888 var001,Format: F8.0,2
1893 AT_SETUP([variable label indicator not 0 or 1])
1894 AT_KEYWORDS([sack synthetic system file negative])
1895 AT_DATA([sys-file.sack], [dnl
1897 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1898 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1900 dnl Numeric variable.
1901 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1903 dnl Character encoding record.
1904 7; 20; 1; 12; "windows-1252";
1906 dnl End of dictionary.
1909 for variant in be le; do
1910 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1911 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1913 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1914 [error: `sys-file.sav' near offset 0xb4: Variable label indicator field is not 0 or 1.
1919 AT_SETUP([invalid numeric missing value indicator])
1920 AT_KEYWORDS([sack synthetic system file negative])
1921 AT_DATA([sys-file.sack], [dnl
1923 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1924 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1926 dnl Numeric variable.
1927 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1929 dnl Character encoding record.
1930 7; 20; 1; 12; "windows-1252";
1932 dnl End of dictionary.
1935 for variant in be le; do
1936 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1937 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1939 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1940 ["error: `sys-file.sav' near offset 0xb4: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1945 AT_SETUP([invalid string missing value indicator])
1946 AT_KEYWORDS([sack synthetic system file negative])
1947 AT_DATA([sys-file.sack], [dnl
1949 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1950 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1952 dnl String variable.
1953 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1955 dnl Character encoding record.
1956 7; 20; 1; 12; "windows-1252";
1958 dnl End of dictionary.
1961 for variant in be le; do
1962 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1963 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1965 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1966 ["error: `sys-file.sav' near offset 0xb4: String missing value indicator field is not 0, 1, 2, or 3."
1971 AT_SETUP([missing string continuation record])
1972 AT_KEYWORDS([sack synthetic system file negative])
1973 AT_DATA([sys-file.sack], [dnl
1975 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1976 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1978 dnl String variable.
1979 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1980 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
1982 dnl Character encoding record.
1983 7; 20; 1; 12; "windows-1252";
1985 dnl End of dictionary.
1988 for variant in be le; do
1989 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1990 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1992 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1993 [error: `sys-file.sav' near offset 0xb4: Missing string continuation record.
1998 AT_SETUP([invalid variable format])
1999 AT_KEYWORDS([sack synthetic system file negative])
2000 AT_DATA([sys-file.sack], [dnl
2002 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2003 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2005 dnl Numeric variable, invalid format types.
2006 dnl No warning is issued for type 0 because it has been observed in real
2008 2; 0; 0; 0; >>0xff0800; 0<<; s8 "NUM1";
2010 dnl Numeric variable, string formats.
2011 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
2013 dnl String variable, numeric formats.
2014 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
2016 dnl String variable, wrong width formats.
2017 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
2019 dnl Character encoding record.
2020 7; 20; 1; 12; "windows-1252";
2022 dnl End of dictionary.
2025 for variant in be le; do
2026 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2027 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2029 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2030 warning: `sys-file.sav' near offset 0xc0: Variable NUM1 with width 0 has invalid print format 0xff0800.
2032 warning: `sys-file.sav' near offset 0xe0: Variable VAR1 with width 0 has invalid print format 0x10800.
2034 warning: `sys-file.sav' near offset 0xe4: Variable VAR1 with width 0 has invalid write format 0x21000.
2036 warning: `sys-file.sav' near offset 0x100: Variable STR1 with width 4 has invalid print format 0x50800.
2038 warning: `sys-file.sav' near offset 0x104: Variable STR1 with width 4 has invalid write format 0x110a01.
2040 warning: `sys-file.sav' near offset 0x120: Variable STR2 with width 4 has invalid print format 0x10800.
2042 warning: `sys-file.sav' near offset 0x124: Variable STR2 with width 4 has invalid write format 0x20400.
2047 AT_SETUP([invalid long string missing values])
2048 AT_KEYWORDS([sack synthetic system file negative])
2049 AT_DATA([sys-file.sack], [dnl
2051 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2053 7; dnl Nominal case size
2054 0; dnl Not compressed
2058 "01 Jan 11"; "20:53:52";
2059 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
2062 dnl One numeric variable.
2063 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2065 dnl Long string variables that will have missing values added with a
2067 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2068 2; -1; 0; 0; 0; 0; s8 "";
2069 2; 10; 0; 0; 0x010a00 *2; s8 "STR2";
2070 2; -1; 0; 0; 0; 0; s8 "";
2071 2; 11; 0; 0; 0x010b00 *2; s8 "STR3";
2072 2; -1; 0; 0; 0; 0; s8 "";
2074 dnl Machine integer info record.
2075 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
2077 dnl Machine floating-point info record.
2078 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
2080 dnl Long string variable missing values record.
2082 dnl Zero missing values (not allowed) for STR1 .
2083 COUNT("STR1"); i8 >>0<<;
2085 dnl Four missing values (not allowed) for STR2.
2086 COUNT("STR2"); i8 4;
2087 8; "abcdefgh"; 8; "ijklmnop"; 8; "qrstuvwx"; 8; "yz012345";
2089 dnl Missing values for unknown variable
2090 COUNT(>>"Nonexistent"<<); i8 1; 8; "abcdefgh";
2092 dnl Missing values for numeric variable
2093 COUNT(>>"NUM1"<<); i8 1; 8; "abcdefgh";
2095 dnl Too long missing value
2096 COUNT("STR3"); i8 1; >>COUNT("abcdefghijkl")<<;
2099 dnl Character encoding record.
2100 7; 20; 1; 12; "windows-1252";
2102 dnl Dictionary termination record.
2104 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
2105 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
2106 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
2109 for variant in be le; do
2110 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2111 AT_DATA([sys-file.sps], [dnl
2112 GET FILE='sys-file.sav'.
2115 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2116 ["warning: `sys-file.sav' near offset 0x1f8: Long string missing values record says variable STR1 has 0 missing values, but only 1 to 3 missing values are allowed."
2118 "warning: `sys-file.sav' near offset 0x201: Long string missing values record says variable STR2 has 4 missing values, but only 1 to 3 missing values are allowed."
2120 warning: `sys-file.sav' near offset 0x242: Ignoring long string missing value record for unknown variable Nonexistent.
2122 warning: `sys-file.sav' near offset 0x257: Ignoring long string missing value record for numeric variable NUM1.
2124 "warning: `sys-file.sav' near offset 0x270: Ignoring long string missing value 0 for variable str3, with width 11, that has bad value width 12."
2126 Variable,Description,Position
2130 Missing Values: ""abcdefgh""; ""ijklmnop""; ""qrstuvwx""",3
2136 AT_SETUP([weighting variable must be numeric])
2137 AT_KEYWORDS([sack synthetic system file negative])
2138 AT_DATA([sys-file.sack], [dnl
2140 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2141 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2143 dnl Numeric variable.
2144 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2146 dnl String variable.
2147 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2149 dnl Character encoding record.
2150 7; 20; 1; 12; "windows-1252";
2152 dnl End of dictionary.
2155 for variant in be le; do
2156 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2157 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2160 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2161 [warning: `sys-file.sav': Ignoring string variable `STR1' set as weighting variable.
2163 Variable,Description,Position
2170 AT_SETUP([bad weighting variable index])
2171 AT_KEYWORDS([sack synthetic system file negative])
2172 AT_DATA([sys-file.sack], [dnl
2174 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2175 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2177 dnl Numeric variable.
2178 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2180 dnl String variable.
2181 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2183 dnl Character encoding record.
2184 7; 20; 1; 12; "windows-1252";
2186 dnl End of dictionary.
2189 for variant in be le; do
2190 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2191 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2193 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2194 [error: `sys-file.sav' near offset 0x4c: Variable index 3 not in valid range 1...2.
2199 AT_SETUP([variable index is long string contination])
2200 AT_KEYWORDS([sack synthetic system file negative])
2201 AT_DATA([sys-file.sack], [dnl
2203 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2204 2; 3; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2206 dnl Numeric variable.
2207 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2209 dnl Long string variable.
2210 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2211 (2; -1; 0; 0; 0; 0; s8 "");
2213 dnl Character encoding record.
2214 7; 20; 1; 12; "windows-1252";
2216 dnl End of dictionary.
2219 for variant in be le; do
2220 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2221 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2223 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2224 [error: `sys-file.sav' near offset 0x4c: Variable index 3 refers to long string continuation.
2229 AT_SETUP([multiple documents records])
2230 AT_KEYWORDS([sack synthetic system file negative])
2231 AT_DATA([sys-file.sack], [dnl
2233 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2234 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2236 dnl Numeric variable, no label or missing values.
2237 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2239 dnl Two document records.
2240 (6; 1; s80 "One line of documents") >>* 2<<;
2242 dnl Dictionary termination record.
2245 dnl Character encoding record.
2246 7; 20; 1; 12; "windows-1252";
2251 for variant in be le; do
2252 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2253 AT_DATA([sys-file.sps], [dnl
2254 GET FILE='sys-file.sav'.
2256 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2257 error: `sys-file.sav' near offset 0x12c: Duplicate type 6 (document) record.
2263 AT_SETUP([extension record too large])
2264 AT_KEYWORDS([sack synthetic system file negative])
2265 AT_DATA([sys-file.sack], [dnl
2267 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2268 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2270 dnl Numeric variable, no label or missing values.
2271 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2273 dnl Too-large extension record.
2274 7; 3; >>0xfffff000 * 2<<;
2276 for variant in be le; do
2277 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2278 AT_DATA([sys-file.sps], [dnl
2279 GET FILE='sys-file.sav'.
2281 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2282 error: `sys-file.sav' near offset 0xd8: Record type 7 subtype 3 too large.
2287 AT_SETUP([unknown extension record])
2288 AT_KEYWORDS([sack synthetic system file negative])
2289 AT_DATA([sys-file.sack], [dnl
2291 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2292 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2294 dnl Numeric variable, no label or missing values.
2295 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2297 dnl Unknown extension record type.
2300 dnl Character encoding record.
2301 7; 20; 1; 12; "windows-1252";
2303 dnl End of dictionary.
2306 for variant in be le; do
2307 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2308 AT_DATA([sys-file.sps], [dnl
2309 GET FILE='sys-file.sav'.
2311 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2312 "warning: \`sys-file.sav' near offset 0xd8: Unrecognized record type 7, subtype 30. For help, please send this file to ${PACKAGE_BUGREPORT} and mention that you were using ${PACKAGE_STRING}."
2317 AT_SETUP([bad machine integer info size])
2318 AT_KEYWORDS([sack synthetic system file negative])
2319 AT_DATA([sys-file.sack], [dnl
2321 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2322 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2324 dnl Numeric variable, no label or missing values.
2325 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2327 dnl Machine integer info record.
2328 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252; >>1234<<;
2330 dnl Character encoding record.
2331 7; 20; 1; 12; "windows-1252";
2333 dnl End of dictionary.
2336 for variant in be le; do
2337 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2338 AT_DATA([sys-file.sps], [dnl
2339 GET FILE='sys-file.sav'.
2341 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2342 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 3 has bad count 9 (expected 8)."
2347 AT_SETUP([bad machine integer info float format])
2348 AT_KEYWORDS([sack synthetic system file negative])
2349 AT_DATA([sys-file.sack], [dnl
2351 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2352 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2354 dnl Numeric variable, no label or missing values.
2355 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2357 dnl Machine integer info record.
2358 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
2360 dnl Character encoding record.
2361 7; 20; 1; 12; "windows-1252";
2363 dnl End of dictionary.
2366 for variant in be le; do
2367 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2368 AT_DATA([sys-file.sps], [dnl
2369 GET FILE='sys-file.sav'.
2371 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2372 error: `sys-file.sav' near offset 0xd8: Floating-point representation indicated by system file (2) differs from expected (1).
2377 AT_SETUP([bad machine integer info endianness])
2378 AT_KEYWORDS([sack synthetic system file negative])
2379 AT_DATA([sys-file.sack], [dnl
2381 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2382 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2384 dnl Numeric variable, no label or missing values.
2385 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2387 dnl Machine integer info record.
2388 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
2390 dnl Character encoding record.
2391 7; 20; 1; 12; "windows-1252";
2393 dnl End of dictionary.
2396 for variant in "be 1" "le 2"; do
2398 AT_CHECK([sack --$[1] sys-file.sack > sys-file.sav])
2399 AT_DATA([sys-file.sps], [dnl
2400 GET FILE='sys-file.sav'.
2403 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2404 warning: \`sys-file.sav' near offset 0xd8: Integer format indicated by system file (3) differs from expected ($[2]).
2406 Variable,Description,Position
2413 AT_SETUP([bad machine floating-point info size])
2414 AT_KEYWORDS([sack synthetic system file negative])
2415 AT_DATA([sys-file.sack], [dnl
2417 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2418 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2420 dnl Numeric variable, no label or missing values.
2421 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2423 dnl Machine floating-point info record.
2424 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2426 dnl Character encoding record.
2427 7; 20; 1; 12; "windows-1252";
2429 dnl End of dictionary.
2432 for variant in be le; do
2433 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2434 AT_DATA([sys-file.sps], [dnl
2435 GET FILE='sys-file.sav'.
2437 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2438 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 4 has bad count 4 (expected 3)."
2443 AT_SETUP([wrong special floating point values])
2444 AT_KEYWORDS([sack synthetic system file negative])
2445 AT_DATA([sys-file.sack], [dnl
2447 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2448 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2450 dnl Numeric variable, no label or missing values.
2451 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2453 dnl Machine floating-point info record.
2454 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2456 dnl Character encoding record.
2457 7; 20; 1; 12; "windows-1252";
2459 dnl End of dictionary.
2462 for variant in be le; do
2463 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2464 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2466 AT_CHECK([pspp -O format=csv sys-file.sps | sed 's/ [(].*/.../'], [0], [dnl
2467 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 0...
2469 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 1...
2471 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 2...
2476 AT_SETUP([bad mrsets name])
2477 AT_KEYWORDS([sack synthetic system file negative multiple response])
2478 AT_DATA([sys-file.sack], [dnl
2480 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2482 16; dnl Nominal case size
2483 0; dnl Not compressed
2487 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2491 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2492 2; 0; 0; 0; 0x050800 *2; s8 "B";
2493 2; 0; 0; 0; 0x050800 *2; s8 "C";
2496 2; 0; 0; 0; 0x050800 *2; s8 "D";
2497 2; 0; 0; 0; 0x050800 *2; s8 "E";
2498 2; 0; 0; 0; 0x050800 *2; s8 "F";
2499 2; 0; 0; 0; 0x050800 *2; s8 "G";
2502 2; 4; 0; 0; 0x010400 *2; s8 "H";
2503 2; 4; 0; 0; 0x010400 *2; s8 "I";
2504 2; 4; 0; 0; 0x010400 *2; s8 "J";
2507 2; 0; 0; 0; 0x050800 *2; s8 "K";
2508 2; 0; 0; 0; 0x050800 *2; s8 "L";
2509 2; 0; 0; 0; 0x050800 *2; s8 "M";
2512 2; 6; 0; 0; 0x010600 *2; s8 "N";
2513 2; 6; 0; 0; 0x010600 *2; s8 "O";
2514 2; 6; 0; 0; 0x010600 *2; s8 "P";
2516 dnl Machine integer info record.
2517 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2521 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
2522 "b=D2 55 0 g e f d"; i8 10;
2523 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
2527 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
2528 "e=E 11 6 choice 0 n o p"; i8 10);
2530 dnl Character encoding record.
2531 7; 20; 1; 9; "shift_jis";
2533 dnl Dictionary termination record.
2536 for variant in be le; do
2537 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2538 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2539 MRSETS /DISPLAY NAME=ALL.
2541 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2542 warning: `sys-file.sav': Multiple response set name `b' does not begin with `$'.
2544 warning: `sys-file.sav': Multiple response set name `e' does not begin with `$'.
2546 Table: Multiple Response Sets
2547 Name,Variables,Details
2551 ","Multiple category set
2557 ","Multiple dichotomy set
2559 Label source: Provided by user
2561 Category label source: Variable labels
2566 ","Multiple dichotomy set
2567 Label: third mdgroup
2568 Label source: Provided by user
2570 Category label source: Value labels of counted value
2576 AT_SETUP([missing space after C in mrsets])
2577 AT_KEYWORDS([sack synthetic system file negative multiple response])
2578 AT_DATA([sys-file.sack], [dnl
2580 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2581 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2583 dnl Numeric variable, no label or missing values.
2584 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2586 dnl Multiple response sets.
2587 7; 7; 1; COUNT("$a=Cx");
2589 dnl Character encoding record.
2590 7; 20; 1; 12; "windows-1252";
2594 for variant in be le; do
2595 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2596 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2598 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2599 warning: `sys-file.sav' near offset 0xd8: Missing space following `C' at offset 4 in MRSETS record.
2604 AT_SETUP([missing space after E in mrsets])
2605 AT_KEYWORDS([sack synthetic system file negative multiple response])
2606 AT_DATA([sys-file.sack], [dnl
2608 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2609 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2611 dnl Numeric variable, no label or missing values.
2612 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2614 dnl Multiple response sets.
2615 7; 7; 1; COUNT("$a=Ex");
2617 dnl Character encoding record.
2618 7; 20; 1; 12; "windows-1252";
2622 for variant in be le; do
2623 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2624 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2626 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2627 warning: `sys-file.sav' near offset 0xd8: Missing space following `E' at offset 4 in MRSETS record.
2632 AT_SETUP([unexpected label source in mrsets])
2633 AT_KEYWORDS([sack synthetic system file negative multiple response])
2634 AT_DATA([sys-file.sack], [dnl
2636 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2637 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2639 dnl Numeric variable, no label or missing values.
2640 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2642 dnl Multiple response sets.
2643 7; 7; 1; COUNT("$a=E 2");
2645 dnl Character encoding record.
2646 7; 20; 1; 12; "windows-1252";
2650 for variant in be le; do
2651 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2652 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2654 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2655 warning: `sys-file.sav' near offset 0xd8: Unexpected label source value following `E' at offset 7 in MRSETS record.
2657 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 7 in MRSETS record.
2662 AT_SETUP([bad type character in mrsets])
2663 AT_KEYWORDS([sack synthetic system file negative multiple response])
2664 AT_DATA([sys-file.sack], [dnl
2666 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2667 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2669 dnl Numeric variable, no label or missing values.
2670 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2672 dnl Multiple response sets.
2673 7; 7; 1; COUNT("$a=");
2675 dnl Character encoding record.
2676 7; 20; 1; 12; "windows-1252";
2680 for variant in be le; do
2681 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2682 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2684 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2685 "warning: `sys-file.sav' near offset 0xd8: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2690 AT_SETUP([bad counted string length in mrsets])
2691 AT_KEYWORDS([sack synthetic system file negative multiple response])
2692 AT_DATA([sys-file.sack], [dnl
2694 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2695 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2697 dnl Numeric variable, no label or missing values.
2698 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2700 dnl Multiple response sets.
2701 7; 7; 1; COUNT("$a=Dx");
2703 dnl Character encoding record.
2704 7; 20; 1; 12; "windows-1252";
2708 for variant in be le; do
2709 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2710 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2712 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2713 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 4 in MRSETS record.
2718 AT_SETUP([missing space in counted string in mrsets])
2719 AT_KEYWORDS([sack synthetic system file negative multiple response])
2720 AT_DATA([sys-file.sack], [dnl
2722 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2723 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2725 dnl Numeric variable, no label or missing values.
2726 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2728 dnl Multiple response sets.
2729 7; 7; 1; COUNT("$a=D1x");
2731 dnl Character encoding record.
2732 7; 20; 1; 12; "windows-1252";
2736 for variant in be le; do
2737 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2738 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2740 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2741 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 5 in MRSETS record.
2746 AT_SETUP([counted string too long in mrsets])
2747 AT_KEYWORDS([sack synthetic system file negative multiple response])
2748 AT_DATA([sys-file.sack], [dnl
2750 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2751 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2753 dnl Numeric variable, no label or missing values.
2754 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2756 dnl Multiple response sets.
2757 7; 7; 1; COUNT("$a=D4 abc");
2759 dnl Character encoding record.
2760 7; 20; 1; 12; "windows-1252";
2764 for variant in be le; do
2765 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2766 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2768 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2769 warning: `sys-file.sav' near offset 0xd8: 4-byte string starting at offset 6 exceeds record length 9.
2774 AT_SETUP([missing space after counted string in mrsets])
2775 AT_KEYWORDS([sack synthetic system file negative multiple response])
2776 AT_DATA([sys-file.sack], [dnl
2778 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2779 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2781 dnl Numeric variable, no label or missing values.
2782 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2784 dnl Multiple response sets.
2785 7; 7; 1; COUNT("$a=D3 abcx");
2787 dnl Character encoding record.
2788 7; 20; 1; 12; "windows-1252";
2792 for variant in be le; do
2793 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2794 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2796 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2797 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 9 following 3-byte string.
2802 AT_SETUP([missing newline after variable name in mrsets])
2803 AT_KEYWORDS([sack synthetic system file negative multiple response])
2804 AT_DATA([sys-file.sack], [dnl
2806 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2807 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2809 dnl Numeric variable, no label or missing values.
2810 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2812 dnl Multiple response sets.
2813 7; 7; 1; COUNT("$a=C 0 NUM1");
2815 dnl Character encoding record.
2816 7; 20; 1; 12; "windows-1252";
2820 for variant in be le; do
2821 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2822 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2824 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2825 warning: `sys-file.sav' near offset 0xd8: Missing new-line parsing variable names at offset 13 in MRSETS record.
2827 warning: `sys-file.sav': MRSET $a has only one variable.
2832 AT_SETUP([duplicate variable name in mrsets])
2833 AT_KEYWORDS([sack synthetic system file negative multiple response])
2834 AT_DATA([sys-file.sack], [dnl
2836 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2837 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2839 dnl Numeric variable, no label or missing values.
2840 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2842 dnl Multiple response sets.
2843 7; 7; 1; COUNT("$a=C 0 NUM1 NUM1"; i8 10);
2845 dnl Character encoding record.
2846 7; 20; 1; 12; "windows-1252";
2850 for variant in be le; do
2851 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2852 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2854 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2855 warning: `sys-file.sav': MRSET $a contains duplicate variable name NUM1.
2857 warning: `sys-file.sav': MRSET $a has only one variable.
2862 AT_SETUP([mixed variable types in mrsets])
2863 AT_KEYWORDS([sack synthetic system file negative multiple response])
2864 AT_DATA([sys-file.sack], [dnl
2866 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2867 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2870 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2871 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2873 dnl Multiple response sets.
2874 7; 7; 1; COUNT("$a=C 0 NUM1 STR1"; i8 10);
2876 dnl Character encoding record.
2877 7; 20; 1; 12; "windows-1252";
2881 for variant in be le; do
2882 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2883 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2885 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2886 warning: `sys-file.sav': MRSET $a contains both string and numeric variables.
2888 warning: `sys-file.sav': MRSET $a has only one variable.
2893 AT_SETUP([missing newline after variable name in mrsets])
2894 AT_KEYWORDS([sack synthetic system file negative multiple response])
2895 AT_DATA([sys-file.sack], [dnl
2897 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2898 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2900 dnl Numeric variable, no label or missing values.
2901 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2903 dnl Multiple response sets.
2904 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10);
2906 dnl Character encoding record.
2907 7; 20; 1; 12; "windows-1252";
2911 for variant in be le; do
2912 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2913 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2915 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2916 warning: `sys-file.sav': MRSET $a has only one variable.
2921 AT_SETUP([zero or one variable in mrset])
2922 AT_KEYWORDS([sack synthetic system file negative multiple response])
2923 AT_DATA([sys-file.sack], [dnl
2925 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2926 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2928 dnl Numeric variable, no label or missing values.
2929 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2931 dnl Multiple response sets.
2932 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10; "$b=C 0 "; i8 10);
2934 dnl Character encoding record.
2935 7; 20; 1; 12; "windows-1252";
2939 for variant in be le; do
2940 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2941 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2943 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2944 warning: `sys-file.sav': MRSET $a has only one variable.
2946 warning: `sys-file.sav': MRSET $b has no variables.
2951 AT_SETUP([wrong display parameter size])
2952 AT_KEYWORDS([sack synthetic system file negative])
2953 AT_DATA([sys-file.sack], [dnl
2955 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2956 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2958 dnl Numeric variable, no label or missing values.
2959 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2961 dnl Display parameters record.
2962 7; 11; >>8<<; 2; 1.0; 1.0;
2964 dnl Character encoding record.
2965 7; 20; 1; 12; "windows-1252";
2967 dnl End of dictionary.
2970 for variant in be le; do
2971 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2972 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2974 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2975 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 11 has bad size 8 (expected 4)."
2980 AT_SETUP([wrong display parameter count])
2981 AT_KEYWORDS([sack synthetic system file negative])
2982 AT_DATA([sys-file.sack], [dnl
2984 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2985 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2987 dnl Numeric variable, no label or missing values.
2988 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2990 dnl Display parameters record.
2991 7; 11; 4; >>4<<; 1; 1; 2; 2;
2993 dnl Character encoding record.
2994 7; 20; 1; 12; "windows-1252";
2996 dnl End of dictionary.
2999 for variant in be le; do
3000 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3001 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3003 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3004 warning: `sys-file.sav' near offset 0xd8: Extension 11 has bad count 4 (for 1 variables).
3009 AT_SETUP([wrong display measurement level])
3010 AT_KEYWORDS([sack synthetic system file negative])
3011 AT_DATA([sys-file.sack], [dnl
3013 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3014 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3016 dnl Numeric variable, no label or missing values.
3017 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3019 dnl Display parameters record.
3020 7; 11; 4; 2; >>4<<; 0;
3022 dnl Character encoding record.
3023 7; 20; 1; 12; "windows-1252";
3025 dnl End of dictionary.
3028 for variant in be le; do
3029 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3030 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3032 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3033 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
3038 AT_SETUP([wrong display alignment])
3039 AT_KEYWORDS([sack synthetic system file negative])
3040 AT_DATA([sys-file.sack], [dnl
3042 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3043 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3045 dnl Numeric variable, no label or missing values.
3046 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3048 dnl Display parameters record.
3049 7; 11; 4; 2; 1; >>-1<<;
3051 dnl Character encoding record.
3052 7; 20; 1; 12; "windows-1252";
3054 dnl End of dictionary.
3057 for variant in be le; do
3058 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3059 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3061 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3062 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
3067 AT_SETUP([bad variable name in variable/value pair])
3068 AT_KEYWORDS([sack synthetic system file negative])
3069 AT_DATA([sys-file.sack], [dnl
3071 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3072 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3074 dnl Numeric variables.
3075 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
3077 dnl Long variable names.
3078 7; 13; 1; COUNT (>>"xyzzy"<<);
3080 dnl Character encoding record.
3081 7; 20; 1; 12; "windows-1252";
3083 dnl Dictionary termination record.
3086 for variant in be le; do
3087 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3088 AT_DATA([sys-file.sps], [dnl
3089 GET FILE='sys-file.sav'.
3091 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3092 warning: `sys-file.sav' near offset 0xde: Dictionary record refers to unknown variable xyzzy.
3097 AT_SETUP([duplicate long variable name])
3098 AT_KEYWORDS([sack synthetic system file negative])
3099 AT_DATA([sys-file.sack], [dnl
3101 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3102 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3104 dnl Numeric variables.
3105 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
3106 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
3107 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
3108 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
3110 dnl Long variable names.
3112 "LONGVARI=_Invalid"; i8 9;
3113 "LONGVARI=$Invalid"; i8 9;
3114 "LONGVARI=#Invalid"; i8 9;
3115 "LONGVA_A=LongVariableName"; i8 9;
3116 "LONGVA_B=LONGVARIABLENAME"; i8 9;
3119 dnl Character encoding record.
3120 7; 20; 1; 12; "windows-1252";
3122 dnl Dictionary termination record.
3125 for variant in be le; do
3126 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3127 AT_DATA([sys-file.sps], [dnl
3128 GET FILE='sys-file.sav'.
3130 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3131 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
3133 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `$Invalid'.
3135 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `#Invalid'.
3137 warning: `sys-file.sav' near offset 0x138: Duplicate long variable name `LONGVARIABLENAME'.
3142 AT_SETUP([bad very long string length])
3143 AT_KEYWORDS([sack synthetic system file negative])
3144 AT_DATA([sys-file.sack], [dnl
3146 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3147 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3149 dnl Numeric variable.
3150 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3152 dnl Very long string map.
3154 "NUM1=00000"; i8 0; i8 9;
3155 "NUM1=00255"; i8 0; i8 9;
3156 "NUM1=00256"; i8 0; i8 9;
3159 dnl Character encoding record.
3160 7; 20; 1; 12; "windows-1252";
3162 dnl Dictionary termination record.
3165 for variant in be le; do
3166 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3167 AT_DATA([sys-file.sps], [dnl
3168 GET FILE='sys-file.sav'.
3170 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3171 warning: `sys-file.sav' near offset 0xd8: NUM1 listed as string of invalid length 00000 in very long string record.
3173 "warning: `sys-file.sav' near offset 0xd8: NUM1 listed in very long string record with width 00255, which requires only one segment."
3175 error: `sys-file.sav' near offset 0xd8: Very long string NUM1 overflows dictionary.
3180 AT_SETUP([bad very long string segment width])
3181 AT_KEYWORDS([sack synthetic system file negative])
3182 AT_DATA([sys-file.sack], [dnl
3184 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3185 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3188 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
3189 (2; -1; 0; 0; 0; 0; s8 "") * 31;
3190 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
3191 >>2; -1; 0; 0; 0; 0; s8 "";<<
3193 dnl Very long string map.
3195 "STR1=00256"; i8 0; i8 9;
3198 dnl Character encoding record.
3199 7; 20; 1; 12; "windows-1252";
3201 dnl Dictionary termination record.
3204 for variant in be le; do
3205 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3206 AT_DATA([sys-file.sps], [dnl
3207 GET FILE='sys-file.sav'.
3209 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3210 error: `sys-file.sav' near offset 0x4f8: Very long string with width 256 has segment 1 of width 9 (expected 4).
3215 AT_SETUP([too many value labels])
3216 AT_KEYWORDS([sack synthetic system file negative])
3217 AT_DATA([sys-file.sack], [dnl
3219 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3220 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3222 dnl Numeric variable.
3223 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3226 for variant in be le; do
3227 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3228 AT_DATA([sys-file.sps], [dnl
3229 GET FILE='sys-file.sav'.
3231 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3232 error: `sys-file.sav' near offset 0xd4: Invalid number of labels 2147483647.
3237 AT_SETUP([missing type 4 record])
3238 AT_KEYWORDS([sack synthetic system file negative])
3239 AT_DATA([sys-file.sack], [dnl
3241 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3242 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3244 dnl Numeric variable.
3245 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3247 dnl Value label with missing type 4 record.
3248 3; 1; 1.0; i8 3; s7 "one";
3250 dnl Character encoding record.
3251 7; 20; 1; 12; "windows-1252";
3253 dnl End of dictionary.
3256 for variant in be le; do
3257 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3258 AT_DATA([sys-file.sps], [dnl
3259 GET FILE='sys-file.sav'.
3261 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3262 error: `sys-file.sav' near offset 0xe8: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
3267 AT_SETUP([value label with no associated variables])
3268 AT_KEYWORDS([sack synthetic system file negative])
3269 AT_DATA([sys-file.sack], [dnl
3271 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3272 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3274 dnl Numeric variable.
3275 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3277 dnl Value label with no variables.
3278 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
3280 for variant in be le; do
3281 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3282 AT_DATA([sys-file.sps], [dnl
3283 GET FILE='sys-file.sav'.
3285 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3286 error: `sys-file.sav' near offset 0xec: Number of variables associated with a value label (0) is not between 1 and the number of variables (1).
3291 AT_SETUP([type 4 record names long string variable])
3292 AT_KEYWORDS([sack synthetic system file negative])
3293 AT_DATA([sys-file.sack], [dnl
3295 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3296 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3298 dnl Long string variable.
3299 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3300 2; -1; 0; 0; 0; 0; s8 "";
3302 dnl Value label that names long string variable.
3303 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
3305 dnl Character encoding record.
3306 7; 20; 1; 12; "windows-1252";
3308 dnl End of dictionary.
3311 for variant in be le; do
3312 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3313 AT_DATA([sys-file.sps], [dnl
3314 GET FILE='sys-file.sav'.
3316 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3317 error: `sys-file.sav' near offset 0xf4: Value labels may not be added to long string variables (e.g. STR1) using records types 3 and 4.
3322 AT_SETUP([variables for value label must all be same type])
3323 AT_KEYWORDS([sack synthetic system file negative])
3324 AT_DATA([sys-file.sack], [dnl
3326 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3327 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3330 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3331 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3333 dnl Value label that names numeric and string variables.
3334 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
3336 dnl Character encoding record.
3337 7; 20; 1; 12; "windows-1252";
3339 dnl End of dictionary.
3342 for variant in be le; do
3343 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3344 AT_DATA([sys-file.sps], [dnl
3345 GET FILE='sys-file.sav'.
3347 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3348 "error: `sys-file.sav' near offset 0xf4: Variables associated with value label are not all of identical type. Variable STR1 is string, but variable NUM1 is numeric."
3353 AT_SETUP([duplicate value labels type])
3354 AT_KEYWORDS([sack synthetic system file negative])
3355 AT_DATA([sys-file.sack], [dnl
3357 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3358 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3361 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3362 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3364 dnl Duplicate value labels.
3365 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
3366 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
3368 dnl Character encoding record.
3369 7; 20; 1; 12; "windows-1252";
3371 dnl End of dictionary.
3374 for variant in be le; do
3375 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3376 AT_DATA([sys-file.sps], [dnl
3377 GET FILE='sys-file.sav'.
3379 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3380 warning: `sys-file.sav' near offset 0xf4: Duplicate value label for `xyzzy ' on STR1.
3382 warning: `sys-file.sav' near offset 0x11c: Duplicate value label for 1 on NUM1.
3387 AT_SETUP([missing attribute value])
3388 AT_KEYWORDS([sack synthetic system file negative])
3389 AT_DATA([sys-file.sack], [dnl
3391 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3392 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3395 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3397 dnl Data file attributes record.
3402 dnl Variable attributes record.
3408 dnl Character encoding record.
3409 7; 20; 1; 12; "windows-1252";
3411 dnl Dictionary termination record.
3414 for variant in be le; do
3415 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3416 AT_DATA([sys-file.sps], [dnl
3417 GET FILE='sys-file.sav'.
3419 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3420 warning: `sys-file.sav' near offset 0xde: Error parsing attribute value Attr1[[1]].
3422 warning: `sys-file.sav' near offset 0x101: Error parsing attribute value fred[[2]].
3427 AT_SETUP([unquoted attribute value])
3428 AT_KEYWORDS([sack synthetic system file negative])
3429 AT_DATA([sys-file.sack], [dnl
3431 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3432 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3435 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3437 dnl Data file attributes record.
3439 "Attr1(value"; i8 10;
3443 dnl Variable attributes record.
3446 "fred(23"; i8 10; ")"
3449 dnl Character encoding record.
3450 7; 20; 1; 12; "windows-1252";
3452 dnl Dictionary termination record.
3455 for variant in be le; do
3456 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3457 AT_DATA([sys-file.sps], [dnl
3458 GET FILE='sys-file.sav'.
3460 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3461 warning: `sys-file.sav' near offset 0xe4: Attribute value Attr1[[1]] is not quoted: value.
3463 warning: `sys-file.sav' near offset 0x106: Attribute value fred[[1]] is not quoted: 23.
3468 AT_SETUP([bad variable name in long string value label])
3469 AT_KEYWORDS([sack synthetic system file negative])
3470 AT_DATA([sys-file.sack], [dnl
3472 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3473 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3476 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3477 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3478 2; -1; 0; 0; 0; 0; s8 "";
3481 dnl No variable named STR9.
3482 COUNT(>>"STR9"<<); 9;
3483 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3485 dnl NUM1 is numeric.
3486 COUNT(>>"NUM1"<<); 0;
3487 1; COUNT("xyz"); COUNT("value label for 1.0");
3489 dnl Wrong width for STR14.
3490 COUNT("STR14"); >>9<<;
3491 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3493 dnl Wrong width for value.
3495 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3497 dnl Duplicate value label.
3498 COUNT("STR14"); 14; 2;
3499 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3500 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3503 dnl Character encoding record.
3504 7; 20; 1; 12; "windows-1252";
3506 dnl Dictionary termination record.
3509 for variant in be le; do
3510 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3511 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3513 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3514 warning: `sys-file.sav' near offset 0x128: Ignoring long string value label record for unknown variable STR9.
3516 warning: `sys-file.sav' near offset 0x164: Ignoring long string value label record for numeric variable NUM1.
3518 warning: `sys-file.sav' near offset 0x193: Ignoring long string value label record for variable STR14 because the record's width (9) does not match the variable's width (14).
3520 "warning: `sys-file.sav' near offset 0x1d4: Ignoring long string value label 0 for variable str14, with width 14, that has bad value width 9."
3522 warning: `sys-file.sav' near offset 0x259: Duplicate value label for `abcdefghijklmn' on str14.
3527 AT_SETUP([fewer data records than indicated by file header])
3528 AT_KEYWORDS([sack synthetic system file negative])
3529 AT_DATA([sys-file.sack], [dnl
3531 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3532 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3534 dnl Numeric variables.
3535 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3536 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3538 dnl Character encoding record.
3539 7; 20; 1; 12; "windows-1252";
3547 dnl Missing record here.
3549 for variant in be le; do
3550 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3551 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3554 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3555 [error: Error reading case from file `sys-file.sav'.
3567 AT_SETUP([partial data record between variables])
3568 AT_KEYWORDS([sack synthetic system file negative])
3569 AT_DATA([sys-file.sack], [dnl
3571 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3572 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3574 dnl Numeric variables.
3575 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3576 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3578 dnl Character encoding record.
3579 7; 20; 1; 12; "windows-1252";
3586 for variant in be le; do
3587 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3588 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3591 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3592 [error: `sys-file.sav' near offset 0x12c: File ends in partial case.
3601 AT_SETUP([partial data record within long string])
3602 AT_KEYWORDS([sack synthetic system file negative])
3603 AT_DATA([sys-file.sack], [dnl
3605 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3606 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3608 dnl Numeric variables.
3609 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3610 2; -1; 0; 0; 0; 0; s8 "";
3612 dnl Character encoding record.
3613 7; 20; 1; 12; "windows-1252";
3617 s14 "one data item";
3620 for variant in be le; do
3621 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3622 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3625 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3626 [error: `sys-file.sav' near offset 0x12a: Unexpected end of file.
3635 AT_SETUP([partial compressed data record])
3636 AT_KEYWORDS([sack synthetic system file positive])
3637 AT_DATA([sys-file.sack], [dnl
3639 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3641 6; dnl Nominal case size
3644 -1; dnl Unspecified number of cases.
3646 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3649 dnl Numeric variables.
3650 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3651 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3653 dnl String variable.
3654 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3655 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3656 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3657 2; -1; 0; 0; 0; 0; s8 "";
3659 dnl Character encoding record.
3660 7; 20; 1; 12; "windows-1252";
3662 dnl Dictionary termination record.
3665 dnl Compressed data.
3666 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3668 for variant in be le; do
3669 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3670 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3673 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3674 [error: `sys-file.sav' near offset 0x1ac: File ends in partial case.
3677 num1,num2,str4,str8,str15
3678 -99,0,,abcdefgh,0123 @&t@
3683 AT_SETUP([zcompressed data - bad zheader_ofs])
3684 AT_KEYWORDS([sack synthetic system file negative zlib])
3685 zcompressed_sack | sed 's/.*zheader_ofs.*/>>i64 0<<;/' > sys-file.sack
3686 for variant in be le; do
3687 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3688 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3690 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Wrong ZLIB data header offset 0 (expected 0x194).
3695 AT_SETUP([zcompressed data - bad ztrailer_ofs])
3696 AT_KEYWORDS([sack synthetic system file negative zlib])
3697 zcompressed_sack | sed 's/.*ztrailer_ofs.*/>>i64 0<<;/' > sys-file.sack
3698 for variant in be le; do
3699 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3700 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3702 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Impossible ZLIB trailer offset 0x0.
3707 # ztrailer_len must be a multiple of 24 and at least 48,
3708 # so a value of 12 is impossible.
3709 AT_SETUP([zcompressed data - invalid ztrailer_len])
3710 AT_KEYWORDS([sack synthetic system file negative zlib])
3711 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 12<<;/' > sys-file.sack
3712 for variant in be le; do
3713 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3714 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3716 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Invalid ZLIB trailer length 12.
3721 # ztrailer_ofs + ztrailer_len must be the file size.
3722 AT_SETUP([zcompressed data - wrong ztrailer_len])
3723 AT_KEYWORDS([sack synthetic system file negative zlib])
3724 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 72<<;/' > sys-file.sack
3725 for variant in be le; do
3726 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3727 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3729 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [warning: `sys-file.sav' near offset 0x1ac: End of ZLIB trailer (0x24d) is not file size (0x235).
3730 error: `sys-file.sav' near offset 0x21d: 72-byte ZLIB trailer specifies 1 data blocks (expected 2).
3735 AT_SETUP([zcompressed data - wrong ztrailer_bias])
3736 AT_KEYWORDS([sack synthetic system file negative zlib])
3737 zcompressed_sack | sed 's/.*ztrailer_bias.*/>>i64 0<<;/' > sys-file.sack
3738 for variant in be le; do
3739 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3740 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3742 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x20d: ZLIB trailer bias (0) differs from file header bias (100.00).
3747 AT_SETUP([zcompressed data - wrong ztrailer_zero])
3748 AT_KEYWORDS([sack synthetic system file negative zlib])
3749 zcompressed_sack | sed 's/.*ztrailer_zero.*/>>i64 100<<;/' > sys-file.sack
3750 for variant in be le; do
3751 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3752 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3754 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x215: ZLIB trailer "zero" field has nonzero value 100.
3759 AT_SETUP([zcompressed data - wrong block_size])
3760 AT_KEYWORDS([sack synthetic system file negative zlib])
3761 zcompressed_sack | sed 's/.*block_size.*/>>0x1000<<;/' > sys-file.sack
3762 for variant in be le; do
3763 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3764 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3766 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x219: ZLIB trailer specifies unexpected 4096-byte block size.
3771 AT_SETUP([zcompressed data - wrong n_blocks])
3772 AT_KEYWORDS([sack synthetic system file negative zlib])
3773 zcompressed_sack | sed 's/.*n_blocks.*/>>2<<;/' > sys-file.sack
3774 for variant in be le; do
3775 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3776 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3778 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x21d: 48-byte ZLIB trailer specifies 2 data blocks (expected 1).
3783 AT_SETUP([zcompressed data - wrong uncompressed_ofs])
3784 AT_KEYWORDS([sack synthetic system file negative zlib])
3785 zcompressed_sack | sed 's/.*uncompressed_ofs.*/i64 >>0x177<<;/' > sys-file.sack
3786 for variant in be le; do
3787 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3788 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3790 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x21d: ZLIB block descriptor 0 reported uncompressed data offset 0x177, when 0x194 was expected.
3795 AT_SETUP([zcompressed data - wrong compressed_ofs])
3796 AT_KEYWORDS([sack synthetic system file negative zlib])
3797 zcompressed_sack | sed 's/.*@%:@ compressed_ofs.*/i64 >>0x191<<;/' > sys-file.sack
3798 for variant in be le; do
3799 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3800 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3802 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x21d: ZLIB block descriptor 0 reported compressed data offset 0x191, when 0x1ac was expected.
3807 AT_SETUP([zcompressed data - compressed sizes don't add up])
3808 AT_KEYWORDS([sack synthetic system file negative zlib])
3809 AT_DATA([sys-file.sack], [dnl
3811 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3813 6; dnl Nominal case size
3814 2; dnl zlib compressed
3816 -1; dnl Unspecified number of cases.
3818 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3821 dnl Numeric variables.
3822 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3823 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3825 dnl String variable.
3826 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3827 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3828 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3829 2; -1; 0; 0; 0; 0; s8 "";
3831 dnl Character encoding record.
3832 7; 20; 1; 12; "windows-1252";
3834 dnl Dictionary termination record.
3837 dnl ZLIB data header.
3838 i64 0x194; # zheader_ofs
3839 i64 0x1ac; # ztrailer_ofs
3840 i64 72; # ztrailer_len
3842 dnl This is where the ZLIB data blocks would go, but we don't need any to
3843 dnl provoke this message so we omit them.
3845 dnl ZLIB data trailer fixed header:
3846 i64 -100; # ztrailer_bias
3847 i64 0; # ztrailer_zero
3848 0x3ff000; # block_size
3851 dnl ZLIB block descriptor 1:
3852 i64 0x194; # uncompressed_ofs
3853 i64 0x1ac; # compressed_ofs
3854 0x100000; # uncompressed_size
3855 0x12345; # compressed_size
3857 dnl ZLIB block descriptor 2:
3858 i64 0x100194; # uncompressed_ofs
3859 i64 0x12421; # compressed_ofs
3860 0x100000; # uncompressed_size
3861 0x12345; # compressed_size
3863 for variant in be le; do
3864 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3865 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3867 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [warning: `sys-file.sav' near offset 0x1c4: ZLIB block descriptor 0 reported block size 0x100000, when 0x3ff000 was expected.
3868 error: `sys-file.sav' near offset 0x1dc: ZLIB block descriptor 1 reported compressed data offset 0x12421, when 0x124f1 was expected.
3873 AT_SETUP([zcompressed data - uncompressed_size > block_size])
3874 AT_KEYWORDS([sack synthetic system file negative zlib])
3875 zcompressed_sack | sed 's/.*uncompressed_size.*/>>0x400000<<;/' > sys-file.sack
3876 for variant in be le; do
3877 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3878 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3880 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x21d: ZLIB block descriptor 0 reported block size 0x400000, when at most 0x3ff000 was expected.
3885 AT_SETUP([zcompressed data - compression expands data too much])
3886 AT_KEYWORDS([sack synthetic system file negative zlib])
3887 zcompressed_sack | sed 's/.*uncompressed_size.*/>>50<<;/
3888 s/.*@%:@ compressed_size.*/>>100<<;/' > sys-file.sack
3889 for variant in be le; do
3890 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3891 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3893 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x21d: ZLIB block descriptor 0 reports compressed size 100 and uncompressed size 50.
3898 AT_SETUP([zcompressed data - compressed sizes don't add up])
3899 AT_KEYWORDS([sack synthetic system file negative zlib])
3900 zcompressed_sack | sed 's/.*@%:@ compressed_size.*/>>88<<;/' > sys-file.sack
3901 for variant in be le; do
3902 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3903 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3905 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x235: ZLIB trailer is at offset 0x205 but 0x204 would be expected from block descriptors.
3911 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467004.
3912 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
3913 # See also https://security-tracker.debian.org/tracker/CVE-2017-10791.
3914 # Found by team OWL337, using the collAFL fuzzer.
3915 AT_SETUP([integer overflows in long string missing values])
3916 AT_KEYWORDS([system file negative])
3917 cp $top_srcdir/tests/data/CVE-2017-10791.sav .
3918 AT_CHECK([pspp-convert -O csv -e ASCII CVE-2017-10791.sav -], [0], [], [dnl
3919 `CVE-2017-10791.sav' near offset 0x217: Extension record subtype 21 ends unexpectedly.
3924 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467005.
3925 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
3926 # See also https://security-tracker.debian.org/tracker/CVE-2017-10792.
3927 # Reported by team OWL337, with fuzzer collAFL.
3928 AT_SETUP([null dereference skipping bad extension record 18])
3929 AT_KEYWORDS([system file negative])
3930 cp $top_srcdir/tests/data/CVE-2017-10792.sav .
3931 AT_CHECK([pspp-convert -O csv -e ASCII CVE-2017-10792.sav -], [0], [], [dnl
3932 `CVE-2017-10792.sav' near offset 0x1c0: Record type 7, subtype 18 has bad size 4 (expected 1).