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([multiple response sets])
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 16; dnl Nominal case size
594 0; dnl Not compressed
598 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
602 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
603 2; 0; 0; 0; 0x050800 *2; s8 "B";
604 2; 0; 0; 0; 0x050800 *2; s8 "C";
607 2; 0; 0; 0; 0x050800 *2; s8 "D";
608 2; 0; 0; 0; 0x050800 *2; s8 "E";
609 2; 0; 0; 0; 0x050800 *2; s8 "F";
610 2; 0; 0; 0; 0x050800 *2; s8 "G";
613 2; 4; 0; 0; 0x010400 *2; s8 "H";
614 2; 4; 0; 0; 0x010400 *2; s8 "I";
615 2; 4; 0; 0; 0x010400 *2; s8 "J";
618 2; 0; 0; 0; 0x050800 *2; s8 "K";
619 2; 0; 0; 0; 0x050800 *2; s8 "L";
620 2; 0; 0; 0; 0x050800 *2; s8 "M";
623 2; 6; 0; 0; 0x010600 *2; s8 "N";
624 2; 6; 0; 0; 0x010600 *2; s8 "O";
625 2; 6; 0; 0; 0x010600 *2; s8 "P";
627 dnl Machine integer info record.
628 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
632 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
633 "$b=D2 55 0 g e f d"; i8 10; i8 10;
634 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
639 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
640 "$e=E 11 6 choice 0 n o p"; i8 10; i8 10; i8 10; i8 10);
642 dnl Character encoding record.
643 7; 20; 1; 9; "shift_jis";
645 dnl Dictionary termination record.
648 for variant in be le; do
649 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
650 AT_DATA([sys-file.sps], [dnl
651 GET FILE='sys-file.sav'.
652 MRSETS /DISPLAY NAME=ALL.
654 AT_CHECK([pspp -o pspp.csv sys-file.sps])
655 AT_CHECK([cat pspp.csv], [0], [dnl
656 Table: Multiple Response Sets
657 Name,Variables,Details
661 ","Multiple category set
668 ","Multiple dichotomy set
670 Category label source: Variable labels
675 ","Multiple dichotomy set
677 Label source: Provided by user
679 Category label source: Variable labels
684 ","Multiple dichotomy set
686 Label source: Provided by user
688 Category label source: Value labels of counted value
693 ","Multiple dichotomy set
694 Label source: First variable label among variables
695 Counted value: `choice'
696 Category label source: Value labels of counted value
702 dnl Also checks for handling of CR-only line ends in file label and
703 dnl extra product info.
704 AT_SETUP([extra product info])
705 AT_KEYWORDS([sack synthetic system file positive])
706 AT_DATA([sys-file.sack], [dnl
708 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
710 4; dnl Nominal case size
711 0; dnl Not compressed
715 "01 Jan 11"; "20:53:52"; "PSPP synthetic"; i8 13; s49 "test file";
718 dnl Numeric variables.
719 2; 0; 0; 0; 0x050800 *2; s8 "A";
720 2; 0; 0; 0; 0x050800 *2; s8 "B";
721 2; 0; 0; 0; 0x050800 *2; s8 "C";
722 2; 0; 0; 0; 0x050800 *2; s8 "D";
724 dnl Extra product info.
725 7; 10; 1; COUNT ("Extra product info"; i8 13; "another line"; i8 13; "blah");
727 dnl Character encoding record.
728 7; 20; 1; 12; "windows-1252";
730 dnl Dictionary termination record.
733 for variant in be le; do
734 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
735 AT_DATA([sys-file.sps], [dnl
736 SYSFILE INFO FILE='sys-file.sav'.
738 AT_CHECK([pspp -o pspp.csv sys-file.sps])
739 AT_CHECK([sed 7q pspp.csv], [0], [dnl
741 Label:,"PSPP synthetic
743 Created:,01 Jan 11 20:53:52 by $(@%:@) SPSS DATA FILE PSPP synthetic test file
744 Product:,"Extra product info
751 AT_SETUP([variable display parameters, without width])
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 19; dnl Nominal case size
758 0; dnl Not compressed
762 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic 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 Short string variables.
772 2; 3; 0; 0; 0x010300 *2; s8 "H";
773 2; 3; 0; 0; 0x010300 *2; s8 "I";
774 2; 3; 0; 0; 0x010300 *2; s8 "J";
775 2; 3; 0; 0; 0x010300 *2; s8 "K";
777 dnl Long string variables.
778 2; 9; 0; 0; 0x010900 *2; s8 "L";
779 2; -1; 0; 0; 0; 0; s8 "";
780 2; 10; 0; 0; 0x010a00 *2; s8 "M";
781 2; -1; 0; 0; 0; 0; s8 "";
782 2; 17; 0; 0; 0x011100 *2; s8 "N";
783 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
784 2; 25; 0; 0; 0x011900 *2; s8 "O";
785 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
787 dnl Variable display parameters
802 dnl Character encoding record.
803 7; 20; 1; 12; "windows-1252";
805 dnl Dictionary termination record.
808 for variant in be le; do
809 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
810 AT_DATA([sys-file.sps], [dnl
811 GET FILE='sys-file.sav'.
814 AT_CHECK([pspp -o pspp.csv sys-file.sps])
815 AT_CHECK([cat pspp.csv], [0], [dnl
816 Variable,Description,Position
819 Display Alignment: Left",1
822 Display Alignment: Left",2
825 Display Alignment: Left",3
828 Display Alignment: Right",4
831 Display Alignment: Right",5
834 Display Alignment: Right",6
837 Display Alignment: Center",7
840 Display Alignment: Center",8
843 Display Alignment: Center",9
846 Display Alignment: Left",10
849 Display Alignment: Right",11
852 Display Alignment: Center",12
857 AT_SETUP([variable display parameters, with width])
858 AT_KEYWORDS([sack synthetic system file positive])
859 AT_DATA([sys-file.sack], [dnl
861 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
863 19; dnl Nominal case size
864 0; dnl Not compressed
868 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
871 dnl Numeric variables.
872 2; 0; 0; 0; 0x050800 *2; s8 "A";
873 2; 0; 0; 0; 0x050800 *2; s8 "B";
874 2; 0; 0; 0; 0x050800 *2; s8 "C";
875 2; 0; 0; 0; 0x050800 *2; s8 "D";
877 dnl Short string variables.
878 2; 3; 0; 0; 0x010300 *2; s8 "H";
879 2; 3; 0; 0; 0x010300 *2; s8 "I";
880 2; 3; 0; 0; 0x010300 *2; s8 "J";
881 2; 3; 0; 0; 0x010300 *2; s8 "K";
883 dnl Long string variables.
884 2; 9; 0; 0; 0x010900 *2; s8 "L";
885 2; -1; 0; 0; 0; 0; s8 "";
886 2; 10; 0; 0; 0x010a00 *2; s8 "M";
887 2; -1; 0; 0; 0; 0; s8 "";
888 2; 17; 0; 0; 0x011100 *2; s8 "N";
889 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
890 2; 25; 0; 0; 0x011900 *2; s8 "O";
891 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
893 dnl Variable display parameters
908 dnl Character encoding record.
909 7; 20; 1; 12; "windows-1252";
911 dnl Dictionary termination record.
914 for variant in be le; do
915 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
916 AT_DATA([sys-file.sps], [dnl
917 GET FILE='sys-file.sav'.
920 AT_CHECK([pspp -o pspp.csv sys-file.sps])
921 AT_CHECK([cat pspp.csv], [0], [dnl
922 Variable,Description,Position
925 Display Alignment: Left
929 Display Alignment: Left
933 Display Alignment: Left
937 Display Alignment: Right
941 Display Alignment: Right
945 Display Alignment: Right
949 Display Alignment: Center
953 Display Alignment: Center
957 Display Alignment: Center
961 Display Alignment: Left
962 Display Width: 10",10
965 Display Alignment: Right
966 Display Width: 11",11
969 Display Alignment: Center
970 Display Width: 12",12
975 AT_SETUP([long variable names])
976 AT_KEYWORDS([sack synthetic system file positive])
977 AT_DATA([sys-file.sack], [dnl
979 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
981 7; dnl Nominal case size
982 0; dnl Not compressed
986 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
989 dnl Numeric variables.
990 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
991 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
992 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
993 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
994 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDINA";
995 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_A";
996 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_B";
998 dnl Machine integer info record.
999 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1001 dnl Machine floating-point info record.
1002 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
1004 dnl Long variable names.
1006 "LONGVARI=LongVariableName1"; i8 9;
1007 "LONGVA_A=LongVariableName2"; i8 9;
1008 "LONGVA_B=LongVariableName3"; i8 9;
1009 "LONGVA_C=LongVariableName4"; i8 9;
1010 "CO"; i8 214; "RDINA=Co"; i8 246; "rdinate_X"; i8 9;
1011 "CO"; i8 214; "RDI_A=Co"; i8 246; "rdinate_Y"; i8 9;
1012 "CO"; i8 214; "RDI_B=Co"; i8 246; "rdinate_Z";
1015 dnl Character encoding record.
1016 7; 20; 1; 12; "windows-1252";
1018 dnl Dictionary termination record.
1021 for variant in be le; do
1022 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1023 AT_DATA([sys-file.sps], [dnl
1024 GET FILE='sys-file.sav'.
1027 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1028 AT_CHECK([cat pspp.csv], [0], [dnl
1029 Variable,Description,Position
1030 LongVariableName1,Format: F8.0,1
1031 LongVariableName2,Format: F8.0,2
1032 LongVariableName3,Format: F8.0,3
1033 LongVariableName4,Format: F8.0,4
1034 Coördinate_X,Format: F8.0,5
1035 Coördinate_Y,Format: F8.0,6
1036 Coördinate_Z,Format: F8.0,7
1041 AT_SETUP([very long strings])
1042 AT_KEYWORDS([sack synthetic system file positive])
1043 AT_DATA([sys-file.sack], [dnl
1045 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1047 109; dnl Nominal case size
1048 0; dnl Not compressed
1052 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1055 dnl 256-byte string.
1056 2; 255; 0; 0; 0x01FF00 *2; "S"; i8 201; s6 "Q256";
1057 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1058 2; 4; 0; 0; 0x010400 *2; "S"; i8 201; "Q256_1";
1060 dnl 600-byte string.
1061 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600";
1062 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1063 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600_1";
1064 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1065 2; 96; 0; 0; 0x016000 *2; s8 "STR600_2";
1066 (2; -1; 0; 0; 0; 0; s8 "") * 11;
1068 dnl Machine integer info record.
1069 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1071 dnl Very long string record.
1073 "S"; i8 201; "Q256=00256"; i8 0; i8 9;
1074 "STR600=00600"; i8 0; i8 9;
1077 dnl Character encoding record.
1078 7; 20; 1; 12; "windows-1252";
1080 dnl Dictionary termination record.
1084 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 4;
1086 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 9;
1087 "abcdefghijklmnopqrstuvwxyzABCDEF";
1089 for variant in be le; do
1090 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1091 AT_DATA([sys-file.sps], [dnl
1092 GET FILE='sys-file.sav'.
1096 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1097 AT_CHECK([cat pspp.csv], [0], [dnl
1098 Variable,Description,Position
1099 séq256,Format: A256,1
1100 str600,Format: A600,2
1104 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@a,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyz
1109 AT_SETUP([data file and variable attributes])
1110 AT_KEYWORDS([sack synthetic system file positive])
1111 AT_DATA([sys-file.sack], [dnl
1113 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1115 3; dnl Nominal case size
1116 0; dnl Not compressed
1120 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1124 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
1125 2; 0; 0; 0; 0x050800 *2; s8 "SECONDVA";
1126 2; 0; 0; 0; 0x050800 *2; s8 "THIRDVAR";
1128 dnl Machine integer info record.
1129 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1131 dnl Long variable names.
1133 "FIRSTVAR=FirstVariable"; i8 9;
1134 "SECONDVA=S"; i8 233; "condVariable"; i8 9;
1135 "THIRDVAR=ThirdVariable"; i8 9
1138 dnl Data file attributes record.
1140 "Attr1('Value1'"; i8 10; "''d"; i8 233; "claration''"; i8 10; ")";
1141 "S"; i8 233; "condAttr('123'"; i8 10; "'456'"; i8 10; ")";
1144 dnl Variable attributes record.
1147 "ad"; i8 232; "le('23'"; i8 10; "'34'"; i8 10; ")";
1148 "bert('123'"; i8 10; ")";
1149 "$@Role('1'"; i8 10; ")";
1150 "/S"; i8 233; "condVariable:";
1151 "xyzzy('quux'"; i8 10; ")";
1154 dnl Another variable attributes record.
1155 dnl Only system files written by "Stata 14.1/-savespss- 1.77 by S.Radyakin"
1156 dnl include multiple variable attributes records.
1157 7; 18; 1; COUNT ("ThirdVariable:fizz('buzz'"; i8 10; ")";);
1159 dnl Character encoding record.
1160 7; 20; 1; 12; "windows-1252";
1162 dnl Dictionary termination record.
1165 for variant in be le; do
1166 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1167 AT_DATA([sys-file.sps], [dnl
1168 GET FILE='sys-file.sav'.
1169 DISPLAY @ATTRIBUTES.
1171 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1172 AT_CHECK([cat pspp.csv], [0],
1173 [[Variable,Description
1174 FirstVariable,"Attribute,Value
1179 SécondVariable,"Attribute,Value
1181 ThirdVariable,"Attribute,Value
1184 Table: Custom data file attributes.
1187 Attr1[2],'déclaration'
1191 AT_DATA([sys-file.sps], [dnl
1192 GET FILE='sys-file.sav'.
1195 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1196 AT_CHECK([cat pspp.csv], [0],
1197 [[Variable,Description,Position
1198 FirstVariable,"Format: F8.0
1205 SécondVariable,"Format: F8.0
1210 ThirdVariable,"Format: F8.0
1216 Table: Custom data file attributes.
1219 Attr1[2],'déclaration'
1226 AT_SETUP([variable roles])
1227 AT_KEYWORDS([sack synthetic system file positive])
1228 AT_DATA([sys-file.sack], [dnl
1230 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1232 7; dnl Nominal case size
1233 0; dnl Not compressed
1237 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1241 2; 0; 0; 0; 0x050800 *2; s8 "I";
1242 2; 0; 0; 0; 0x050800 *2; s8 "O";
1243 2; 0; 0; 0; 0x050800 *2; s8 "B";
1244 2; 0; 0; 0; 0x050800 *2; s8 "N";
1245 2; 0; 0; 0; 0x050800 *2; s8 "P";
1246 2; 0; 0; 0; 0x050800 *2; s8 "S";
1247 2; 0; 0; 0; 0x050800 *2; s8 "X";
1249 dnl Machine integer info record.
1250 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1252 dnl Variable attributes record.
1254 "I:$@Role('0'"; i8 10; ")";
1255 "/O:$@Role('1'"; i8 10; ")";
1256 "/B:$@Role('2'"; i8 10; ")";
1257 "/N:$@Role('3'"; i8 10; ")";
1258 "/P:$@Role('4'"; i8 10; ")";
1259 "/S:$@Role('5'"; i8 10; ")";
1260 "/X:$@Role('6'"; i8 10; ")";
1263 dnl Character encoding record.
1264 7; 20; 1; 12; "windows-1252";
1266 dnl Dictionary termination record.
1269 for variant in be le; do
1270 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1271 AT_DATA([sys-file.sps], [dnl
1272 GET FILE='sys-file.sav'.
1275 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [dnl
1276 warning: `sys-file.sav': Invalid role for variable x.
1278 AT_CHECK([cat pspp.csv], [0], [dnl
1279 warning: `sys-file.sav': Invalid role for variable x.
1281 Variable,Description,Position
1300 AT_SETUP([compressed data])
1301 AT_KEYWORDS([sack synthetic system file positive])
1302 AT_DATA([sys-file.sack], [dnl
1304 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1306 6; dnl Nominal case size
1307 1; dnl Simple compression
1309 -1; dnl Unspecified number of cases.
1311 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1314 dnl Numeric variables.
1315 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1316 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1318 dnl String variable.
1319 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1320 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1321 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1322 2; -1; 0; 0; 0; 0; s8 "";
1324 dnl Character encoding record.
1325 7; 20; 1; 12; "windows-1252";
1327 dnl Dictionary termination record.
1330 dnl Compressed data.
1331 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1332 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1333 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1334 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1337 for variant in be le; do
1338 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1339 AT_DATA([sys-file.sps], [dnl
1340 GET FILE='sys-file.sav'.
1344 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1345 AT_CHECK([cat pspp.csv], [0], [dnl
1346 Variable,Description,Position
1354 num1,num2,str4,str8,str15
1355 -99,0,,abcdefgh,0123 @&t@
1356 .,151,jklm,nopqrstu,vwxyzABC @&t@
1357 1,2,DEFG,HIJKLMNO,PQRSTUV
1362 AT_SETUP([compressed data, zero bias])
1363 AT_KEYWORDS([sack synthetic system file positive])
1364 AT_DATA([sys-file.sack], [dnl
1366 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1368 6; dnl Nominal case size
1369 1; dnl Simple compression.
1371 -1; dnl Unspecified number of cases.
1373 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1376 dnl Numeric variables.
1377 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1378 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1380 dnl String variable.
1381 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1382 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1383 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1384 2; -1; 0; 0; 0; 0; s8 "";
1386 dnl Character encoding record.
1387 7; 20; 1; 12; "windows-1252";
1389 dnl Dictionary termination record.
1392 dnl Compressed data.
1393 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1394 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1395 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1396 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1399 for variant in be le; do
1400 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1401 AT_DATA([sys-file.sps], [dnl
1402 GET FILE='sys-file.sav'.
1406 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1407 AT_CHECK([cat pspp.csv], [0], [dnl
1408 Variable,Description,Position
1416 num1,num2,str4,str8,str15
1417 1,100,,abcdefgh,0123 @&t@
1418 .,251,jklm,nopqrstu,vwxyzABC @&t@
1419 101,102,DEFG,HIJKLMNO,PQRSTUV
1424 AT_SETUP([compressed data, other bias])
1425 AT_KEYWORDS([sack synthetic system file positive])
1426 AT_DATA([sys-file.sack], [dnl
1428 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1430 6; dnl Nominal case size
1431 1; dnl Simple compression.
1433 -1; dnl Unspecified number of cases.
1435 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1438 dnl Numeric variables.
1439 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1440 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1442 dnl String variable.
1443 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1444 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1445 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1446 2; -1; 0; 0; 0; 0; s8 "";
1448 dnl Character encoding record.
1449 7; 20; 1; 12; "windows-1252";
1451 dnl Dictionary termination record.
1454 dnl Compressed data.
1455 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1456 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1457 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1458 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1461 for variant in be le; do
1462 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1463 AT_DATA([sys-file.sps], [dnl
1464 GET FILE='sys-file.sav'.
1468 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0],
1469 [warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1471 AT_CHECK([cat pspp.csv], [0], [dnl
1472 "warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1474 Variable,Description,Position
1482 num1,num2,str4,str8,str15
1483 -49,50,,abcdefgh,0123 @&t@
1484 .,201,jklm,nopqrstu,vwxyzABC @&t@
1485 51,52,DEFG,HIJKLMNO,PQRSTUV
1490 m4_divert_push([PREPARE_TESTS])
1491 zcompressed_sack () {
1494 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1496 6; dnl Nominal case size
1497 2; dnl zlib compressed
1499 -1; dnl Unspecified number of cases.
1501 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1504 dnl Numeric variables.
1505 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1506 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1508 dnl String variable.
1509 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1510 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1511 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1512 2; -1; 0; 0; 0; 0; s8 "";
1514 dnl Character encoding record.
1515 7; 20; 1; 12; "windows-1252";
1517 dnl Dictionary termination record.
1520 dnl ZLIB data header.
1521 i64 0x194; # zheader_ofs
1522 i64 0x205; # ztrailer_ofs
1523 i64 48; # ztrailer_len
1525 dnl ZLIB data block.
1527 dnl This is the compressed form of:
1529 dnl 01 64 fe fd fe fd ff fb 61 62 63 64 65 66 67 68 |.d......abcdefgh|
1530 dnl 30 31 32 33 20 20 20 20 fd fd fd fe 65 66 fd fd |0123 ....ef..|
1531 dnl 6a 6b 6c 6d 20 20 20 20 6e 6f 70 71 72 73 74 75 |jklm nopqrstu|
1532 dnl 76 77 78 79 7a 41 42 43 44 45 46 47 20 20 20 20 |vwxyzABCDEFG |
1533 dnl 48 49 4a 4b 4c 4d 4e 4f fe fd fc 00 00 00 00 00 |HIJKLMNO........|
1534 dnl 50 51 52 53 54 55 56 57 |PQRSTUVW|
1536 dnl which is the data from the "compressed data" test.
1537 hex "78 01 63 4c f9 f7 f7 df df ff bf 13 93 92 53 52";
1538 hex "d3 d2 33 0c 0c 8d 8c 15 80 e0 ef df bf ff 52 d3";
1539 hex "fe fe cd ca ce c9 05 f1 f3 f2 0b 0a 8b 8a 4b 4a";
1540 hex "cb ca 2b 2a ab 1c 9d 9c 5d 5c dd dc 41 e2 1e 9e";
1541 hex "5e de 3e be 7e fe ff fe fe 61 00 81 80 c0 a0 e0";
1542 hex "90 d0 b0 70 00 0f 3f 23 d7";
1544 dnl ZLIB data trailer fixed header:
1545 i64 -100; # ztrailer_bias
1546 i64 0; # ztrailer_zero
1547 0x3ff000; # block_size
1550 dnl ZLIB block descriptor:
1551 i64 0x194; # uncompressed_ofs
1552 i64 0x1ac; # compressed_ofs
1553 88; # uncompressed_size
1554 89; # compressed_size
1557 m4_divert_pop([PREPARE_TESTS])
1559 AT_SETUP([zcompressed data])
1560 AT_KEYWORDS([sack synthetic system file positive zlib])
1561 zcompressed_sack > sys-file.sack
1562 for variant in be le; do
1563 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1564 AT_DATA([sys-file.sps], [dnl
1565 GET FILE='sys-file.sav'.
1569 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1570 AT_CHECK([cat pspp.csv], [0], [dnl
1571 Variable,Description,Position
1579 num1,num2,str4,str8,str15
1580 -99,0,,abcdefgh,0123 @&t@
1581 .,151,jklm,nopqrstu,vwxyzABC @&t@
1582 1,2,DEFG,HIJKLMNO,PQRSTUV
1587 AT_BANNER([system file reader - negative])
1589 AT_SETUP([no variables])
1590 AT_KEYWORDS([sack synthetic system file negative])
1591 AT_DATA([sys-file.sack], [dnl
1593 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1595 0; dnl Nominal case size (empty)
1596 0; dnl Not compressed
1600 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1603 dnl Character encoding record.
1604 7; 20; 1; 12; "windows-1252";
1606 dnl Dictionary termination record.
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'.
1614 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1615 sys-file.sps:1: error: GET: `sys-file.sav': Data file dictionary has no variables.
1618 dnl At one point pspp-convert would hang forever if there were no variables,
1619 dnl so check against regression.
1620 AT_CHECK([pspp-convert sys-file.sav sys-file.txt])
1621 AT_CHECK([cat sys-file.txt], [0], [
1626 AT_SETUP([unspecified character encoding])
1627 AT_KEYWORDS([sack synthetic system file positive])
1628 AT_DATA([sys-file.sack], [dnl
1630 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1632 4; dnl Nominal case size
1633 0; dnl Not compressed
1637 "01 Jan 11"; "20:53:52";
1638 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1641 dnl Numeric variables.
1642 2; 0; 0; 0; 0x050800 *2; s8 "A";
1643 2; 0; 0; 0; 0x050800 *2; s8 "B";
1644 2; 0; 0; 0; 0x050800 *2; s8 "C";
1645 2; 0; 0; 0; 0x050800 *2; s8 "D";
1647 dnl Dictionary termination record.
1650 for variant in be le; do
1651 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1652 AT_DATA([sys-file.sps], [dnl
1655 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [stdout])
1656 AT_CHECK([sed 's/default encoding.*For/default encoding. For/' stdout], [0], [dnl
1657 "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."
1662 AT_SETUP([misplaced type 4 record])
1663 AT_KEYWORDS([sack synthetic system file negative])
1664 AT_DATA([sys-file.sack], [dnl
1666 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1667 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1669 dnl Numeric variable.
1670 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1675 for variant in be le; do
1676 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1677 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1679 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1680 [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1685 AT_SETUP([bad record type])
1686 AT_KEYWORDS([sack synthetic system file negative])
1687 AT_DATA([sys-file.sack], [dnl
1689 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1690 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1692 dnl Numeric variable.
1693 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1695 dnl Type 8 record (not a valid type).
1698 for variant in be le; do
1699 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1700 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1702 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1703 [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1708 AT_SETUP([wrong number of variable positions])
1709 AT_KEYWORDS([sack synthetic system file negative])
1710 AT_DATA([sys-file.sack], [dnl
1712 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1713 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1715 dnl Numeric variable.
1716 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1718 dnl Character encoding record.
1719 7; 20; 1; 12; "windows-1252";
1721 dnl End of dictionary.
1724 for variant in be le; do
1725 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1726 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1728 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1729 [warning: `sys-file.sav': File header claims 2 variable positions but 1 were read from file.
1734 AT_SETUP([variable name may not begin with `#'])
1735 AT_KEYWORDS([sack synthetic system file negative])
1736 AT_DATA([sys-file.sack], [dnl
1738 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1739 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1741 dnl Numeric variable.
1742 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1744 dnl Character encoding record.
1745 7; 20; 1; 12; "windows-1252";
1747 dnl End of dictionary.
1750 for variant in be le; do
1751 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1752 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1754 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1755 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `$UM1'.
1760 AT_SETUP([variable name may not be reserved word])
1761 AT_KEYWORDS([sack synthetic system file negative])
1762 AT_DATA([sys-file.sack], [dnl
1764 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1765 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1767 dnl Numeric variable.
1768 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1770 dnl Character encoding record.
1771 7; 20; 1; 12; "windows-1252";
1773 dnl End of dictionary.
1776 for variant in be le; do
1777 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1778 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1780 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1781 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `TO'.
1786 AT_SETUP([variable width must be between 0 and 255])
1787 AT_KEYWORDS([sack synthetic system file negative])
1788 AT_DATA([sys-file.sack], [dnl
1790 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1791 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1793 dnl String variable with invalid width 256.
1794 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1796 dnl Character encoding record.
1797 7; 20; 1; 12; "windows-1252";
1799 dnl End of dictionary.
1802 for variant in be le; do
1803 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1804 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1806 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1807 [error: `sys-file.sav' near offset 0xb4: Bad width 256 for variable VAR1.
1812 dnl SPSS-generated system file can contain duplicate variable names
1813 dnl (see bug #41475).
1814 AT_SETUP([duplicate variable name])
1815 AT_KEYWORDS([sack synthetic system file negative])
1816 AT_DATA([sys-file.sack], [dnl
1818 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1819 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1821 dnl Numeric variables.
1822 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1823 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1825 dnl Character encoding record.
1826 7; 20; 1; 12; "windows-1252";
1828 dnl End of dictionary.
1831 for variant in be le; do
1832 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1833 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1836 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1837 [warning: `sys-file.sav' near offset 0xd4: Renaming variable with duplicate name `VAR1' to `VAR001'.
1839 Variable,Description,Position
1841 var001,Format: F8.0,2
1846 AT_SETUP([variable label indicator not 0 or 1])
1847 AT_KEYWORDS([sack synthetic system file negative])
1848 AT_DATA([sys-file.sack], [dnl
1850 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1851 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1853 dnl Numeric variable.
1854 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1856 dnl Character encoding record.
1857 7; 20; 1; 12; "windows-1252";
1859 dnl End of dictionary.
1862 for variant in be le; do
1863 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1864 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1866 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1867 [error: `sys-file.sav' near offset 0xb4: Variable label indicator field is not 0 or 1.
1872 AT_SETUP([invalid numeric missing value indicator])
1873 AT_KEYWORDS([sack synthetic system file negative])
1874 AT_DATA([sys-file.sack], [dnl
1876 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1877 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1879 dnl Numeric variable.
1880 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1882 dnl Character encoding record.
1883 7; 20; 1; 12; "windows-1252";
1885 dnl End of dictionary.
1888 for variant in be le; do
1889 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1890 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1892 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1893 ["error: `sys-file.sav' near offset 0xb4: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1898 AT_SETUP([invalid string missing value indicator])
1899 AT_KEYWORDS([sack synthetic system file negative])
1900 AT_DATA([sys-file.sack], [dnl
1902 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1903 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1905 dnl String variable.
1906 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1908 dnl Character encoding record.
1909 7; 20; 1; 12; "windows-1252";
1911 dnl End of dictionary.
1914 for variant in be le; do
1915 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1916 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1918 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1919 ["error: `sys-file.sav' near offset 0xb4: String missing value indicator field is not 0, 1, 2, or 3."
1924 AT_SETUP([missing string continuation record])
1925 AT_KEYWORDS([sack synthetic system file negative])
1926 AT_DATA([sys-file.sack], [dnl
1928 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1929 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1931 dnl String variable.
1932 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1933 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
1935 dnl Character encoding record.
1936 7; 20; 1; 12; "windows-1252";
1938 dnl End of dictionary.
1941 for variant in be le; do
1942 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1943 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1945 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1946 [error: `sys-file.sav' near offset 0xb4: Missing string continuation record.
1951 AT_SETUP([invalid variable format])
1952 AT_KEYWORDS([sack synthetic system file negative])
1953 AT_DATA([sys-file.sack], [dnl
1955 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1956 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1958 dnl Numeric variable, invalid format types.
1959 dnl No warning is issued for type 0 because it has been observed in real
1961 2; 0; 0; 0; >>0xff0800; 0<<; s8 "NUM1";
1963 dnl Numeric variable, string formats.
1964 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
1966 dnl String variable, numeric formats.
1967 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
1969 dnl String variable, wrong width formats.
1970 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
1972 dnl Character encoding record.
1973 7; 20; 1; 12; "windows-1252";
1975 dnl End of dictionary.
1978 for variant in be le; do
1979 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1980 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1982 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1983 warning: `sys-file.sav' near offset 0xc0: Variable NUM1 with width 0 has invalid print format 0xff0800.
1985 warning: `sys-file.sav' near offset 0xe0: Variable VAR1 with width 0 has invalid print format 0x10800.
1987 warning: `sys-file.sav' near offset 0xe4: Variable VAR1 with width 0 has invalid write format 0x21000.
1989 warning: `sys-file.sav' near offset 0x100: Variable STR1 with width 4 has invalid print format 0x50800.
1991 warning: `sys-file.sav' near offset 0x104: Variable STR1 with width 4 has invalid write format 0x110a01.
1993 warning: `sys-file.sav' near offset 0x120: Variable STR2 with width 4 has invalid print format 0x10800.
1995 warning: `sys-file.sav' near offset 0x124: Variable STR2 with width 4 has invalid write format 0x20400.
2000 AT_SETUP([invalid long string missing values])
2001 AT_KEYWORDS([sack synthetic system file negative])
2002 AT_DATA([sys-file.sack], [dnl
2004 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2006 7; dnl Nominal case size
2007 0; dnl Not compressed
2011 "01 Jan 11"; "20:53:52";
2012 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
2015 dnl One numeric variable.
2016 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2018 dnl Long string variables that will have missing values added with a
2020 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2021 2; -1; 0; 0; 0; 0; s8 "";
2022 2; 10; 0; 0; 0x010a00 *2; s8 "STR2";
2023 2; -1; 0; 0; 0; 0; s8 "";
2024 2; 11; 0; 0; 0x010b00 *2; s8 "STR3";
2025 2; -1; 0; 0; 0; 0; s8 "";
2027 dnl Machine integer info record.
2028 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
2030 dnl Machine floating-point info record.
2031 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
2033 dnl Long string variable missing values record.
2035 dnl Zero missing values (not allowed) for STR1 .
2036 COUNT("STR1"); i8 >>0<<;
2038 dnl Four missing values (not allowed) for STR2.
2039 COUNT("STR2"); i8 4;
2040 8; "abcdefgh"; 8; "ijklmnop"; 8; "qrstuvwx"; 8; "yz012345";
2042 dnl Missing values for unknown variable
2043 COUNT(>>"Nonexistent"<<); i8 1; 8; "abcdefgh";
2045 dnl Missing values for numeric variable
2046 COUNT(>>"NUM1"<<); i8 1; 8; "abcdefgh";
2048 dnl Too long missing value
2049 COUNT("STR3"); i8 1; >>COUNT("abcdefghijkl")<<;
2052 dnl Character encoding record.
2053 7; 20; 1; 12; "windows-1252";
2055 dnl Dictionary termination record.
2057 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
2058 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
2059 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
2062 for variant in be le; do
2063 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2064 AT_DATA([sys-file.sps], [dnl
2065 GET FILE='sys-file.sav'.
2068 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2069 ["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."
2071 "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."
2073 warning: `sys-file.sav' near offset 0x242: Ignoring long string missing value record for unknown variable Nonexistent.
2075 warning: `sys-file.sav' near offset 0x257: Ignoring long string missing value record for numeric variable NUM1.
2077 "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."
2079 Variable,Description,Position
2083 Missing Values: ""abcdefgh""; ""ijklmnop""; ""qrstuvwx""",3
2089 AT_SETUP([weighting variable must be numeric])
2090 AT_KEYWORDS([sack synthetic system file negative])
2091 AT_DATA([sys-file.sack], [dnl
2093 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2094 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2096 dnl Numeric variable.
2097 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2099 dnl String variable.
2100 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2102 dnl Character encoding record.
2103 7; 20; 1; 12; "windows-1252";
2105 dnl End of dictionary.
2108 for variant in be le; do
2109 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2110 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2113 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2114 [warning: `sys-file.sav': Ignoring string variable `STR1' set as weighting variable.
2116 Variable,Description,Position
2123 AT_SETUP([bad weighting variable index])
2124 AT_KEYWORDS([sack synthetic system file negative])
2125 AT_DATA([sys-file.sack], [dnl
2127 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2128 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2130 dnl Numeric variable.
2131 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2133 dnl String variable.
2134 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2136 dnl Character encoding record.
2137 7; 20; 1; 12; "windows-1252";
2139 dnl End of dictionary.
2142 for variant in be le; do
2143 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2144 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2146 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2147 [error: `sys-file.sav' near offset 0x4c: Variable index 3 not in valid range 1...2.
2152 AT_SETUP([variable index is long string contination])
2153 AT_KEYWORDS([sack synthetic system file negative])
2154 AT_DATA([sys-file.sack], [dnl
2156 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2157 2; 3; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2159 dnl Numeric variable.
2160 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2162 dnl Long string variable.
2163 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2164 (2; -1; 0; 0; 0; 0; s8 "");
2166 dnl Character encoding record.
2167 7; 20; 1; 12; "windows-1252";
2169 dnl End of dictionary.
2172 for variant in be le; do
2173 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2174 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2176 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2177 [error: `sys-file.sav' near offset 0x4c: Variable index 3 refers to long string continuation.
2182 AT_SETUP([multiple documents records])
2183 AT_KEYWORDS([sack synthetic system file negative])
2184 AT_DATA([sys-file.sack], [dnl
2186 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2187 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2189 dnl Numeric variable, no label or missing values.
2190 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2192 dnl Two document records.
2193 (6; 1; s80 "One line of documents") >>* 2<<;
2195 dnl Dictionary termination record.
2198 dnl Character encoding record.
2199 7; 20; 1; 12; "windows-1252";
2204 for variant in be le; do
2205 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2206 AT_DATA([sys-file.sps], [dnl
2207 GET FILE='sys-file.sav'.
2209 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2210 error: `sys-file.sav' near offset 0x12c: Duplicate type 6 (document) record.
2216 AT_SETUP([empty document record])
2217 AT_KEYWORDS([sack synthetic system file negative])
2218 AT_DATA([sys-file.sack], [dnl
2220 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2221 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2223 dnl Numeric variable, no label or missing values.
2224 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2226 dnl Empty document record.
2229 dnl Dictionary termination record.
2235 for variant in be le; do
2236 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2237 AT_DATA([sys-file.sps], [dnl
2238 GET FILE='sys-file.sav'.
2240 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2241 error: `sys-file.sav' near offset 0xd4: Number of document lines (0) must be greater than 0 and less than 26843545.
2246 AT_SETUP([extension record too large])
2247 AT_KEYWORDS([sack synthetic system file negative])
2248 AT_DATA([sys-file.sack], [dnl
2250 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2251 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2253 dnl Numeric variable, no label or missing values.
2254 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2256 dnl Too-large extension record.
2257 7; 3; >>0xfffff000 * 2<<;
2259 for variant in be le; do
2260 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2261 AT_DATA([sys-file.sps], [dnl
2262 GET FILE='sys-file.sav'.
2264 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2265 error: `sys-file.sav' near offset 0xd8: Record type 7 subtype 3 too large.
2270 AT_SETUP([unknown extension record])
2271 AT_KEYWORDS([sack synthetic system file negative])
2272 AT_DATA([sys-file.sack], [dnl
2274 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2275 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2277 dnl Numeric variable, no label or missing values.
2278 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2280 dnl Unknown extension record type.
2283 dnl Character encoding record.
2284 7; 20; 1; 12; "windows-1252";
2286 dnl End of dictionary.
2289 for variant in be le; do
2290 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2291 AT_DATA([sys-file.sps], [dnl
2292 GET FILE='sys-file.sav'.
2294 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2295 "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}."
2300 AT_SETUP([bad machine integer info size])
2301 AT_KEYWORDS([sack synthetic system file negative])
2302 AT_DATA([sys-file.sack], [dnl
2304 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2305 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2307 dnl Numeric variable, no label or missing values.
2308 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2310 dnl Machine integer info record.
2311 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252; >>1234<<;
2313 dnl Character encoding record.
2314 7; 20; 1; 12; "windows-1252";
2316 dnl End of dictionary.
2319 for variant in be le; do
2320 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2321 AT_DATA([sys-file.sps], [dnl
2322 GET FILE='sys-file.sav'.
2324 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2325 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 3 has bad count 9 (expected 8)."
2330 AT_SETUP([bad machine integer info float format])
2331 AT_KEYWORDS([sack synthetic system file negative])
2332 AT_DATA([sys-file.sack], [dnl
2334 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2335 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2337 dnl Numeric variable, no label or missing values.
2338 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2340 dnl Machine integer info record.
2341 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
2343 dnl Character encoding record.
2344 7; 20; 1; 12; "windows-1252";
2346 dnl End of dictionary.
2349 for variant in be le; do
2350 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2351 AT_DATA([sys-file.sps], [dnl
2352 GET FILE='sys-file.sav'.
2354 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2355 error: `sys-file.sav' near offset 0xd8: Floating-point representation indicated by system file (2) differs from expected (1).
2360 AT_SETUP([bad machine integer info endianness])
2361 AT_KEYWORDS([sack synthetic system file negative])
2362 AT_DATA([sys-file.sack], [dnl
2364 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2365 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2367 dnl Numeric variable, no label or missing values.
2368 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2370 dnl Machine integer info record.
2371 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
2373 dnl Character encoding record.
2374 7; 20; 1; 12; "windows-1252";
2376 dnl End of dictionary.
2379 for variant in "be 1" "le 2"; do
2381 AT_CHECK([sack --$[1] sys-file.sack > sys-file.sav])
2382 AT_DATA([sys-file.sps], [dnl
2383 GET FILE='sys-file.sav'.
2386 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2387 warning: \`sys-file.sav' near offset 0xd8: Integer format indicated by system file (3) differs from expected ($[2]).
2389 Variable,Description,Position
2396 AT_SETUP([bad machine floating-point info size])
2397 AT_KEYWORDS([sack synthetic system file negative])
2398 AT_DATA([sys-file.sack], [dnl
2400 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2401 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2403 dnl Numeric variable, no label or missing values.
2404 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2406 dnl Machine floating-point info record.
2407 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2409 dnl Character encoding record.
2410 7; 20; 1; 12; "windows-1252";
2412 dnl End of dictionary.
2415 for variant in be le; do
2416 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2417 AT_DATA([sys-file.sps], [dnl
2418 GET FILE='sys-file.sav'.
2420 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2421 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 4 has bad count 4 (expected 3)."
2426 AT_SETUP([wrong special floating point values])
2427 AT_KEYWORDS([sack synthetic system file negative])
2428 AT_DATA([sys-file.sack], [dnl
2430 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2431 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2433 dnl Numeric variable, no label or missing values.
2434 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2436 dnl Machine floating-point info record.
2437 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2439 dnl Character encoding record.
2440 7; 20; 1; 12; "windows-1252";
2442 dnl End of dictionary.
2445 for variant in be le; do
2446 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2447 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2449 AT_CHECK([pspp -O format=csv sys-file.sps | sed 's/ [(].*/.../'], [0], [dnl
2450 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 0...
2452 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 1...
2454 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 2...
2459 AT_SETUP([bad mrsets name])
2460 AT_KEYWORDS([sack synthetic system file negative multiple response])
2461 AT_DATA([sys-file.sack], [dnl
2463 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2465 16; dnl Nominal case size
2466 0; dnl Not compressed
2470 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2474 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2475 2; 0; 0; 0; 0x050800 *2; s8 "B";
2476 2; 0; 0; 0; 0x050800 *2; s8 "C";
2479 2; 0; 0; 0; 0x050800 *2; s8 "D";
2480 2; 0; 0; 0; 0x050800 *2; s8 "E";
2481 2; 0; 0; 0; 0x050800 *2; s8 "F";
2482 2; 0; 0; 0; 0x050800 *2; s8 "G";
2485 2; 4; 0; 0; 0x010400 *2; s8 "H";
2486 2; 4; 0; 0; 0x010400 *2; s8 "I";
2487 2; 4; 0; 0; 0x010400 *2; s8 "J";
2490 2; 0; 0; 0; 0x050800 *2; s8 "K";
2491 2; 0; 0; 0; 0x050800 *2; s8 "L";
2492 2; 0; 0; 0; 0x050800 *2; s8 "M";
2495 2; 6; 0; 0; 0x010600 *2; s8 "N";
2496 2; 6; 0; 0; 0x010600 *2; s8 "O";
2497 2; 6; 0; 0; 0x010600 *2; s8 "P";
2499 dnl Machine integer info record.
2500 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2504 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
2505 "b=D2 55 0 g e f d"; i8 10;
2506 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
2510 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
2511 "e=E 11 6 choice 0 n o p"; i8 10);
2513 dnl Character encoding record.
2514 7; 20; 1; 9; "shift_jis";
2516 dnl Dictionary termination record.
2519 for variant in be le; do
2520 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2521 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2522 MRSETS /DISPLAY NAME=ALL.
2524 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2525 warning: `sys-file.sav': Multiple response set name `b' does not begin with `$'.
2527 warning: `sys-file.sav': Multiple response set name `e' does not begin with `$'.
2529 Table: Multiple Response Sets
2530 Name,Variables,Details
2534 ","Multiple category set
2540 ","Multiple dichotomy set
2542 Label source: Provided by user
2544 Category label source: Variable labels
2549 ","Multiple dichotomy set
2550 Label: third mdgroup
2551 Label source: Provided by user
2553 Category label source: Value labels of counted value
2559 AT_SETUP([missing space after C in mrsets])
2560 AT_KEYWORDS([sack synthetic system file negative multiple response])
2561 AT_DATA([sys-file.sack], [dnl
2563 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2564 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2566 dnl Numeric variable, no label or missing values.
2567 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2569 dnl Multiple response sets.
2570 7; 7; 1; COUNT("$a=Cx");
2572 dnl Character encoding record.
2573 7; 20; 1; 12; "windows-1252";
2577 for variant in be le; do
2578 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2579 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2581 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2582 warning: `sys-file.sav' near offset 0xd8: Missing space following `C' at offset 4 in MRSETS record.
2587 AT_SETUP([missing space after E in mrsets])
2588 AT_KEYWORDS([sack synthetic system file negative multiple response])
2589 AT_DATA([sys-file.sack], [dnl
2591 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2592 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2594 dnl Numeric variable, no label or missing values.
2595 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2597 dnl Multiple response sets.
2598 7; 7; 1; COUNT("$a=Ex");
2600 dnl Character encoding record.
2601 7; 20; 1; 12; "windows-1252";
2605 for variant in be le; do
2606 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2607 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2609 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2610 warning: `sys-file.sav' near offset 0xd8: Missing space following `E' at offset 4 in MRSETS record.
2615 AT_SETUP([unexpected label source in mrsets])
2616 AT_KEYWORDS([sack synthetic system file negative multiple response])
2617 AT_DATA([sys-file.sack], [dnl
2619 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2620 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2622 dnl Numeric variable, no label or missing values.
2623 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2625 dnl Multiple response sets.
2626 7; 7; 1; COUNT("$a=E 2");
2628 dnl Character encoding record.
2629 7; 20; 1; 12; "windows-1252";
2633 for variant in be le; do
2634 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2635 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2637 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2638 warning: `sys-file.sav' near offset 0xd8: Unexpected label source value following `E' at offset 7 in MRSETS record.
2640 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 7 in MRSETS record.
2645 AT_SETUP([bad type character in mrsets])
2646 AT_KEYWORDS([sack synthetic system file negative multiple response])
2647 AT_DATA([sys-file.sack], [dnl
2649 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2650 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2652 dnl Numeric variable, no label or missing values.
2653 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2655 dnl Multiple response sets.
2656 7; 7; 1; COUNT("$a=");
2658 dnl Character encoding record.
2659 7; 20; 1; 12; "windows-1252";
2663 for variant in be le; do
2664 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2665 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2667 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2668 "warning: `sys-file.sav' near offset 0xd8: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2673 AT_SETUP([bad counted string length in mrsets])
2674 AT_KEYWORDS([sack synthetic system file negative multiple response])
2675 AT_DATA([sys-file.sack], [dnl
2677 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2678 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2680 dnl Numeric variable, no label or missing values.
2681 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2683 dnl Multiple response sets.
2684 7; 7; 1; COUNT("$a=Dx");
2686 dnl Character encoding record.
2687 7; 20; 1; 12; "windows-1252";
2691 for variant in be le; do
2692 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2693 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2695 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2696 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 4 in MRSETS record.
2701 AT_SETUP([missing space in counted string in mrsets])
2702 AT_KEYWORDS([sack synthetic system file negative multiple response])
2703 AT_DATA([sys-file.sack], [dnl
2705 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2706 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2708 dnl Numeric variable, no label or missing values.
2709 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2711 dnl Multiple response sets.
2712 7; 7; 1; COUNT("$a=D1x");
2714 dnl Character encoding record.
2715 7; 20; 1; 12; "windows-1252";
2719 for variant in be le; do
2720 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2721 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2723 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2724 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 5 in MRSETS record.
2729 AT_SETUP([counted string too long in mrsets])
2730 AT_KEYWORDS([sack synthetic system file negative multiple response])
2731 AT_DATA([sys-file.sack], [dnl
2733 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2734 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2736 dnl Numeric variable, no label or missing values.
2737 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2739 dnl Multiple response sets.
2740 7; 7; 1; COUNT("$a=D4 abc");
2742 dnl Character encoding record.
2743 7; 20; 1; 12; "windows-1252";
2747 for variant in be le; do
2748 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2749 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2751 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2752 warning: `sys-file.sav' near offset 0xd8: 4-byte string starting at offset 6 exceeds record length 9.
2757 AT_SETUP([missing space after counted string in mrsets])
2758 AT_KEYWORDS([sack synthetic system file negative multiple response])
2759 AT_DATA([sys-file.sack], [dnl
2761 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2762 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2764 dnl Numeric variable, no label or missing values.
2765 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2767 dnl Multiple response sets.
2768 7; 7; 1; COUNT("$a=D3 abcx");
2770 dnl Character encoding record.
2771 7; 20; 1; 12; "windows-1252";
2775 for variant in be le; do
2776 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2777 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2779 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2780 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 9 following 3-byte string.
2785 AT_SETUP([missing newline after variable name in mrsets])
2786 AT_KEYWORDS([sack synthetic system file negative multiple response])
2787 AT_DATA([sys-file.sack], [dnl
2789 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2790 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2792 dnl Numeric variable, no label or missing values.
2793 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2795 dnl Multiple response sets.
2796 7; 7; 1; COUNT("$a=C 0 NUM1");
2798 dnl Character encoding record.
2799 7; 20; 1; 12; "windows-1252";
2803 for variant in be le; do
2804 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2805 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2807 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2808 warning: `sys-file.sav' near offset 0xd8: Missing new-line parsing variable names at offset 13 in MRSETS record.
2810 warning: `sys-file.sav': MRSET $a has only one variable.
2815 AT_SETUP([duplicate variable name in mrsets])
2816 AT_KEYWORDS([sack synthetic system file negative multiple response])
2817 AT_DATA([sys-file.sack], [dnl
2819 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2820 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2822 dnl Numeric variable, no label or missing values.
2823 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2825 dnl Multiple response sets.
2826 7; 7; 1; COUNT("$a=C 0 NUM1 NUM1"; i8 10);
2828 dnl Character encoding record.
2829 7; 20; 1; 12; "windows-1252";
2833 for variant in be le; do
2834 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2835 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2837 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2838 warning: `sys-file.sav': MRSET $a contains duplicate variable name NUM1.
2840 warning: `sys-file.sav': MRSET $a has only one variable.
2845 AT_SETUP([mixed variable types in mrsets])
2846 AT_KEYWORDS([sack synthetic system file negative multiple response])
2847 AT_DATA([sys-file.sack], [dnl
2849 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2850 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2853 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2854 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2856 dnl Multiple response sets.
2857 7; 7; 1; COUNT("$a=C 0 NUM1 STR1"; i8 10);
2859 dnl Character encoding record.
2860 7; 20; 1; 12; "windows-1252";
2864 for variant in be le; do
2865 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2866 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2868 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2869 warning: `sys-file.sav': MRSET $a contains both string and numeric variables.
2871 warning: `sys-file.sav': MRSET $a has only one variable.
2876 AT_SETUP([missing newline after variable name in mrsets])
2877 AT_KEYWORDS([sack synthetic system file negative multiple response])
2878 AT_DATA([sys-file.sack], [dnl
2880 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2881 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2883 dnl Numeric variable, no label or missing values.
2884 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2886 dnl Multiple response sets.
2887 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10);
2889 dnl Character encoding record.
2890 7; 20; 1; 12; "windows-1252";
2894 for variant in be le; do
2895 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2896 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2898 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2899 warning: `sys-file.sav': MRSET $a has only one variable.
2904 AT_SETUP([zero or one variable in mrset])
2905 AT_KEYWORDS([sack synthetic system file negative multiple response])
2906 AT_DATA([sys-file.sack], [dnl
2908 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2909 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2911 dnl Numeric variable, no label or missing values.
2912 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2914 dnl Multiple response sets.
2915 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10; "$b=C 0 "; i8 10);
2917 dnl Character encoding record.
2918 7; 20; 1; 12; "windows-1252";
2922 for variant in be le; do
2923 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2924 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2926 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2927 warning: `sys-file.sav': MRSET $a has only one variable.
2929 warning: `sys-file.sav': MRSET $b has no variables.
2934 AT_SETUP([wrong display parameter size])
2935 AT_KEYWORDS([sack synthetic system file negative])
2936 AT_DATA([sys-file.sack], [dnl
2938 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2939 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2941 dnl Numeric variable, no label or missing values.
2942 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2944 dnl Display parameters record.
2945 7; 11; >>8<<; 2; 1.0; 1.0;
2947 dnl Character encoding record.
2948 7; 20; 1; 12; "windows-1252";
2950 dnl End of dictionary.
2953 for variant in be le; do
2954 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2955 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2957 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2958 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 11 has bad size 8 (expected 4)."
2963 AT_SETUP([wrong display parameter count])
2964 AT_KEYWORDS([sack synthetic system file negative])
2965 AT_DATA([sys-file.sack], [dnl
2967 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2968 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2970 dnl Numeric variable, no label or missing values.
2971 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2973 dnl Display parameters record.
2974 7; 11; 4; >>4<<; 1; 1; 2; 2;
2976 dnl Character encoding record.
2977 7; 20; 1; 12; "windows-1252";
2979 dnl End of dictionary.
2982 for variant in be le; do
2983 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2984 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2986 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2987 warning: `sys-file.sav' near offset 0xd8: Extension 11 has bad count 4 (for 1 variables).
2992 AT_SETUP([wrong display measurement level])
2993 AT_KEYWORDS([sack synthetic system file negative])
2994 AT_DATA([sys-file.sack], [dnl
2996 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2997 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2999 dnl Numeric variable, no label or missing values.
3000 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3002 dnl Display parameters record.
3003 7; 11; 4; 2; >>4<<; 0;
3005 dnl Character encoding record.
3006 7; 20; 1; 12; "windows-1252";
3008 dnl End of dictionary.
3011 for variant in be le; do
3012 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3013 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3015 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3016 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
3021 AT_SETUP([wrong display alignment])
3022 AT_KEYWORDS([sack synthetic system file negative])
3023 AT_DATA([sys-file.sack], [dnl
3025 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3026 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3028 dnl Numeric variable, no label or missing values.
3029 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3031 dnl Display parameters record.
3032 7; 11; 4; 2; 1; >>-1<<;
3034 dnl Character encoding record.
3035 7; 20; 1; 12; "windows-1252";
3037 dnl End of dictionary.
3040 for variant in be le; do
3041 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3042 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3044 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3045 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
3050 AT_SETUP([bad variable name in variable/value pair])
3051 AT_KEYWORDS([sack synthetic system file negative])
3052 AT_DATA([sys-file.sack], [dnl
3054 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3055 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3057 dnl Numeric variables.
3058 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
3060 dnl Long variable names.
3061 7; 13; 1; COUNT (>>"xyzzy"<<);
3063 dnl Character encoding record.
3064 7; 20; 1; 12; "windows-1252";
3066 dnl Dictionary termination record.
3069 for variant in be le; do
3070 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3071 AT_DATA([sys-file.sps], [dnl
3072 GET FILE='sys-file.sav'.
3074 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3075 warning: `sys-file.sav' near offset 0xde: Dictionary record refers to unknown variable xyzzy.
3080 AT_SETUP([duplicate long variable name])
3081 AT_KEYWORDS([sack synthetic system file negative])
3082 AT_DATA([sys-file.sack], [dnl
3084 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3085 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3087 dnl Numeric variables.
3088 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
3089 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
3090 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
3091 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
3093 dnl Long variable names.
3095 "LONGVARI=_Invalid"; i8 9;
3096 "LONGVARI=$Invalid"; i8 9;
3097 "LONGVARI=#Invalid"; i8 9;
3098 "LONGVA_A=LongVariableName"; i8 9;
3099 "LONGVA_B=LONGVARIABLENAME"; i8 9;
3102 dnl Character encoding record.
3103 7; 20; 1; 12; "windows-1252";
3105 dnl Dictionary termination record.
3108 for variant in be le; do
3109 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3110 AT_DATA([sys-file.sps], [dnl
3111 GET FILE='sys-file.sav'.
3113 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3114 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
3116 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `$Invalid'.
3118 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `#Invalid'.
3120 warning: `sys-file.sav' near offset 0x138: Duplicate long variable name `LONGVARIABLENAME'.
3125 AT_SETUP([bad very long string length])
3126 AT_KEYWORDS([sack synthetic system file negative])
3127 AT_DATA([sys-file.sack], [dnl
3129 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3130 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3132 dnl Numeric variable.
3133 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3135 dnl Very long string map.
3137 "NUM1=00000"; i8 0; i8 9;
3138 "NUM1=00255"; i8 0; i8 9;
3139 "NUM1=00256"; i8 0; i8 9;
3142 dnl Character encoding record.
3143 7; 20; 1; 12; "windows-1252";
3145 dnl Dictionary termination record.
3148 for variant in be le; do
3149 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3150 AT_DATA([sys-file.sps], [dnl
3151 GET FILE='sys-file.sav'.
3153 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3154 warning: `sys-file.sav' near offset 0xd8: NUM1 listed as string of invalid length 00000 in very long string record.
3156 "warning: `sys-file.sav' near offset 0xd8: NUM1 listed in very long string record with width 00255, which requires only one segment."
3158 error: `sys-file.sav' near offset 0xd8: Very long string NUM1 overflows dictionary.
3163 AT_SETUP([bad very long string segment width])
3164 AT_KEYWORDS([sack synthetic system file negative])
3165 AT_DATA([sys-file.sack], [dnl
3167 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3168 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3171 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
3172 (2; -1; 0; 0; 0; 0; s8 "") * 31;
3173 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
3174 >>2; -1; 0; 0; 0; 0; s8 "";<<
3176 dnl Very long string map.
3178 "STR1=00256"; i8 0; i8 9;
3181 dnl Character encoding record.
3182 7; 20; 1; 12; "windows-1252";
3184 dnl Dictionary termination record.
3187 for variant in be le; do
3188 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3189 AT_DATA([sys-file.sps], [dnl
3190 GET FILE='sys-file.sav'.
3192 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3193 error: `sys-file.sav' near offset 0x4f8: Very long string with width 256 has segment 1 of width 9 (expected 4).
3198 AT_SETUP([too many value labels])
3199 AT_KEYWORDS([sack synthetic system file negative])
3200 AT_DATA([sys-file.sack], [dnl
3202 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3203 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3205 dnl Numeric variable.
3206 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3209 for variant in be le; do
3210 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3211 AT_DATA([sys-file.sps], [dnl
3212 GET FILE='sys-file.sav'.
3214 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3215 error: `sys-file.sav' near offset 0xd4: Invalid number of labels 2147483647.
3220 AT_SETUP([missing type 4 record])
3221 AT_KEYWORDS([sack synthetic system file negative])
3222 AT_DATA([sys-file.sack], [dnl
3224 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3225 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3227 dnl Numeric variable.
3228 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3230 dnl Value label with missing type 4 record.
3231 3; 1; 1.0; i8 3; s7 "one";
3233 dnl Character encoding record.
3234 7; 20; 1; 12; "windows-1252";
3236 dnl End of dictionary.
3239 for variant in be le; do
3240 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3241 AT_DATA([sys-file.sps], [dnl
3242 GET FILE='sys-file.sav'.
3244 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3245 error: `sys-file.sav' near offset 0xe8: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
3250 AT_SETUP([value label with no associated variables])
3251 AT_KEYWORDS([sack synthetic system file negative])
3252 AT_DATA([sys-file.sack], [dnl
3254 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3255 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3257 dnl Numeric variable.
3258 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3260 dnl Value label with no variables.
3261 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
3263 for variant in be le; do
3264 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3265 AT_DATA([sys-file.sps], [dnl
3266 GET FILE='sys-file.sav'.
3268 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3269 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).
3274 AT_SETUP([type 4 record names long string variable])
3275 AT_KEYWORDS([sack synthetic system file negative])
3276 AT_DATA([sys-file.sack], [dnl
3278 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3279 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3281 dnl Long string variable.
3282 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3283 2; -1; 0; 0; 0; 0; s8 "";
3285 dnl Value label that names long string variable.
3286 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
3288 dnl Character encoding record.
3289 7; 20; 1; 12; "windows-1252";
3291 dnl End of dictionary.
3294 for variant in be le; do
3295 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3296 AT_DATA([sys-file.sps], [dnl
3297 GET FILE='sys-file.sav'.
3299 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3300 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.
3305 AT_SETUP([variables for value label must all be same type])
3306 AT_KEYWORDS([sack synthetic system file negative])
3307 AT_DATA([sys-file.sack], [dnl
3309 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3310 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3313 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3314 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3316 dnl Value label that names numeric and string variables.
3317 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
3319 dnl Character encoding record.
3320 7; 20; 1; 12; "windows-1252";
3322 dnl End of dictionary.
3325 for variant in be le; do
3326 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3327 AT_DATA([sys-file.sps], [dnl
3328 GET FILE='sys-file.sav'.
3330 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3331 "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."
3336 AT_SETUP([duplicate value labels type])
3337 AT_KEYWORDS([sack synthetic system file negative])
3338 AT_DATA([sys-file.sack], [dnl
3340 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3341 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3344 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3345 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3347 dnl Duplicate value labels.
3348 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
3349 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
3351 dnl Character encoding record.
3352 7; 20; 1; 12; "windows-1252";
3354 dnl End of dictionary.
3357 for variant in be le; do
3358 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3359 AT_DATA([sys-file.sps], [dnl
3360 GET FILE='sys-file.sav'.
3362 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3363 warning: `sys-file.sav' near offset 0xf4: Duplicate value label for `xyzzy ' on STR1.
3365 warning: `sys-file.sav' near offset 0x11c: Duplicate value label for 1 on NUM1.
3370 AT_SETUP([missing attribute value])
3371 AT_KEYWORDS([sack synthetic system file negative])
3372 AT_DATA([sys-file.sack], [dnl
3374 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3375 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3378 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3380 dnl Data file attributes record.
3385 dnl Variable attributes record.
3391 dnl Character encoding record.
3392 7; 20; 1; 12; "windows-1252";
3394 dnl Dictionary termination record.
3397 for variant in be le; do
3398 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3399 AT_DATA([sys-file.sps], [dnl
3400 GET FILE='sys-file.sav'.
3402 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3403 warning: `sys-file.sav' near offset 0xde: Error parsing attribute value Attr1[[1]].
3405 warning: `sys-file.sav' near offset 0x101: Error parsing attribute value fred[[2]].
3410 AT_SETUP([unquoted attribute value])
3411 AT_KEYWORDS([sack synthetic system file negative])
3412 AT_DATA([sys-file.sack], [dnl
3414 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3415 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3418 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3420 dnl Data file attributes record.
3422 "Attr1(value"; i8 10;
3426 dnl Variable attributes record.
3429 "fred(23"; i8 10; ")"
3432 dnl Character encoding record.
3433 7; 20; 1; 12; "windows-1252";
3435 dnl Dictionary termination record.
3438 for variant in be le; do
3439 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3440 AT_DATA([sys-file.sps], [dnl
3441 GET FILE='sys-file.sav'.
3443 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3444 warning: `sys-file.sav' near offset 0xe4: Attribute value Attr1[[1]] is not quoted: value.
3446 warning: `sys-file.sav' near offset 0x106: Attribute value fred[[1]] is not quoted: 23.
3451 AT_SETUP([bad variable name in long string value label])
3452 AT_KEYWORDS([sack synthetic system file negative])
3453 AT_DATA([sys-file.sack], [dnl
3455 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3456 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3459 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3460 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3461 2; -1; 0; 0; 0; 0; s8 "";
3464 dnl No variable named STR9.
3465 COUNT(>>"STR9"<<); 9;
3466 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3468 dnl NUM1 is numeric.
3469 COUNT(>>"NUM1"<<); 0;
3470 1; COUNT("xyz"); COUNT("value label for 1.0");
3472 dnl Wrong width for STR14.
3473 COUNT("STR14"); >>9<<;
3474 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3476 dnl Wrong width for value.
3478 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3480 dnl Duplicate value label.
3481 COUNT("STR14"); 14; 2;
3482 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3483 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3486 dnl Character encoding record.
3487 7; 20; 1; 12; "windows-1252";
3489 dnl Dictionary termination record.
3492 for variant in be le; do
3493 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3494 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3496 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3497 warning: `sys-file.sav' near offset 0x128: Ignoring long string value label record for unknown variable STR9.
3499 warning: `sys-file.sav' near offset 0x164: Ignoring long string value label record for numeric variable NUM1.
3501 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).
3503 "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."
3505 warning: `sys-file.sav' near offset 0x259: Duplicate value label for `abcdefghijklmn' on str14.
3510 AT_SETUP([fewer data records than indicated by file header])
3511 AT_KEYWORDS([sack synthetic system file negative])
3512 AT_DATA([sys-file.sack], [dnl
3514 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3515 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3517 dnl Numeric variables.
3518 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3519 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3521 dnl Character encoding record.
3522 7; 20; 1; 12; "windows-1252";
3530 dnl Missing record here.
3532 for variant in be le; do
3533 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3534 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3537 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3538 [error: Error reading case from file `sys-file.sav'.
3550 AT_SETUP([partial data record between variables])
3551 AT_KEYWORDS([sack synthetic system file negative])
3552 AT_DATA([sys-file.sack], [dnl
3554 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3555 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3557 dnl Numeric variables.
3558 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3559 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3561 dnl Character encoding record.
3562 7; 20; 1; 12; "windows-1252";
3569 for variant in be le; do
3570 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3571 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3574 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3575 [error: `sys-file.sav' near offset 0x12c: File ends in partial case.
3584 AT_SETUP([partial data record within long string])
3585 AT_KEYWORDS([sack synthetic system file negative])
3586 AT_DATA([sys-file.sack], [dnl
3588 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3589 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3591 dnl Numeric variables.
3592 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3593 2; -1; 0; 0; 0; 0; s8 "";
3595 dnl Character encoding record.
3596 7; 20; 1; 12; "windows-1252";
3600 s14 "one data item";
3603 for variant in be le; do
3604 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3605 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3608 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3609 [error: `sys-file.sav' near offset 0x12a: Unexpected end of file.
3618 AT_SETUP([partial compressed data record])
3619 AT_KEYWORDS([sack synthetic system file positive])
3620 AT_DATA([sys-file.sack], [dnl
3622 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3624 6; dnl Nominal case size
3627 -1; dnl Unspecified number of cases.
3629 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3632 dnl Numeric variables.
3633 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3634 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3636 dnl String variable.
3637 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3638 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3639 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3640 2; -1; 0; 0; 0; 0; s8 "";
3642 dnl Character encoding record.
3643 7; 20; 1; 12; "windows-1252";
3645 dnl Dictionary termination record.
3648 dnl Compressed data.
3649 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3651 for variant in be le; do
3652 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3653 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3656 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3657 [error: `sys-file.sav' near offset 0x1ac: File ends in partial case.
3660 num1,num2,str4,str8,str15
3661 -99,0,,abcdefgh,0123 @&t@
3666 AT_SETUP([zcompressed data - bad zheader_ofs])
3667 AT_KEYWORDS([sack synthetic system file negative zlib])
3668 zcompressed_sack | sed 's/.*zheader_ofs.*/>>i64 0<<;/' > sys-file.sack
3669 for variant in be le; do
3670 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3671 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3673 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).
3678 AT_SETUP([zcompressed data - bad ztrailer_ofs])
3679 AT_KEYWORDS([sack synthetic system file negative zlib])
3680 zcompressed_sack | sed 's/.*ztrailer_ofs.*/>>i64 0<<;/' > sys-file.sack
3681 for variant in be le; do
3682 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3683 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3685 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Impossible ZLIB trailer offset 0x0.
3690 # ztrailer_len must be a multiple of 24 and at least 48,
3691 # so a value of 12 is impossible.
3692 AT_SETUP([zcompressed data - invalid ztrailer_len])
3693 AT_KEYWORDS([sack synthetic system file negative zlib])
3694 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 12<<;/' > sys-file.sack
3695 for variant in be le; do
3696 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3697 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3699 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Invalid ZLIB trailer length 12.
3704 # ztrailer_ofs + ztrailer_len must be the file size.
3705 AT_SETUP([zcompressed data - wrong ztrailer_len])
3706 AT_KEYWORDS([sack synthetic system file negative zlib])
3707 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 72<<;/' > sys-file.sack
3708 for variant in be le; do
3709 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3710 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3712 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).
3713 error: `sys-file.sav' near offset 0x21d: 72-byte ZLIB trailer specifies 1 data blocks (expected 2).
3718 AT_SETUP([zcompressed data - wrong ztrailer_bias])
3719 AT_KEYWORDS([sack synthetic system file negative zlib])
3720 zcompressed_sack | sed 's/.*ztrailer_bias.*/>>i64 0<<;/' > sys-file.sack
3721 for variant in be le; do
3722 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3723 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3725 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).
3730 AT_SETUP([zcompressed data - wrong ztrailer_zero])
3731 AT_KEYWORDS([sack synthetic system file negative zlib])
3732 zcompressed_sack | sed 's/.*ztrailer_zero.*/>>i64 100<<;/' > sys-file.sack
3733 for variant in be le; do
3734 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3735 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3737 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.
3742 AT_SETUP([zcompressed data - wrong block_size])
3743 AT_KEYWORDS([sack synthetic system file negative zlib])
3744 zcompressed_sack | sed 's/.*block_size.*/>>0x1000<<;/' > sys-file.sack
3745 for variant in be le; do
3746 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3747 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3749 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.
3754 AT_SETUP([zcompressed data - wrong n_blocks])
3755 AT_KEYWORDS([sack synthetic system file negative zlib])
3756 zcompressed_sack | sed 's/.*n_blocks.*/>>2<<;/' > sys-file.sack
3757 for variant in be le; do
3758 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3759 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3761 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).
3766 AT_SETUP([zcompressed data - wrong uncompressed_ofs])
3767 AT_KEYWORDS([sack synthetic system file negative zlib])
3768 zcompressed_sack | sed 's/.*uncompressed_ofs.*/i64 >>0x177<<;/' > sys-file.sack
3769 for variant in be le; do
3770 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3771 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3773 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.
3778 AT_SETUP([zcompressed data - wrong compressed_ofs])
3779 AT_KEYWORDS([sack synthetic system file negative zlib])
3780 zcompressed_sack | sed 's/.*@%:@ compressed_ofs.*/i64 >>0x191<<;/' > sys-file.sack
3781 for variant in be le; do
3782 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3783 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3785 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.
3790 AT_SETUP([zcompressed data - compressed sizes don't add up])
3791 AT_KEYWORDS([sack synthetic system file negative zlib])
3792 AT_DATA([sys-file.sack], [dnl
3794 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3796 6; dnl Nominal case size
3797 2; dnl zlib compressed
3799 -1; dnl Unspecified number of cases.
3801 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3804 dnl Numeric variables.
3805 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3806 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3808 dnl String variable.
3809 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3810 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3811 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3812 2; -1; 0; 0; 0; 0; s8 "";
3814 dnl Character encoding record.
3815 7; 20; 1; 12; "windows-1252";
3817 dnl Dictionary termination record.
3820 dnl ZLIB data header.
3821 i64 0x194; # zheader_ofs
3822 i64 0x1ac; # ztrailer_ofs
3823 i64 72; # ztrailer_len
3825 dnl This is where the ZLIB data blocks would go, but we don't need any to
3826 dnl provoke this message so we omit them.
3828 dnl ZLIB data trailer fixed header:
3829 i64 -100; # ztrailer_bias
3830 i64 0; # ztrailer_zero
3831 0x3ff000; # block_size
3834 dnl ZLIB block descriptor 1:
3835 i64 0x194; # uncompressed_ofs
3836 i64 0x1ac; # compressed_ofs
3837 0x100000; # uncompressed_size
3838 0x12345; # compressed_size
3840 dnl ZLIB block descriptor 2:
3841 i64 0x100194; # uncompressed_ofs
3842 i64 0x12421; # compressed_ofs
3843 0x100000; # uncompressed_size
3844 0x12345; # compressed_size
3846 for variant in be le; do
3847 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3848 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3850 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.
3851 error: `sys-file.sav' near offset 0x1dc: ZLIB block descriptor 1 reported compressed data offset 0x12421, when 0x124f1 was expected.
3856 AT_SETUP([zcompressed data - uncompressed_size > block_size])
3857 AT_KEYWORDS([sack synthetic system file negative zlib])
3858 zcompressed_sack | sed 's/.*uncompressed_size.*/>>0x400000<<;/' > sys-file.sack
3859 for variant in be le; do
3860 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3861 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3863 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.
3868 AT_SETUP([zcompressed data - compression expands data too much])
3869 AT_KEYWORDS([sack synthetic system file negative zlib])
3870 zcompressed_sack | sed 's/.*uncompressed_size.*/>>50<<;/
3871 s/.*@%:@ compressed_size.*/>>100<<;/' > sys-file.sack
3872 for variant in be le; do
3873 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3874 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3876 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.
3881 AT_SETUP([zcompressed data - compressed sizes don't add up])
3882 AT_KEYWORDS([sack synthetic system file negative zlib])
3883 zcompressed_sack | sed 's/.*@%:@ compressed_size.*/>>88<<;/' > sys-file.sack
3884 for variant in be le; do
3885 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3886 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3888 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.
3894 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467004.
3895 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
3896 # See also https://security-tracker.debian.org/tracker/CVE-2017-10791.
3897 # Found by team OWL337, using the collAFL fuzzer.
3898 AT_SETUP([integer overflows in long string missing values])
3899 cp $top_srcdir/tests/data/CVE-2017-10791.sav .
3900 AT_CHECK([pspp-convert -O csv CVE-2017-10791.sav -], [0], [], [dnl
3901 `CVE-2017-10791.sav': This system file does not indicate its own character encoding. Using default encoding ANSI_X3.4-1968. For best results, specify an encoding explicitly. Use SYSFILE INFO with ENCODING="DETECT" to analyze the possible encodings.
3902 `CVE-2017-10791.sav' near offset 0x217: Extension record subtype 21 ends unexpectedly.
3907 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467005.
3908 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
3909 # See also https://security-tracker.debian.org/tracker/CVE-2017-10792.
3910 # Reported by team OWL337, with fuzzer collAFL.
3911 AT_SETUP([null dereference skipping bad extension record 18])
3912 cp $top_srcdir/tests/data/CVE-2017-10792.sav .
3913 AT_CHECK([pspp-convert -O csv CVE-2017-10792.sav -], [0], [], [dnl
3914 `CVE-2017-10792.sav' near offset 0x1c0: Record type 7, subtype 18 has bad size 4 (expected 1).
3915 `CVE-2017-10792.sav': This system file does not indicate its own character encoding. Using default encoding ANSI_X3.4-1968. For best results, specify an encoding explicitly. Use SYSFILE INFO with ENCODING="DETECT" to analyze the possible encodings.