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/>.
16 dnl AT_BANNER([system file reader - positive])
18 AT_SETUP([variable labels and missing values])
19 AT_KEYWORDS([sack synthetic system file positive])
20 AT_DATA([sys-file.sack], [dnl
22 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
24 28; dnl Nominal case size
29 "01 Jan 11"; "20:53:52";
30 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
33 dnl Numeric variable, no label or missing values.
34 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
36 dnl Numeric variable, variable label.
37 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
38 32; "Numeric variable 2's label ("; i8 249; i8 250; i8 251; ")";
40 dnl Numeric variable, one missing value.
41 2; 0; 0; 1; 0x050800 *2; s8 "NUM3";
44 dnl Numeric variable, variable label and missing value.
45 2; 0; 1; 1; 0x050800 *2; s8 "NUM4";
46 30; "Another numeric variable label"; i8 0 * 2;
49 dnl Numeric variable, two missing values.
50 2; 0; 0; 2; 0x050800 *2; s8 "NUM5"; 1.0; 2.0;
52 dnl Numeric variable, three missing values.
53 2; 0; 0; 3; 0x050800 *2; s8 "NUM6"; 1.0; 2.0; 3.0;
55 dnl Numeric variable, range of missing values.
56 2; 0; 0; -2; 0x050800 *2; s8 "NUM7"; 1.0; 3.0;
58 dnl Numeric variables, range of missing values plus discrete value.
59 2; 0; 0; -3; 0x050800 *2; s8 "NUM8"; 1.0; 3.0; 5.0;
60 2; 0; 0; -3; 0x050800 *2; s8 "NUM9"; 1.0; HIGHEST; -5.0;
61 2; 0; 0; -3; 0x050800 *2; "NUM"; i8 192; i8 200; i8 204; i8 209; i8 210;
64 dnl String variable, no label or missing values.
65 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
67 dnl String variable, variable label.
68 2; 4; 1; 0; 0x010400 *2; s8 "STR2";
69 25; "String variable 2's label"; i8 0 * 3;
71 dnl String variable, one missing value.
72 2; 4; 0; 1; 0x010400 *2; s8 "STR3"; s8 "MISS";
74 dnl String variable, variable label and missing value.
75 2; 4; 1; 1; 0x010400 *2; s8 "STR4";
76 29; "Another string variable label"; i8 0 * 3;
79 dnl String variable, two missing values.
80 2; 4; 0; 2; 0x010400 *2; s8 "STR5"; s8 "MISS"; s8 "OTHR";
82 dnl String variable, three missing values.
83 2; 4; 0; 3; 0x010400 *2; s8 "STR6"; s8 "MISS"; s8 "OTHR"; s8 "MORE";
85 dnl Long string variable, one missing value.
86 dnl (This is not how SPSS represents missing values for long strings--it
87 dnl uses a separate record as shown later below--but old versions of PSPP
88 dnl did use this representation so we continue supporting it for backward
90 2; 11; 0; 1; 0x010b00 *2; s8 "STR7"; "first8by";
91 2; -1; 0; 0; 0; 0; s8 "";
93 dnl Long string variables that will have missing values added with a
95 2; 9; 0; 0; 0x010900 *2; s8 "STR8";
96 2; -1; 0; 0; 0; 0; s8 "";
97 2; 10; 0; 0; 0x010a00 *2; s8 "STR9";
98 2; -1; 0; 0; 0; 0; s8 "";
99 2; 11; 0; 0; 0x010b00 *2; s8 "STR10";
100 2; -1; 0; 0; 0; 0; s8 "";
102 dnl Long string variable, value label.
103 2; 25; 1; 0; 0x011900 *2; s8 "STR11"; 14; "25-byte string"; i8 0 * 2;
104 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
105 dnl Variable label fields on continuation records have been spotted in system
106 dnl files created by "SPSS Power Macintosh Release 6.1".
107 2; -1; 1; 0; 0; 0; s8 ""; 20; "dummy variable label";
109 dnl Machine integer info record.
110 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
112 dnl Machine floating-point info record.
113 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
115 dnl Long string variable missing values record.
117 dnl One missing value for STR8.
118 COUNT("STR8"); i8 1; 8; "abcdefgh";
120 dnl Two missing values for STR9.
121 COUNT("STR9"); i8 2; 8; "abcdefgh"; 8; "01234567";
123 dnl Three missing values for STR9.
124 COUNT("STR10"); i8 3; 8; "abcdefgh"; 8; "01234567"; 8; "0 ";
127 dnl Character encoding record.
128 7; 20; 1; 12; "windows-1252";
130 dnl Dictionary termination record.
134 1.0; 2.0; 3.0; 4.0; 5.0; 6.0; 7.0; 8.0; 9.0; 10.0;
135 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
136 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
137 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
139 for variant in be le; do
140 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
141 AT_DATA([sys-file.sps], [dnl
142 GET FILE='sys-file.sav'.
147 AT_CHECK([pspp -o pspp.csv sys-file.sps])
148 AT_CHECK([cat pspp.csv], [0], [dnl
149 File label: PSPP synthetic test file: ôõöø
151 Variable,Description,Position
153 num2,"Label: Numeric variable 2's label (ùúû)
157 num4,"Label: Another numeric variable label
161 Missing Values: 1; 2",5
163 Missing Values: 1; 2; 3",6
165 Missing Values: 1 THRU 3",7
167 Missing Values: 1 THRU 3; 5",8
169 Missing Values: 1 THRU HIGHEST; -5",9
170 numàèìñò,"Format: F8.0
171 Missing Values: LOWEST THRU 1; 5",10
173 str2,"Label: String variable 2's label
176 Missing Values: ""MISS""",13
177 str4,"Label: Another string variable label
179 Missing Values: ""OTHR""",14
181 Missing Values: ""MISS""; ""OTHR""",15
183 Missing Values: ""MISS""; ""OTHR""; ""MORE""",16
185 Missing Values: ""first8by""",17
187 Missing Values: ""abcdefgh""",18
189 Missing Values: ""abcdefgh""; ""01234567""",19
191 Missing Values: ""abcdefgh""; ""01234567""; ""0 """,20
192 str11,"Label: 25-byte string
196 num1,num2,num3,num4,num5,num6,num7,num8,num9,numàèìñò,str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11
197 1,2,3,4,5,6,7,8,9,10,abcd,efgh,ijkl,mnop,qrst,uvwx,yzABCDEFGHI,JKLMNOPQR,STUVWXYZ01,23456789abc,defghijklmnopqstuvwxyzABC
202 AT_SETUP([unspecified number of variable positions])
203 AT_KEYWORDS([sack synthetic system file positive])
204 AT_DATA([sys-file.sack], [dnl
206 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
208 -1; dnl Nominal case size (unspecified)
209 0; dnl Not compressed
213 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
216 dnl Numeric variable, no label or missing values.
217 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
219 dnl Numeric variable, variable label.
220 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
221 26; "Numeric variable 2's label"; i8 0 *2;
223 dnl Character encoding record.
224 7; 20; 1; 12; "windows-1252";
226 dnl Dictionary termination record.
232 for variant in be le; do
233 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
234 AT_DATA([sys-file.sps], [dnl
235 GET FILE='sys-file.sav'.
239 AT_CHECK([pspp -o pspp.csv sys-file.sps])
240 AT_CHECK([cat pspp.csv], [0], [dnl
241 Variable,Description,Position
243 num2,"Label: Numeric variable 2's label
253 AT_SETUP([wrong number of variable positions but version 13])
254 AT_KEYWORDS([sack synthetic system file positive])
255 AT_DATA([sys-file.sack], [dnl
257 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
259 -1; dnl Nominal case size (unspecified)
260 0; dnl Not compressed
264 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
267 dnl Numeric variable, no label or missing values.
268 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
270 dnl Numeric variable, variable label.
271 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
272 26; "Numeric variable 2's label"; i8 0 *2;
274 dnl Machine integer info record (SPSS 13).
275 7; 3; 4; 8; 13; 2; 3; -1; 1; 1; ENDIAN; 1252;
277 dnl Character encoding record.
278 7; 20; 1; 12; "windows-1252";
280 dnl Dictionary termination record.
286 for variant in be le; do
287 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
288 AT_DATA([sys-file.sps], [dnl
289 GET FILE='sys-file.sav'.
293 AT_CHECK([pspp -o pspp.csv sys-file.sps])
294 AT_CHECK([cat pspp.csv], [0], [dnl
295 Variable,Description,Position
297 num2,"Label: Numeric variable 2's label
307 AT_SETUP([value labels])
308 AT_KEYWORDS([sack synthetic system file positive])
309 AT_DATA([sys-file.sack], [dnl
311 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
313 22; dnl Nominal case size
314 0; dnl Not compressed
318 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
321 dnl Numeric variables.
322 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
323 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
324 2; 0; 0; 0; 0x050800 *2; s8 "NUM3";
325 2; 0; 0; 0; 0x050800 *2; s8 "NUM4";
326 2; 0; 0; 0; 0x050800 *2; s8 "NUM5";
328 dnl String variables.
329 2; 1; 0; 0; 0x010100 *2; s8 "STR1"; dnl index 6
330 2; 2; 0; 0; 0x010200 *2; s8 "STR2"; dnl index 7
331 2; 3; 0; 0; 0x010300 *2; s8 "STR3"; dnl index 8
332 2; 4; 0; 0; 0x010400 *2; s8 "STR4"; dnl index 9
333 2; 4; 0; 0; 0x010400 *2; s8 "STR5"; dnl index 10
334 2; 6; 0; 0; 0x010600 *2; s8 "STR6"; dnl index 11
335 2; 7; 0; 0; 0x010700 *2; s8 "STR7"; dnl index 12
336 2; 8; 0; 0; 0x010800 *2; s8 "STR8"; dnl index 13
337 2; 9; 0; 0; 0x010900 *2; "STR9"; i8 230; s3 ""; dnl index 14
338 2; -1; 0; 0; 0; 0; s8 "";
339 2; 12; 0; 0; 0x010c00 *2; s8 "STR12"; dnl index 16
340 2; -1; 0; 0; 0; 0; s8 "";
341 2; 16; 0; 0; 0x011000 *2; s8 "STR16"; dnl index 18
342 2; -1; 0; 0; 0; 0; s8 "";
343 2; 17; 0; 0; 0x011100 *2; s8 "STR17"; dnl index 20
344 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
346 dnl One value label for NUM1.
347 3; 1; 1.0; i8 17; i8 238; i8 228; i8 232; i8 237; s19 " (in Russian)"; 4; 1; 1;
349 dnl Two value labels for NUM2, as a single pair of type 3 and type 4 records.
350 3; 2; 1.0; i8 3; s7 "one"; 2.0; i8 3; s7 "two"; 4; 1; 2;
352 dnl Two value labels for NUM3, as two pairs of type 3 and type 4 records.
353 3; 1; 3.0; i8 5; s7 "three"; 4; 1; 3;
354 3; 1; 4.0; i8 4; s7 "four"; 4; 1; 3;
356 dnl Two common value labels for NUM4 and NUM5, plus two different ones for each.
357 3; 1; 5.0; i8 4; s7 "five"; 4; 1; 4;
358 3; 1; 6.0; i8 3; s7 "six"; 4; 1; 5;
359 3; 2; 7.0; i8 5; s7 "seven"; 8.0; i8 5; s7 "eight"; 4; 2; 4; 5;
360 3; 1; 9.0; i8 4; s7 "nine"; 4; 1; 4;
361 3; 1; 10.0; i8 3; s7 "ten"; 4; 1; 5;
363 dnl One value label for STR1.
364 3; 1; s8 "a"; i8 19; s23 "value label for `a'"; 4; 1; 6;
366 dnl Two value labels for STR2, as a single pair of type 3 and type 4 records.
368 s8 "bc"; i8 20; s23 "value label for `bc'";
369 s8 "de"; i8 20; s23 "value label for `de'";
372 dnl Two value labels for STR3, as two pairs of type 3 and type 4 records.
373 3; 1; s8 "fgh"; i8 21; s23 "value label for `fgh'"; 4; 1; 8;
374 3; 1; s8 "ijk"; i8 21; s23 "value label for `ijk'"; 4; 1; 8;
376 dnl Two common value labels for STR4 and STR5, plus two different ones for each.
377 3; 1; s8 "lmno"; i8 22; s23 "value label for `lmno'"; 4; 1; 9;
378 3; 1; s8 "pqrs"; i8 22; s23 "value label for `pqrs'"; 4; 1; 10;
380 s8 "tuvw"; i8 22; s23 "value label for `tuvw'";
381 s8 "xyzA"; i8 22; s23 "value label for `xyzA'";
383 3; 1; s8 "BCDE"; i8 22; s23 "value label for `BCDE'"; 4; 1; 9;
384 3; 1; s8 "FGHI"; i8 22; s23 "value label for `FGHI'"; 4; 1; 10;
386 dnl One value label for STR6, STR7, STR8.
387 3; 1; s8 "JKLMNO"; i8 24; s31 "value label for `JKLMNO'"; 4; 1; 11;
388 3; 1; s8 "JKLMNOP"; i8 25; s31 "value label for `JKLMNOP'"; 4; 1; 12;
389 3; 1; s8 "JKLMNOPQ"; i8 26; s31 "value label for `JKLMNOPQ'"; 4; 1; 13;
391 dnl Machine integer info record.
392 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1251;
394 dnl Character encoding record.
395 7; 20; 1; 12; "windows-1251";
398 dnl One value label for STR9ж,
399 COUNT("STR9"; i8 230); 9; 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
401 dnl Two value labels for STR12.
402 COUNT("STR12"); 12; 2;
403 COUNT("0123456789ab"); COUNT("value label for `0123456789ab'");
404 COUNT("cdefghijklmn"); COUNT("value label for `cdefghijklmn'");
406 dnl Three value labels for STR16.
407 COUNT("STR16"); 16; 3;
408 COUNT("opqrstuvwxyzABCD"); COUNT("value label for `opqrstuvwxyzABCD'");
409 COUNT("EFGHIJKLMNOPQRST"); COUNT("value label for `EFGHIJKLMNOPQRST'");
410 COUNT("UVWXYZ0123456789"); COUNT("value label for `UVWXYZ0123456789' with Cyrillic letters: `"; i8 244; i8 245; i8 246; "'");
412 dnl One value label for STR17.
413 COUNT("STR17"); 17; 1;
414 COUNT("abcdefghijklmnopq"); COUNT("value label for `abcdefghijklmnopq'");
417 dnl Dictionary termination record.
420 for variant in be le; do
421 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
422 AT_DATA([sys-file.sps], [dnl
423 GET FILE='sys-file.sav'.
426 AT_CHECK([pspp -o pspp.csv sys-file.sps])
427 AT_CHECK([cat pspp.csv], [0], [dnl
428 Variable,Description,Position
432 1,один (in Russian)",1
460 a,value label for `a'",6
464 bc,value label for `bc'
465 de,value label for `de'",7
469 fgh,value label for `fgh'
470 ijk,value label for `ijk'",8
474 BCDE,value label for `BCDE'
475 lmno,value label for `lmno'
476 tuvw,value label for `tuvw'
477 xyzA,value label for `xyzA'",9
481 FGHI,value label for `FGHI'
482 pqrs,value label for `pqrs'
483 tuvw,value label for `tuvw'
484 xyzA,value label for `xyzA'",10
488 JKLMNO,value label for `JKLMNO'",11
492 JKLMNOP,value label for `JKLMNOP'",12
496 JKLMNOPQ,value label for `JKLMNOPQ'",13
500 RSTUVWXYZ,value label for `RSTUVWXYZ'",14
504 0123456789ab,value label for `0123456789ab'
505 cdefghijklmn,value label for `cdefghijklmn'",15
509 EFGHIJKLMNOPQRST,value label for `EFGHIJKLMNOPQRST'
510 UVWXYZ0123456789,value label for `UVWXYZ0123456789' with Cyrillic letters: `фхц'
511 opqrstuvwxyzABCD,value label for `opqrstuvwxyzABCD'",16
515 abcdefghijklmnopq,value label for `abcdefghijklmnopq'",17
520 AT_SETUP([documents])
521 AT_KEYWORDS([sack synthetic system file positive])
522 AT_DATA([sys-file.sack], [dnl
524 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
526 1; dnl Nominal case size
527 0; dnl Not compressed
531 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
534 dnl Numeric variable, no label or missing values.
535 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
537 dnl Machine integer info record.
538 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
542 s80 "First line of documents";
543 s80 "Second line of documents";
544 "abb"; i8 233; " appliqu"; i8 233; " attach"; i8 233; " blas"; i8 233; " caf"; i8 233; " canap"; i8 233; " clich"; i8 233; " consomm"; i8 233;
547 s80 "Last line of documents";
549 dnl Character encoding record.
550 7; 20; 1; 12; "windows-1252";
552 dnl Dictionary termination record.
558 for variant in be le; do
559 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
560 AT_DATA([sys-file.sps], [dnl
561 GET FILE='sys-file.sav'.
565 AT_CHECK([pspp -o pspp.csv sys-file.sps])
566 AT_CHECK([cat pspp.csv], [0], [dnl
567 Documents in the active dataset:
569 First line of documents
571 Second line of documents
573 abbé appliqué attaché blasé café canapé cliché consommé
577 Last line of documents
586 AT_SETUP([multiple response sets])
587 AT_KEYWORDS([sack synthetic system file positive])
588 AT_DATA([sys-file.sack], [dnl
590 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
592 16; dnl Nominal case size
593 0; dnl Not compressed
597 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
601 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
602 2; 0; 0; 0; 0x050800 *2; s8 "B";
603 2; 0; 0; 0; 0x050800 *2; s8 "C";
606 2; 0; 0; 0; 0x050800 *2; s8 "D";
607 2; 0; 0; 0; 0x050800 *2; s8 "E";
608 2; 0; 0; 0; 0x050800 *2; s8 "F";
609 2; 0; 0; 0; 0x050800 *2; s8 "G";
612 2; 4; 0; 0; 0x010400 *2; s8 "H";
613 2; 4; 0; 0; 0x010400 *2; s8 "I";
614 2; 4; 0; 0; 0x010400 *2; s8 "J";
617 2; 0; 0; 0; 0x050800 *2; s8 "K";
618 2; 0; 0; 0; 0x050800 *2; s8 "L";
619 2; 0; 0; 0; 0x050800 *2; s8 "M";
622 2; 6; 0; 0; 0x010600 *2; s8 "N";
623 2; 6; 0; 0; 0x010600 *2; s8 "O";
624 2; 6; 0; 0; 0x010600 *2; s8 "P";
626 dnl Machine integer info record.
627 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
631 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
632 "$b=D2 55 0 g e f d"; i8 10; i8 10;
633 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
638 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
639 "$e=E 11 6 choice 0 n o p"; i8 10; i8 10; i8 10; i8 10);
641 dnl Character encoding record.
642 7; 20; 1; 9; "shift_jis";
644 dnl Dictionary termination record.
647 for variant in be le; do
648 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
649 AT_DATA([sys-file.sps], [dnl
650 GET FILE='sys-file.sav'.
651 MRSETS /DISPLAY NAME=ALL.
653 AT_CHECK([pspp -o pspp.csv sys-file.sps])
654 AT_CHECK([cat pspp.csv], [0], [dnl
655 Table: Multiple Response Sets
656 Name,Variables,Details
660 ","Multiple category set
667 ","Multiple dichotomy set
669 Category label source: Variable labels
674 ","Multiple dichotomy set
676 Label source: Provided by user
678 Category label source: Variable labels
683 ","Multiple dichotomy set
685 Label source: Provided by user
687 Category label source: Value labels of counted value
692 ","Multiple dichotomy set
693 Label source: First variable label among variables
694 Counted value: `choice'
695 Category label source: Value labels of counted value
701 dnl Also checks for handling of CR-only line ends in file label and
702 dnl extra product info.
703 AT_SETUP([extra product info])
704 AT_KEYWORDS([sack synthetic system file positive])
705 AT_DATA([sys-file.sack], [dnl
707 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
709 4; dnl Nominal case size
710 0; dnl Not compressed
714 "01 Jan 11"; "20:53:52"; "PSPP synthetic"; i8 13; s49 "test file";
717 dnl Numeric variables.
718 2; 0; 0; 0; 0x050800 *2; s8 "A";
719 2; 0; 0; 0; 0x050800 *2; s8 "B";
720 2; 0; 0; 0; 0x050800 *2; s8 "C";
721 2; 0; 0; 0; 0x050800 *2; s8 "D";
723 dnl Extra product info.
724 7; 10; 1; COUNT ("Extra product info"; i8 13; "another line"; i8 13; "blah");
726 dnl Character encoding record.
727 7; 20; 1; 12; "windows-1252";
729 dnl Dictionary termination record.
732 for variant in be le; do
733 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
734 AT_DATA([sys-file.sps], [dnl
735 SYSFILE INFO FILE='sys-file.sav'.
737 AT_CHECK([pspp -o pspp.csv sys-file.sps])
738 AT_CHECK([sed 7q pspp.csv], [0], [dnl
740 Label:,"PSPP synthetic
742 Created:,01 Jan 11 20:53:52 by $(@%:@) SPSS DATA FILE PSPP synthetic test file
743 Product:,"Extra product info
750 AT_SETUP([variable display parameters, without width])
751 AT_KEYWORDS([sack synthetic system file positive])
752 AT_DATA([sys-file.sack], [dnl
754 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
756 19; dnl Nominal case size
757 0; dnl Not compressed
761 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
764 dnl Numeric variables.
765 2; 0; 0; 0; 0x050800 *2; s8 "A";
766 2; 0; 0; 0; 0x050800 *2; s8 "B";
767 2; 0; 0; 0; 0x050800 *2; s8 "C";
768 2; 0; 0; 0; 0x050800 *2; s8 "D";
770 dnl Short string variables.
771 2; 3; 0; 0; 0x010300 *2; s8 "H";
772 2; 3; 0; 0; 0x010300 *2; s8 "I";
773 2; 3; 0; 0; 0x010300 *2; s8 "J";
774 2; 3; 0; 0; 0x010300 *2; s8 "K";
776 dnl Long string variables.
777 2; 9; 0; 0; 0x010900 *2; s8 "L";
778 2; -1; 0; 0; 0; 0; s8 "";
779 2; 10; 0; 0; 0x010a00 *2; s8 "M";
780 2; -1; 0; 0; 0; 0; s8 "";
781 2; 17; 0; 0; 0x011100 *2; s8 "N";
782 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
783 2; 25; 0; 0; 0x011900 *2; s8 "O";
784 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
786 dnl Variable display parameters
801 dnl Character encoding record.
802 7; 20; 1; 12; "windows-1252";
804 dnl Dictionary termination record.
807 for variant in be le; do
808 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
809 AT_DATA([sys-file.sps], [dnl
810 GET FILE='sys-file.sav'.
813 AT_CHECK([pspp -o pspp.csv sys-file.sps])
814 AT_CHECK([cat pspp.csv], [0], [dnl
815 Variable,Description,Position
818 Display Alignment: Left",1
821 Display Alignment: Left",2
824 Display Alignment: Left",3
827 Display Alignment: Right",4
830 Display Alignment: Right",5
833 Display Alignment: Right",6
836 Display Alignment: Center",7
839 Display Alignment: Center",8
842 Display Alignment: Center",9
845 Display Alignment: Left",10
848 Display Alignment: Right",11
851 Display Alignment: Center",12
856 AT_SETUP([variable display parameters, with width])
857 AT_KEYWORDS([sack synthetic system file positive])
858 AT_DATA([sys-file.sack], [dnl
860 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
862 19; dnl Nominal case size
863 0; dnl Not compressed
867 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
870 dnl Numeric variables.
871 2; 0; 0; 0; 0x050800 *2; s8 "A";
872 2; 0; 0; 0; 0x050800 *2; s8 "B";
873 2; 0; 0; 0; 0x050800 *2; s8 "C";
874 2; 0; 0; 0; 0x050800 *2; s8 "D";
876 dnl Short string variables.
877 2; 3; 0; 0; 0x010300 *2; s8 "H";
878 2; 3; 0; 0; 0x010300 *2; s8 "I";
879 2; 3; 0; 0; 0x010300 *2; s8 "J";
880 2; 3; 0; 0; 0x010300 *2; s8 "K";
882 dnl Long string variables.
883 2; 9; 0; 0; 0x010900 *2; s8 "L";
884 2; -1; 0; 0; 0; 0; s8 "";
885 2; 10; 0; 0; 0x010a00 *2; s8 "M";
886 2; -1; 0; 0; 0; 0; s8 "";
887 2; 17; 0; 0; 0x011100 *2; s8 "N";
888 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
889 2; 25; 0; 0; 0x011900 *2; s8 "O";
890 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
892 dnl Variable display parameters
907 dnl Character encoding record.
908 7; 20; 1; 12; "windows-1252";
910 dnl Dictionary termination record.
913 for variant in be le; do
914 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
915 AT_DATA([sys-file.sps], [dnl
916 GET FILE='sys-file.sav'.
919 AT_CHECK([pspp -o pspp.csv sys-file.sps])
920 AT_CHECK([cat pspp.csv], [0], [dnl
921 Variable,Description,Position
924 Display Alignment: Left
928 Display Alignment: Left
932 Display Alignment: Left
936 Display Alignment: Right
940 Display Alignment: Right
944 Display Alignment: Right
948 Display Alignment: Center
952 Display Alignment: Center
956 Display Alignment: Center
960 Display Alignment: Left
961 Display Width: 10",10
964 Display Alignment: Right
965 Display Width: 11",11
968 Display Alignment: Center
969 Display Width: 12",12
974 AT_SETUP([long variable names])
975 AT_KEYWORDS([sack synthetic system file positive])
976 AT_DATA([sys-file.sack], [dnl
978 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
980 7; dnl Nominal case size
981 0; dnl Not compressed
985 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
988 dnl Numeric variables.
989 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
990 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
991 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
992 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
993 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDINA";
994 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_A";
995 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_B";
997 dnl Machine integer info record.
998 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1000 dnl Machine floating-point info record.
1001 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
1003 dnl Long variable names.
1005 "LONGVARI=LongVariableName1"; i8 9;
1006 "LONGVA_A=LongVariableName2"; i8 9;
1007 "LONGVA_B=LongVariableName3"; i8 9;
1008 "LONGVA_C=LongVariableName4"; i8 9;
1009 "CO"; i8 214; "RDINA=Co"; i8 246; "rdinate_X"; i8 9;
1010 "CO"; i8 214; "RDI_A=Co"; i8 246; "rdinate_Y"; i8 9;
1011 "CO"; i8 214; "RDI_B=Co"; i8 246; "rdinate_Z";
1014 dnl Character encoding record.
1015 7; 20; 1; 12; "windows-1252";
1017 dnl Dictionary termination record.
1020 for variant in be le; do
1021 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1022 AT_DATA([sys-file.sps], [dnl
1023 GET FILE='sys-file.sav'.
1026 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1027 AT_CHECK([cat pspp.csv], [0], [dnl
1028 Variable,Description,Position
1029 LongVariableName1,Format: F8.0,1
1030 LongVariableName2,Format: F8.0,2
1031 LongVariableName3,Format: F8.0,3
1032 LongVariableName4,Format: F8.0,4
1033 Coördinate_X,Format: F8.0,5
1034 Coördinate_Y,Format: F8.0,6
1035 Coördinate_Z,Format: F8.0,7
1040 AT_SETUP([very long strings])
1041 AT_KEYWORDS([sack synthetic system file positive])
1042 AT_DATA([sys-file.sack], [dnl
1044 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1046 109; dnl Nominal case size
1047 0; dnl Not compressed
1051 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1054 dnl 256-byte string.
1055 2; 255; 0; 0; 0x01FF00 *2; "S"; i8 201; s6 "Q256";
1056 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1057 2; 4; 0; 0; 0x010400 *2; "S"; i8 201; "Q256_1";
1059 dnl 600-byte string.
1060 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600";
1061 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1062 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600_1";
1063 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1064 2; 96; 0; 0; 0x016000 *2; s8 "STR600_2";
1065 (2; -1; 0; 0; 0; 0; s8 "") * 11;
1067 dnl Machine integer info record.
1068 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1070 dnl Very long string record.
1072 "S"; i8 201; "Q256=00256"; i8 0; i8 9;
1073 "STR600=00600"; i8 0; i8 9;
1076 dnl Character encoding record.
1077 7; 20; 1; 12; "windows-1252";
1079 dnl Dictionary termination record.
1083 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 4;
1085 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 9;
1086 "abcdefghijklmnopqrstuvwxyzABCDEF";
1088 for variant in be le; do
1089 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1090 AT_DATA([sys-file.sps], [dnl
1091 GET FILE='sys-file.sav'.
1095 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1096 AT_CHECK([cat pspp.csv], [0], [dnl
1097 Variable,Description,Position
1098 séq256,Format: A256,1
1099 str600,Format: A600,2
1103 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@a,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyz
1108 AT_SETUP([data file and variable attributes])
1109 AT_KEYWORDS([sack synthetic system file positive])
1110 AT_DATA([sys-file.sack], [dnl
1112 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1114 3; dnl Nominal case size
1115 0; dnl Not compressed
1119 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1123 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
1124 2; 0; 0; 0; 0x050800 *2; s8 "SECONDVA";
1125 2; 0; 0; 0; 0x050800 *2; s8 "THIRDVAR";
1127 dnl Machine integer info record.
1128 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1130 dnl Long variable names.
1132 "FIRSTVAR=FirstVariable"; i8 9;
1133 "SECONDVA=S"; i8 233; "condVariable"; i8 9;
1134 "THIRDVAR=ThirdVariable"; i8 9
1137 dnl Data file attributes record.
1139 "Attr1('Value1'"; i8 10; "''d"; i8 233; "claration''"; i8 10; ")";
1140 "S"; i8 233; "condAttr('123'"; i8 10; "'456'"; i8 10; ")";
1143 dnl Variable attributes record.
1146 "ad"; i8 232; "le('23'"; i8 10; "'34'"; i8 10; ")";
1147 "bert('123'"; i8 10; ")";
1148 "$@Role('1'"; i8 10; ")";
1149 "/S"; i8 233; "condVariable:";
1150 "xyzzy('quux'"; i8 10; ")";
1153 dnl Another variable attributes record.
1154 dnl Only system files written by "Stata 14.1/-savespss- 1.77 by S.Radyakin"
1155 dnl include multiple variable attributes records.
1156 7; 18; 1; COUNT ("ThirdVariable:fizz('buzz'"; i8 10; ")";);
1158 dnl Character encoding record.
1159 7; 20; 1; 12; "windows-1252";
1161 dnl Dictionary termination record.
1164 for variant in be le; do
1165 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1166 AT_DATA([sys-file.sps], [dnl
1167 GET FILE='sys-file.sav'.
1168 DISPLAY @ATTRIBUTES.
1170 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1171 AT_CHECK([cat pspp.csv], [0],
1172 [[Variable,Description
1173 FirstVariable,"Attribute,Value
1178 SécondVariable,"Attribute,Value
1180 ThirdVariable,"Attribute,Value
1183 Table: Custom data file attributes.
1186 Attr1[2],'déclaration'
1190 AT_DATA([sys-file.sps], [dnl
1191 GET FILE='sys-file.sav'.
1194 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1195 AT_CHECK([cat pspp.csv], [0],
1196 [[Variable,Description,Position
1197 FirstVariable,"Format: F8.0
1204 SécondVariable,"Format: F8.0
1209 ThirdVariable,"Format: F8.0
1215 Table: Custom data file attributes.
1218 Attr1[2],'déclaration'
1225 AT_SETUP([variable roles])
1226 AT_KEYWORDS([sack synthetic system file positive])
1227 AT_DATA([sys-file.sack], [dnl
1229 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1231 7; dnl Nominal case size
1232 0; dnl Not compressed
1236 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1240 2; 0; 0; 0; 0x050800 *2; s8 "I";
1241 2; 0; 0; 0; 0x050800 *2; s8 "O";
1242 2; 0; 0; 0; 0x050800 *2; s8 "B";
1243 2; 0; 0; 0; 0x050800 *2; s8 "N";
1244 2; 0; 0; 0; 0x050800 *2; s8 "P";
1245 2; 0; 0; 0; 0x050800 *2; s8 "S";
1246 2; 0; 0; 0; 0x050800 *2; s8 "X";
1248 dnl Machine integer info record.
1249 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1251 dnl Variable attributes record.
1253 "I:$@Role('0'"; i8 10; ")";
1254 "/O:$@Role('1'"; i8 10; ")";
1255 "/B:$@Role('2'"; i8 10; ")";
1256 "/N:$@Role('3'"; i8 10; ")";
1257 "/P:$@Role('4'"; i8 10; ")";
1258 "/S:$@Role('5'"; i8 10; ")";
1259 "/X:$@Role('6'"; i8 10; ")";
1262 dnl Character encoding record.
1263 7; 20; 1; 12; "windows-1252";
1265 dnl Dictionary termination record.
1268 for variant in be le; do
1269 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1270 AT_DATA([sys-file.sps], [dnl
1271 GET FILE='sys-file.sav'.
1274 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [dnl
1275 warning: `sys-file.sav': Invalid role for variable x.
1277 AT_CHECK([cat pspp.csv], [0], [dnl
1278 warning: `sys-file.sav': Invalid role for variable x.
1280 Variable,Description,Position
1299 AT_SETUP([compressed data])
1300 AT_KEYWORDS([sack synthetic system file positive])
1301 AT_DATA([sys-file.sack], [dnl
1303 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1305 6; dnl Nominal case size
1306 1; dnl Simple compression
1308 -1; dnl Unspecified number of cases.
1310 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1313 dnl Numeric variables.
1314 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1315 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1317 dnl String variable.
1318 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1319 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1320 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1321 2; -1; 0; 0; 0; 0; s8 "";
1323 dnl Character encoding record.
1324 7; 20; 1; 12; "windows-1252";
1326 dnl Dictionary termination record.
1329 dnl Compressed data.
1330 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1331 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1332 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1333 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1336 for variant in be le; do
1337 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1338 AT_DATA([sys-file.sps], [dnl
1339 GET FILE='sys-file.sav'.
1343 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1344 AT_CHECK([cat pspp.csv], [0], [dnl
1345 Variable,Description,Position
1353 num1,num2,str4,str8,str15
1354 -99,0,,abcdefgh,0123 @&t@
1355 .,151,jklm,nopqrstu,vwxyzABC @&t@
1356 1,2,DEFG,HIJKLMNO,PQRSTUV
1361 AT_SETUP([compressed data, zero bias])
1362 AT_KEYWORDS([sack synthetic system file positive])
1363 AT_DATA([sys-file.sack], [dnl
1365 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1367 6; dnl Nominal case size
1368 1; dnl Simple compression.
1370 -1; dnl Unspecified number of cases.
1372 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1375 dnl Numeric variables.
1376 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1377 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1379 dnl String variable.
1380 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1381 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1382 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1383 2; -1; 0; 0; 0; 0; s8 "";
1385 dnl Character encoding record.
1386 7; 20; 1; 12; "windows-1252";
1388 dnl Dictionary termination record.
1391 dnl Compressed data.
1392 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1393 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1394 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1395 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1398 for variant in be le; do
1399 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1400 AT_DATA([sys-file.sps], [dnl
1401 GET FILE='sys-file.sav'.
1405 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1406 AT_CHECK([cat pspp.csv], [0], [dnl
1407 Variable,Description,Position
1415 num1,num2,str4,str8,str15
1416 1,100,,abcdefgh,0123 @&t@
1417 .,251,jklm,nopqrstu,vwxyzABC @&t@
1418 101,102,DEFG,HIJKLMNO,PQRSTUV
1423 AT_SETUP([compressed data, other bias])
1424 AT_KEYWORDS([sack synthetic system file positive])
1425 AT_DATA([sys-file.sack], [dnl
1427 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1429 6; dnl Nominal case size
1430 1; dnl Simple compression.
1432 -1; dnl Unspecified number of cases.
1434 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1437 dnl Numeric variables.
1438 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1439 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1441 dnl String variable.
1442 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1443 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1444 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1445 2; -1; 0; 0; 0; 0; s8 "";
1447 dnl Character encoding record.
1448 7; 20; 1; 12; "windows-1252";
1450 dnl Dictionary termination record.
1453 dnl Compressed data.
1454 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1455 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1456 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1457 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1460 for variant in be le; do
1461 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1462 AT_DATA([sys-file.sps], [dnl
1463 GET FILE='sys-file.sav'.
1467 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0],
1468 [warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1470 AT_CHECK([cat pspp.csv], [0], [dnl
1471 "warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1473 Variable,Description,Position
1481 num1,num2,str4,str8,str15
1482 -49,50,,abcdefgh,0123 @&t@
1483 .,201,jklm,nopqrstu,vwxyzABC @&t@
1484 51,52,DEFG,HIJKLMNO,PQRSTUV
1489 m4_divert_push([PREPARE_TESTS])
1490 zcompressed_sack () {
1493 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1495 6; dnl Nominal case size
1496 2; dnl zlib compressed
1498 -1; dnl Unspecified number of cases.
1500 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1503 dnl Numeric variables.
1504 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1505 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1507 dnl String variable.
1508 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1509 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1510 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1511 2; -1; 0; 0; 0; 0; s8 "";
1513 dnl Character encoding record.
1514 7; 20; 1; 12; "windows-1252";
1516 dnl Dictionary termination record.
1519 dnl ZLIB data header.
1520 i64 0x194; # zheader_ofs
1521 i64 0x205; # ztrailer_ofs
1522 i64 48; # ztrailer_len
1524 dnl ZLIB data block.
1526 dnl This is the compressed form of:
1528 dnl 01 64 fe fd fe fd ff fb 61 62 63 64 65 66 67 68 |.d......abcdefgh|
1529 dnl 30 31 32 33 20 20 20 20 fd fd fd fe 65 66 fd fd |0123 ....ef..|
1530 dnl 6a 6b 6c 6d 20 20 20 20 6e 6f 70 71 72 73 74 75 |jklm nopqrstu|
1531 dnl 76 77 78 79 7a 41 42 43 44 45 46 47 20 20 20 20 |vwxyzABCDEFG |
1532 dnl 48 49 4a 4b 4c 4d 4e 4f fe fd fc 00 00 00 00 00 |HIJKLMNO........|
1533 dnl 50 51 52 53 54 55 56 57 |PQRSTUVW|
1535 dnl which is the data from the "compressed data" test.
1536 hex "78 01 63 4c f9 f7 f7 df df ff bf 13 93 92 53 52";
1537 hex "d3 d2 33 0c 0c 8d 8c 15 80 e0 ef df bf ff 52 d3";
1538 hex "fe fe cd ca ce c9 05 f1 f3 f2 0b 0a 8b 8a 4b 4a";
1539 hex "cb ca 2b 2a ab 1c 9d 9c 5d 5c dd dc 41 e2 1e 9e";
1540 hex "5e de 3e be 7e fe ff fe fe 61 00 81 80 c0 a0 e0";
1541 hex "90 d0 b0 70 00 0f 3f 23 d7";
1543 dnl ZLIB data trailer fixed header:
1544 i64 -100; # ztrailer_bias
1545 i64 0; # ztrailer_zero
1546 0x3ff000; # block_size
1549 dnl ZLIB block descriptor:
1550 i64 0x194; # uncompressed_ofs
1551 i64 0x1ac; # compressed_ofs
1552 88; # uncompressed_size
1553 89; # compressed_size
1556 m4_divert_pop([PREPARE_TESTS])
1558 AT_SETUP([zcompressed data])
1559 AT_KEYWORDS([sack synthetic system file positive zlib])
1560 zcompressed_sack > sys-file.sack
1561 for variant in be le; do
1562 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1563 AT_DATA([sys-file.sps], [dnl
1564 GET FILE='sys-file.sav'.
1568 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1569 AT_CHECK([cat pspp.csv], [0], [dnl
1570 Variable,Description,Position
1578 num1,num2,str4,str8,str15
1579 -99,0,,abcdefgh,0123 @&t@
1580 .,151,jklm,nopqrstu,vwxyzABC @&t@
1581 1,2,DEFG,HIJKLMNO,PQRSTUV
1586 AT_BANNER([system file reader - negative])
1588 AT_SETUP([no variables])
1589 AT_KEYWORDS([sack synthetic system file negative])
1590 AT_DATA([sys-file.sack], [dnl
1592 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1594 0; dnl Nominal case size (empty)
1595 0; dnl Not compressed
1599 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1602 dnl Character encoding record.
1603 7; 20; 1; 12; "windows-1252";
1605 dnl Dictionary termination record.
1608 for variant in be le; do
1609 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1610 AT_DATA([sys-file.sps], [dnl
1611 GET FILE='sys-file.sav'.
1613 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1614 sys-file.sps:1: error: GET: `sys-file.sav': Data file dictionary has no variables.
1617 dnl At one point pspp-convert would hang forever if there were no variables,
1618 dnl so check against regression.
1619 AT_CHECK([pspp-convert sys-file.sav sys-file.txt])
1620 AT_CHECK([cat sys-file.txt], [0], [
1625 AT_SETUP([unspecified character encoding])
1626 AT_KEYWORDS([sack synthetic system file positive])
1627 AT_DATA([sys-file.sack], [dnl
1629 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1631 4; dnl Nominal case size
1632 0; dnl Not compressed
1636 "01 Jan 11"; "20:53:52";
1637 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1640 dnl Numeric variables.
1641 2; 0; 0; 0; 0x050800 *2; s8 "A";
1642 2; 0; 0; 0; 0x050800 *2; s8 "B";
1643 2; 0; 0; 0; 0x050800 *2; s8 "C";
1644 2; 0; 0; 0; 0x050800 *2; s8 "D";
1646 dnl Dictionary termination record.
1649 for variant in be le; do
1650 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1651 AT_DATA([sys-file.sps], [dnl
1654 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [stdout])
1655 AT_CHECK([sed 's/default encoding.*For/default encoding. For/' stdout], [0], [dnl
1656 "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."
1661 AT_SETUP([misplaced type 4 record])
1662 AT_KEYWORDS([sack synthetic system file negative])
1663 AT_DATA([sys-file.sack], [dnl
1665 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1666 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1668 dnl Numeric variable.
1669 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1674 for variant in be le; do
1675 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1676 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1678 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1679 [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1684 AT_SETUP([bad record type])
1685 AT_KEYWORDS([sack synthetic system file negative])
1686 AT_DATA([sys-file.sack], [dnl
1688 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1689 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1691 dnl Numeric variable.
1692 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1694 dnl Type 8 record (not a valid type).
1697 for variant in be le; do
1698 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1699 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1701 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1702 [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1707 AT_SETUP([wrong number of variable positions])
1708 AT_KEYWORDS([sack synthetic system file negative])
1709 AT_DATA([sys-file.sack], [dnl
1711 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1712 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1714 dnl Numeric variable.
1715 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1717 dnl Character encoding record.
1718 7; 20; 1; 12; "windows-1252";
1720 dnl End of dictionary.
1723 for variant in be le; do
1724 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1725 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1727 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1728 [warning: `sys-file.sav': File header claims 2 variable positions but 1 were read from file.
1733 AT_SETUP([variable name may not begin with `#'])
1734 AT_KEYWORDS([sack synthetic system file negative])
1735 AT_DATA([sys-file.sack], [dnl
1737 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1738 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1740 dnl Numeric variable.
1741 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1743 dnl Character encoding record.
1744 7; 20; 1; 12; "windows-1252";
1746 dnl End of dictionary.
1749 for variant in be le; do
1750 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1751 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1753 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1754 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `$UM1'.
1759 AT_SETUP([variable name may not be reserved word])
1760 AT_KEYWORDS([sack synthetic system file negative])
1761 AT_DATA([sys-file.sack], [dnl
1763 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1764 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1766 dnl Numeric variable.
1767 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1769 dnl Character encoding record.
1770 7; 20; 1; 12; "windows-1252";
1772 dnl End of dictionary.
1775 for variant in be le; do
1776 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1777 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1779 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1780 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `TO'.
1785 AT_SETUP([variable width must be between 0 and 255])
1786 AT_KEYWORDS([sack synthetic system file negative])
1787 AT_DATA([sys-file.sack], [dnl
1789 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1790 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1792 dnl String variable with invalid width 256.
1793 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1795 dnl Character encoding record.
1796 7; 20; 1; 12; "windows-1252";
1798 dnl End of dictionary.
1801 for variant in be le; do
1802 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1803 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1805 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1806 [error: `sys-file.sav' near offset 0xb4: Bad width 256 for variable VAR1.
1811 dnl SPSS-generated system file can contain duplicate variable names
1812 dnl (see bug #41475).
1813 AT_SETUP([duplicate variable name])
1814 AT_KEYWORDS([sack synthetic system file negative])
1815 AT_DATA([sys-file.sack], [dnl
1817 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1818 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1820 dnl Numeric variables.
1821 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1822 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1824 dnl Character encoding record.
1825 7; 20; 1; 12; "windows-1252";
1827 dnl End of dictionary.
1830 for variant in be le; do
1831 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1832 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1835 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1836 [warning: `sys-file.sav' near offset 0xd4: Renaming variable with duplicate name `VAR1' to `VAR001'.
1838 Variable,Description,Position
1840 var001,Format: F8.0,2
1845 AT_SETUP([variable label indicator not 0 or 1])
1846 AT_KEYWORDS([sack synthetic system file negative])
1847 AT_DATA([sys-file.sack], [dnl
1849 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1850 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1852 dnl Numeric variable.
1853 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1855 dnl Character encoding record.
1856 7; 20; 1; 12; "windows-1252";
1858 dnl End of dictionary.
1861 for variant in be le; do
1862 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1863 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1865 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1866 [error: `sys-file.sav' near offset 0xb4: Variable label indicator field is not 0 or 1.
1871 AT_SETUP([invalid numeric missing value indicator])
1872 AT_KEYWORDS([sack synthetic system file negative])
1873 AT_DATA([sys-file.sack], [dnl
1875 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1876 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1878 dnl Numeric variable.
1879 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1881 dnl Character encoding record.
1882 7; 20; 1; 12; "windows-1252";
1884 dnl End of dictionary.
1887 for variant in be le; do
1888 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1889 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1891 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1892 ["error: `sys-file.sav' near offset 0xb4: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1897 AT_SETUP([invalid string missing value indicator])
1898 AT_KEYWORDS([sack synthetic system file negative])
1899 AT_DATA([sys-file.sack], [dnl
1901 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1902 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1904 dnl String variable.
1905 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1907 dnl Character encoding record.
1908 7; 20; 1; 12; "windows-1252";
1910 dnl End of dictionary.
1913 for variant in be le; do
1914 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1915 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1917 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1918 ["error: `sys-file.sav' near offset 0xb4: String missing value indicator field is not 0, 1, 2, or 3."
1923 AT_SETUP([missing string continuation record])
1924 AT_KEYWORDS([sack synthetic system file negative])
1925 AT_DATA([sys-file.sack], [dnl
1927 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1928 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1930 dnl String variable.
1931 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1932 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
1934 dnl Character encoding record.
1935 7; 20; 1; 12; "windows-1252";
1937 dnl End of dictionary.
1940 for variant in be le; do
1941 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1942 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1944 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1945 [error: `sys-file.sav' near offset 0xb4: Missing string continuation record.
1950 AT_SETUP([invalid variable format])
1951 AT_KEYWORDS([sack synthetic system file negative])
1952 AT_DATA([sys-file.sack], [dnl
1954 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1955 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1957 dnl Numeric variable, invalid format types.
1958 dnl No warning is issued for type 0 because it has been observed in real
1960 2; 0; 0; 0; >>0xff0800; 0<<; s8 "NUM1";
1962 dnl Numeric variable, string formats.
1963 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
1965 dnl String variable, numeric formats.
1966 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
1968 dnl String variable, wrong width formats.
1969 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
1971 dnl Character encoding record.
1972 7; 20; 1; 12; "windows-1252";
1974 dnl End of dictionary.
1977 for variant in be le; do
1978 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1979 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1981 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1982 warning: `sys-file.sav' near offset 0xc0: Variable NUM1 with width 0 has invalid print format 0xff0800.
1984 warning: `sys-file.sav' near offset 0xe0: Variable VAR1 with width 0 has invalid print format 0x10800.
1986 warning: `sys-file.sav' near offset 0xe4: Variable VAR1 with width 0 has invalid write format 0x21000.
1988 warning: `sys-file.sav' near offset 0x100: Variable STR1 with width 4 has invalid print format 0x50800.
1990 warning: `sys-file.sav' near offset 0x104: Variable STR1 with width 4 has invalid write format 0x110a01.
1992 warning: `sys-file.sav' near offset 0x120: Variable STR2 with width 4 has invalid print format 0x10800.
1994 warning: `sys-file.sav' near offset 0x124: Variable STR2 with width 4 has invalid write format 0x20400.
1999 AT_SETUP([invalid long string missing values])
2000 AT_KEYWORDS([sack synthetic system file negative])
2001 AT_DATA([sys-file.sack], [dnl
2003 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2005 7; dnl Nominal case size
2006 0; dnl Not compressed
2010 "01 Jan 11"; "20:53:52";
2011 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
2014 dnl One numeric variable.
2015 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2017 dnl Long string variables that will have missing values added with a
2019 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2020 2; -1; 0; 0; 0; 0; s8 "";
2021 2; 10; 0; 0; 0x010a00 *2; s8 "STR2";
2022 2; -1; 0; 0; 0; 0; s8 "";
2023 2; 11; 0; 0; 0x010b00 *2; s8 "STR3";
2024 2; -1; 0; 0; 0; 0; s8 "";
2026 dnl Machine integer info record.
2027 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
2029 dnl Machine floating-point info record.
2030 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
2032 dnl Long string variable missing values record.
2034 dnl Zero missing values (not allowed) for STR1 .
2035 COUNT("STR1"); i8 >>0<<;
2037 dnl Four missing values (not allowed) for STR2.
2038 COUNT("STR2"); i8 4;
2039 8; "abcdefgh"; 8; "ijklmnop"; 8; "qrstuvwx"; 8; "yz012345";
2041 dnl Missing values for unknown variable
2042 COUNT(>>"Nonexistent"<<); i8 1; 8; "abcdefgh";
2044 dnl Missing values for numeric variable
2045 COUNT(>>"NUM1"<<); i8 1; 8; "abcdefgh";
2047 dnl Too long missing value
2048 COUNT("STR3"); i8 1; >>COUNT("abcdefghijkl")<<;
2051 dnl Character encoding record.
2052 7; 20; 1; 12; "windows-1252";
2054 dnl Dictionary termination record.
2056 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
2057 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
2058 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
2061 for variant in be le; do
2062 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2063 AT_DATA([sys-file.sps], [dnl
2064 GET FILE='sys-file.sav'.
2067 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2068 ["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."
2070 "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."
2072 warning: `sys-file.sav' near offset 0x242: Ignoring long string missing value record for unknown variable Nonexistent.
2074 warning: `sys-file.sav' near offset 0x257: Ignoring long string missing value record for numeric variable NUM1.
2076 "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."
2078 Variable,Description,Position
2082 Missing Values: ""abcdefgh""; ""ijklmnop""; ""qrstuvwx""",3
2088 AT_SETUP([weighting variable must be numeric])
2089 AT_KEYWORDS([sack synthetic system file negative])
2090 AT_DATA([sys-file.sack], [dnl
2092 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2093 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2095 dnl Numeric variable.
2096 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2098 dnl String variable.
2099 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2101 dnl Character encoding record.
2102 7; 20; 1; 12; "windows-1252";
2104 dnl End of dictionary.
2107 for variant in be le; do
2108 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2109 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2112 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2113 [warning: `sys-file.sav': Ignoring string variable `STR1' set as weighting variable.
2115 Variable,Description,Position
2122 AT_SETUP([bad weighting variable index])
2123 AT_KEYWORDS([sack synthetic system file negative])
2124 AT_DATA([sys-file.sack], [dnl
2126 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2127 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2129 dnl Numeric variable.
2130 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2132 dnl String variable.
2133 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2135 dnl Character encoding record.
2136 7; 20; 1; 12; "windows-1252";
2138 dnl End of dictionary.
2141 for variant in be le; do
2142 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2143 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2145 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2146 [error: `sys-file.sav' near offset 0x4c: Variable index 3 not in valid range 1...2.
2151 AT_SETUP([variable index is long string contination])
2152 AT_KEYWORDS([sack synthetic system file negative])
2153 AT_DATA([sys-file.sack], [dnl
2155 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2156 2; 3; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2158 dnl Numeric variable.
2159 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2161 dnl Long string variable.
2162 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2163 (2; -1; 0; 0; 0; 0; s8 "");
2165 dnl Character encoding record.
2166 7; 20; 1; 12; "windows-1252";
2168 dnl End of dictionary.
2171 for variant in be le; do
2172 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2173 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2175 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2176 [error: `sys-file.sav' near offset 0x4c: Variable index 3 refers to long string continuation.
2181 AT_SETUP([multiple documents records])
2182 AT_KEYWORDS([sack synthetic system file negative])
2183 AT_DATA([sys-file.sack], [dnl
2185 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2186 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2188 dnl Numeric variable, no label or missing values.
2189 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2191 dnl Two document records.
2192 (6; 1; s80 "One line of documents") >>* 2<<;
2194 dnl Dictionary termination record.
2197 dnl Character encoding record.
2198 7; 20; 1; 12; "windows-1252";
2203 for variant in be le; do
2204 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2205 AT_DATA([sys-file.sps], [dnl
2206 GET FILE='sys-file.sav'.
2208 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2209 error: `sys-file.sav' near offset 0x12c: Duplicate type 6 (document) record.
2215 AT_SETUP([empty document record])
2216 AT_KEYWORDS([sack synthetic system file negative])
2217 AT_DATA([sys-file.sack], [dnl
2219 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2220 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2222 dnl Numeric variable, no label or missing values.
2223 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2225 dnl Empty document record.
2228 dnl Dictionary termination record.
2234 for variant in be le; do
2235 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2236 AT_DATA([sys-file.sps], [dnl
2237 GET FILE='sys-file.sav'.
2239 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2240 error: `sys-file.sav' near offset 0xd4: Number of document lines (0) must be greater than 0 and less than 26843545.
2245 AT_SETUP([extension record too large])
2246 AT_KEYWORDS([sack synthetic system file negative])
2247 AT_DATA([sys-file.sack], [dnl
2249 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2250 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2252 dnl Numeric variable, no label or missing values.
2253 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2255 dnl Too-large extension record.
2256 7; 3; >>0xfffff000 * 2<<;
2258 for variant in be le; do
2259 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2260 AT_DATA([sys-file.sps], [dnl
2261 GET FILE='sys-file.sav'.
2263 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2264 error: `sys-file.sav' near offset 0xd8: Record type 7 subtype 3 too large.
2269 AT_SETUP([unknown extension record])
2270 AT_KEYWORDS([sack synthetic system file negative])
2271 AT_DATA([sys-file.sack], [dnl
2273 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2274 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2276 dnl Numeric variable, no label or missing values.
2277 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2279 dnl Unknown extension record type.
2282 dnl Character encoding record.
2283 7; 20; 1; 12; "windows-1252";
2285 dnl End of dictionary.
2288 for variant in be le; do
2289 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2290 AT_DATA([sys-file.sps], [dnl
2291 GET FILE='sys-file.sav'.
2293 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2294 "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}."
2299 AT_SETUP([bad machine integer info size])
2300 AT_KEYWORDS([sack synthetic system file negative])
2301 AT_DATA([sys-file.sack], [dnl
2303 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2304 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2306 dnl Numeric variable, no label or missing values.
2307 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2309 dnl Machine integer info record.
2310 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252; >>1234<<;
2312 dnl Character encoding record.
2313 7; 20; 1; 12; "windows-1252";
2315 dnl End of dictionary.
2318 for variant in be le; do
2319 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2320 AT_DATA([sys-file.sps], [dnl
2321 GET FILE='sys-file.sav'.
2323 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2324 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 3 has bad count 9 (expected 8)."
2329 AT_SETUP([bad machine integer info float format])
2330 AT_KEYWORDS([sack synthetic system file negative])
2331 AT_DATA([sys-file.sack], [dnl
2333 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2334 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2336 dnl Numeric variable, no label or missing values.
2337 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2339 dnl Machine integer info record.
2340 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
2342 dnl Character encoding record.
2343 7; 20; 1; 12; "windows-1252";
2345 dnl End of dictionary.
2348 for variant in be le; do
2349 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2350 AT_DATA([sys-file.sps], [dnl
2351 GET FILE='sys-file.sav'.
2353 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2354 error: `sys-file.sav' near offset 0xd8: Floating-point representation indicated by system file (2) differs from expected (1).
2359 AT_SETUP([bad machine integer info endianness])
2360 AT_KEYWORDS([sack synthetic system file negative])
2361 AT_DATA([sys-file.sack], [dnl
2363 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2364 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2366 dnl Numeric variable, no label or missing values.
2367 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2369 dnl Machine integer info record.
2370 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
2372 dnl Character encoding record.
2373 7; 20; 1; 12; "windows-1252";
2375 dnl End of dictionary.
2378 for variant in "be 1" "le 2"; do
2380 AT_CHECK([sack --$[1] sys-file.sack > sys-file.sav])
2381 AT_DATA([sys-file.sps], [dnl
2382 GET FILE='sys-file.sav'.
2385 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2386 warning: \`sys-file.sav' near offset 0xd8: Integer format indicated by system file (3) differs from expected ($[2]).
2388 Variable,Description,Position
2395 AT_SETUP([bad machine floating-point info size])
2396 AT_KEYWORDS([sack synthetic system file negative])
2397 AT_DATA([sys-file.sack], [dnl
2399 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2400 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2402 dnl Numeric variable, no label or missing values.
2403 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2405 dnl Machine floating-point info record.
2406 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2408 dnl Character encoding record.
2409 7; 20; 1; 12; "windows-1252";
2411 dnl End of dictionary.
2414 for variant in be le; do
2415 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2416 AT_DATA([sys-file.sps], [dnl
2417 GET FILE='sys-file.sav'.
2419 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2420 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 4 has bad count 4 (expected 3)."
2425 AT_SETUP([wrong special floating point values])
2426 AT_KEYWORDS([sack synthetic system file negative])
2427 AT_DATA([sys-file.sack], [dnl
2429 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2430 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2432 dnl Numeric variable, no label or missing values.
2433 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2435 dnl Machine floating-point info record.
2436 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2438 dnl Character encoding record.
2439 7; 20; 1; 12; "windows-1252";
2441 dnl End of dictionary.
2444 for variant in be le; do
2445 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2446 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2448 AT_CHECK([pspp -O format=csv sys-file.sps | sed 's/ [(].*/.../'], [0], [dnl
2449 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 0...
2451 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 1...
2453 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 2...
2458 AT_SETUP([bad mrsets name])
2459 AT_KEYWORDS([sack synthetic system file negative multiple response])
2460 AT_DATA([sys-file.sack], [dnl
2462 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2464 16; dnl Nominal case size
2465 0; dnl Not compressed
2469 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2473 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2474 2; 0; 0; 0; 0x050800 *2; s8 "B";
2475 2; 0; 0; 0; 0x050800 *2; s8 "C";
2478 2; 0; 0; 0; 0x050800 *2; s8 "D";
2479 2; 0; 0; 0; 0x050800 *2; s8 "E";
2480 2; 0; 0; 0; 0x050800 *2; s8 "F";
2481 2; 0; 0; 0; 0x050800 *2; s8 "G";
2484 2; 4; 0; 0; 0x010400 *2; s8 "H";
2485 2; 4; 0; 0; 0x010400 *2; s8 "I";
2486 2; 4; 0; 0; 0x010400 *2; s8 "J";
2489 2; 0; 0; 0; 0x050800 *2; s8 "K";
2490 2; 0; 0; 0; 0x050800 *2; s8 "L";
2491 2; 0; 0; 0; 0x050800 *2; s8 "M";
2494 2; 6; 0; 0; 0x010600 *2; s8 "N";
2495 2; 6; 0; 0; 0x010600 *2; s8 "O";
2496 2; 6; 0; 0; 0x010600 *2; s8 "P";
2498 dnl Machine integer info record.
2499 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2503 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
2504 "b=D2 55 0 g e f d"; i8 10;
2505 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
2509 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
2510 "e=E 11 6 choice 0 n o p"; i8 10);
2512 dnl Character encoding record.
2513 7; 20; 1; 9; "shift_jis";
2515 dnl Dictionary termination record.
2518 for variant in be le; do
2519 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2520 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2521 MRSETS /DISPLAY NAME=ALL.
2523 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2524 warning: `sys-file.sav': Multiple response set name `b' does not begin with `$'.
2526 warning: `sys-file.sav': Multiple response set name `e' does not begin with `$'.
2528 Table: Multiple Response Sets
2529 Name,Variables,Details
2533 ","Multiple category set
2539 ","Multiple dichotomy set
2541 Label source: Provided by user
2543 Category label source: Variable labels
2548 ","Multiple dichotomy set
2549 Label: third mdgroup
2550 Label source: Provided by user
2552 Category label source: Value labels of counted value
2558 AT_SETUP([missing space after C in mrsets])
2559 AT_KEYWORDS([sack synthetic system file negative multiple response])
2560 AT_DATA([sys-file.sack], [dnl
2562 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2563 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2565 dnl Numeric variable, no label or missing values.
2566 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2568 dnl Multiple response sets.
2569 7; 7; 1; COUNT("$a=Cx");
2571 dnl Character encoding record.
2572 7; 20; 1; 12; "windows-1252";
2576 for variant in be le; do
2577 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2578 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2580 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2581 warning: `sys-file.sav' near offset 0xd8: Missing space following `C' at offset 4 in MRSETS record.
2586 AT_SETUP([missing space after E in mrsets])
2587 AT_KEYWORDS([sack synthetic system file negative multiple response])
2588 AT_DATA([sys-file.sack], [dnl
2590 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2591 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2593 dnl Numeric variable, no label or missing values.
2594 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2596 dnl Multiple response sets.
2597 7; 7; 1; COUNT("$a=Ex");
2599 dnl Character encoding record.
2600 7; 20; 1; 12; "windows-1252";
2604 for variant in be le; do
2605 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2606 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2608 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2609 warning: `sys-file.sav' near offset 0xd8: Missing space following `E' at offset 4 in MRSETS record.
2614 AT_SETUP([unexpected label source in mrsets])
2615 AT_KEYWORDS([sack synthetic system file negative multiple response])
2616 AT_DATA([sys-file.sack], [dnl
2618 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2619 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2621 dnl Numeric variable, no label or missing values.
2622 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2624 dnl Multiple response sets.
2625 7; 7; 1; COUNT("$a=E 2");
2627 dnl Character encoding record.
2628 7; 20; 1; 12; "windows-1252";
2632 for variant in be le; do
2633 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2634 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2636 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2637 warning: `sys-file.sav' near offset 0xd8: Unexpected label source value following `E' at offset 7 in MRSETS record.
2639 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 7 in MRSETS record.
2644 AT_SETUP([bad type character in mrsets])
2645 AT_KEYWORDS([sack synthetic system file negative multiple response])
2646 AT_DATA([sys-file.sack], [dnl
2648 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2649 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2651 dnl Numeric variable, no label or missing values.
2652 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2654 dnl Multiple response sets.
2655 7; 7; 1; COUNT("$a=");
2657 dnl Character encoding record.
2658 7; 20; 1; 12; "windows-1252";
2662 for variant in be le; do
2663 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2664 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2666 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2667 "warning: `sys-file.sav' near offset 0xd8: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2672 AT_SETUP([bad counted string length in mrsets])
2673 AT_KEYWORDS([sack synthetic system file negative multiple response])
2674 AT_DATA([sys-file.sack], [dnl
2676 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2677 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2679 dnl Numeric variable, no label or missing values.
2680 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2682 dnl Multiple response sets.
2683 7; 7; 1; COUNT("$a=Dx");
2685 dnl Character encoding record.
2686 7; 20; 1; 12; "windows-1252";
2690 for variant in be le; do
2691 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2692 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2694 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2695 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 4 in MRSETS record.
2700 AT_SETUP([missing space in counted string in mrsets])
2701 AT_KEYWORDS([sack synthetic system file negative multiple response])
2702 AT_DATA([sys-file.sack], [dnl
2704 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2705 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2707 dnl Numeric variable, no label or missing values.
2708 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2710 dnl Multiple response sets.
2711 7; 7; 1; COUNT("$a=D1x");
2713 dnl Character encoding record.
2714 7; 20; 1; 12; "windows-1252";
2718 for variant in be le; do
2719 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2720 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2722 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2723 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 5 in MRSETS record.
2728 AT_SETUP([counted string too long in mrsets])
2729 AT_KEYWORDS([sack synthetic system file negative multiple response])
2730 AT_DATA([sys-file.sack], [dnl
2732 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2733 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2735 dnl Numeric variable, no label or missing values.
2736 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2738 dnl Multiple response sets.
2739 7; 7; 1; COUNT("$a=D4 abc");
2741 dnl Character encoding record.
2742 7; 20; 1; 12; "windows-1252";
2746 for variant in be le; do
2747 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2748 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2750 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2751 warning: `sys-file.sav' near offset 0xd8: 4-byte string starting at offset 6 exceeds record length 9.
2756 AT_SETUP([missing space after counted string in mrsets])
2757 AT_KEYWORDS([sack synthetic system file negative multiple response])
2758 AT_DATA([sys-file.sack], [dnl
2760 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2761 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2763 dnl Numeric variable, no label or missing values.
2764 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2766 dnl Multiple response sets.
2767 7; 7; 1; COUNT("$a=D3 abcx");
2769 dnl Character encoding record.
2770 7; 20; 1; 12; "windows-1252";
2774 for variant in be le; do
2775 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2776 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2778 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2779 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 9 following 3-byte string.
2784 AT_SETUP([missing newline after variable name in mrsets])
2785 AT_KEYWORDS([sack synthetic system file negative multiple response])
2786 AT_DATA([sys-file.sack], [dnl
2788 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2789 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2791 dnl Numeric variable, no label or missing values.
2792 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2794 dnl Multiple response sets.
2795 7; 7; 1; COUNT("$a=C 0 NUM1");
2797 dnl Character encoding record.
2798 7; 20; 1; 12; "windows-1252";
2802 for variant in be le; do
2803 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2804 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2806 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2807 warning: `sys-file.sav' near offset 0xd8: Missing new-line parsing variable names at offset 13 in MRSETS record.
2809 warning: `sys-file.sav': MRSET $a has only one variable.
2814 AT_SETUP([duplicate variable name in mrsets])
2815 AT_KEYWORDS([sack synthetic system file negative multiple response])
2816 AT_DATA([sys-file.sack], [dnl
2818 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2819 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2821 dnl Numeric variable, no label or missing values.
2822 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2824 dnl Multiple response sets.
2825 7; 7; 1; COUNT("$a=C 0 NUM1 NUM1"; i8 10);
2827 dnl Character encoding record.
2828 7; 20; 1; 12; "windows-1252";
2832 for variant in be le; do
2833 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2834 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2836 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2837 warning: `sys-file.sav': MRSET $a contains duplicate variable name NUM1.
2839 warning: `sys-file.sav': MRSET $a has only one variable.
2844 AT_SETUP([mixed variable types in mrsets])
2845 AT_KEYWORDS([sack synthetic system file negative multiple response])
2846 AT_DATA([sys-file.sack], [dnl
2848 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2849 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2852 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2853 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2855 dnl Multiple response sets.
2856 7; 7; 1; COUNT("$a=C 0 NUM1 STR1"; i8 10);
2858 dnl Character encoding record.
2859 7; 20; 1; 12; "windows-1252";
2863 for variant in be le; do
2864 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2865 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2867 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2868 warning: `sys-file.sav': MRSET $a contains both string and numeric variables.
2870 warning: `sys-file.sav': MRSET $a has only one variable.
2875 AT_SETUP([missing newline after variable name in mrsets])
2876 AT_KEYWORDS([sack synthetic system file negative multiple response])
2877 AT_DATA([sys-file.sack], [dnl
2879 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2880 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2882 dnl Numeric variable, no label or missing values.
2883 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2885 dnl Multiple response sets.
2886 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10);
2888 dnl Character encoding record.
2889 7; 20; 1; 12; "windows-1252";
2893 for variant in be le; do
2894 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2895 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2897 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2898 warning: `sys-file.sav': MRSET $a has only one variable.
2903 AT_SETUP([zero or one variable in mrset])
2904 AT_KEYWORDS([sack synthetic system file negative multiple response])
2905 AT_DATA([sys-file.sack], [dnl
2907 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2908 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2910 dnl Numeric variable, no label or missing values.
2911 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2913 dnl Multiple response sets.
2914 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10; "$b=C 0 "; i8 10);
2916 dnl Character encoding record.
2917 7; 20; 1; 12; "windows-1252";
2921 for variant in be le; do
2922 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2923 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2925 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2926 warning: `sys-file.sav': MRSET $a has only one variable.
2928 warning: `sys-file.sav': MRSET $b has no variables.
2933 AT_SETUP([wrong display parameter size])
2934 AT_KEYWORDS([sack synthetic system file negative])
2935 AT_DATA([sys-file.sack], [dnl
2937 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2938 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2940 dnl Numeric variable, no label or missing values.
2941 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2943 dnl Display parameters record.
2944 7; 11; >>8<<; 2; 1.0; 1.0;
2946 dnl Character encoding record.
2947 7; 20; 1; 12; "windows-1252";
2949 dnl End of dictionary.
2952 for variant in be le; do
2953 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2954 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2956 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2957 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 11 has bad size 8 (expected 4)."
2962 AT_SETUP([wrong display parameter count])
2963 AT_KEYWORDS([sack synthetic system file negative])
2964 AT_DATA([sys-file.sack], [dnl
2966 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2967 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2969 dnl Numeric variable, no label or missing values.
2970 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2972 dnl Display parameters record.
2973 7; 11; 4; >>4<<; 1; 1; 2; 2;
2975 dnl Character encoding record.
2976 7; 20; 1; 12; "windows-1252";
2978 dnl End of dictionary.
2981 for variant in be le; do
2982 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2983 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2985 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2986 warning: `sys-file.sav' near offset 0xd8: Extension 11 has bad count 4 (for 1 variables).
2991 AT_SETUP([wrong display measurement level])
2992 AT_KEYWORDS([sack synthetic system file negative])
2993 AT_DATA([sys-file.sack], [dnl
2995 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2996 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2998 dnl Numeric variable, no label or missing values.
2999 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3001 dnl Display parameters record.
3002 7; 11; 4; 2; >>4<<; 0;
3004 dnl Character encoding record.
3005 7; 20; 1; 12; "windows-1252";
3007 dnl End of dictionary.
3010 for variant in be le; do
3011 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3012 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3014 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3015 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
3020 AT_SETUP([wrong display alignment])
3021 AT_KEYWORDS([sack synthetic system file negative])
3022 AT_DATA([sys-file.sack], [dnl
3024 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3025 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3027 dnl Numeric variable, no label or missing values.
3028 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3030 dnl Display parameters record.
3031 7; 11; 4; 2; 1; >>-1<<;
3033 dnl Character encoding record.
3034 7; 20; 1; 12; "windows-1252";
3036 dnl End of dictionary.
3039 for variant in be le; do
3040 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3041 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3043 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3044 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
3049 AT_SETUP([bad variable name in variable/value pair])
3050 AT_KEYWORDS([sack synthetic system file negative])
3051 AT_DATA([sys-file.sack], [dnl
3053 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3054 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3056 dnl Numeric variables.
3057 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
3059 dnl Long variable names.
3060 7; 13; 1; COUNT (>>"xyzzy"<<);
3062 dnl Character encoding record.
3063 7; 20; 1; 12; "windows-1252";
3065 dnl Dictionary termination record.
3068 for variant in be le; do
3069 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3070 AT_DATA([sys-file.sps], [dnl
3071 GET FILE='sys-file.sav'.
3073 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3074 warning: `sys-file.sav' near offset 0xde: Dictionary record refers to unknown variable xyzzy.
3079 AT_SETUP([duplicate long variable name])
3080 AT_KEYWORDS([sack synthetic system file negative])
3081 AT_DATA([sys-file.sack], [dnl
3083 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3084 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3086 dnl Numeric variables.
3087 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
3088 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
3089 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
3090 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
3092 dnl Long variable names.
3094 "LONGVARI=_Invalid"; i8 9;
3095 "LONGVARI=$Invalid"; i8 9;
3096 "LONGVARI=#Invalid"; i8 9;
3097 "LONGVA_A=LongVariableName"; i8 9;
3098 "LONGVA_B=LONGVARIABLENAME"; i8 9;
3101 dnl Character encoding record.
3102 7; 20; 1; 12; "windows-1252";
3104 dnl Dictionary termination record.
3107 for variant in be le; do
3108 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3109 AT_DATA([sys-file.sps], [dnl
3110 GET FILE='sys-file.sav'.
3112 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3113 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
3115 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `$Invalid'.
3117 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `#Invalid'.
3119 warning: `sys-file.sav' near offset 0x138: Duplicate long variable name `LONGVARIABLENAME'.
3124 AT_SETUP([bad very long string length])
3125 AT_KEYWORDS([sack synthetic system file negative])
3126 AT_DATA([sys-file.sack], [dnl
3128 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3129 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3131 dnl Numeric variable.
3132 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3134 dnl Very long string map.
3136 "NUM1=00000"; i8 0; i8 9;
3137 "NUM1=00255"; i8 0; i8 9;
3138 "NUM1=00256"; i8 0; i8 9;
3141 dnl Character encoding record.
3142 7; 20; 1; 12; "windows-1252";
3144 dnl Dictionary termination record.
3147 for variant in be le; do
3148 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3149 AT_DATA([sys-file.sps], [dnl
3150 GET FILE='sys-file.sav'.
3152 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3153 warning: `sys-file.sav' near offset 0xd8: NUM1 listed as string of invalid length 00000 in very long string record.
3155 "warning: `sys-file.sav' near offset 0xd8: NUM1 listed in very long string record with width 00255, which requires only one segment."
3157 error: `sys-file.sav' near offset 0xd8: Very long string NUM1 overflows dictionary.
3162 AT_SETUP([bad very long string segment width])
3163 AT_KEYWORDS([sack synthetic system file negative])
3164 AT_DATA([sys-file.sack], [dnl
3166 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3167 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3170 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
3171 (2; -1; 0; 0; 0; 0; s8 "") * 31;
3172 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
3173 >>2; -1; 0; 0; 0; 0; s8 "";<<
3175 dnl Very long string map.
3177 "STR1=00256"; i8 0; i8 9;
3180 dnl Character encoding record.
3181 7; 20; 1; 12; "windows-1252";
3183 dnl Dictionary termination record.
3186 for variant in be le; do
3187 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3188 AT_DATA([sys-file.sps], [dnl
3189 GET FILE='sys-file.sav'.
3191 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3192 error: `sys-file.sav' near offset 0x4f8: Very long string with width 256 has segment 1 of width 9 (expected 4).
3197 AT_SETUP([too many value labels])
3198 AT_KEYWORDS([sack synthetic system file negative])
3199 AT_DATA([sys-file.sack], [dnl
3201 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3202 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3204 dnl Numeric variable.
3205 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3208 for variant in be le; do
3209 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3210 AT_DATA([sys-file.sps], [dnl
3211 GET FILE='sys-file.sav'.
3213 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3214 error: `sys-file.sav' near offset 0xd4: Invalid number of labels 2147483647.
3219 AT_SETUP([missing type 4 record])
3220 AT_KEYWORDS([sack synthetic system file negative])
3221 AT_DATA([sys-file.sack], [dnl
3223 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3224 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3226 dnl Numeric variable.
3227 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3229 dnl Value label with missing type 4 record.
3230 3; 1; 1.0; i8 3; s7 "one";
3232 dnl Character encoding record.
3233 7; 20; 1; 12; "windows-1252";
3235 dnl End of dictionary.
3238 for variant in be le; do
3239 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3240 AT_DATA([sys-file.sps], [dnl
3241 GET FILE='sys-file.sav'.
3243 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3244 error: `sys-file.sav' near offset 0xe8: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
3249 AT_SETUP([value label with no associated variables])
3250 AT_KEYWORDS([sack synthetic system file negative])
3251 AT_DATA([sys-file.sack], [dnl
3253 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3254 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3256 dnl Numeric variable.
3257 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3259 dnl Value label with no variables.
3260 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
3262 for variant in be le; do
3263 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3264 AT_DATA([sys-file.sps], [dnl
3265 GET FILE='sys-file.sav'.
3267 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3268 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).
3273 AT_SETUP([type 4 record names long string variable])
3274 AT_KEYWORDS([sack synthetic system file negative])
3275 AT_DATA([sys-file.sack], [dnl
3277 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3278 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3280 dnl Long string variable.
3281 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3282 2; -1; 0; 0; 0; 0; s8 "";
3284 dnl Value label that names long string variable.
3285 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
3287 dnl Character encoding record.
3288 7; 20; 1; 12; "windows-1252";
3290 dnl End of dictionary.
3293 for variant in be le; do
3294 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3295 AT_DATA([sys-file.sps], [dnl
3296 GET FILE='sys-file.sav'.
3298 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3299 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.
3304 AT_SETUP([variables for value label must all be same type])
3305 AT_KEYWORDS([sack synthetic system file negative])
3306 AT_DATA([sys-file.sack], [dnl
3308 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3309 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3312 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3313 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3315 dnl Value label that names numeric and string variables.
3316 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
3318 dnl Character encoding record.
3319 7; 20; 1; 12; "windows-1252";
3321 dnl End of dictionary.
3324 for variant in be le; do
3325 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3326 AT_DATA([sys-file.sps], [dnl
3327 GET FILE='sys-file.sav'.
3329 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3330 "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."
3335 AT_SETUP([duplicate value labels type])
3336 AT_KEYWORDS([sack synthetic system file negative])
3337 AT_DATA([sys-file.sack], [dnl
3339 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3340 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3343 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3344 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3346 dnl Duplicate value labels.
3347 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
3348 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
3350 dnl Character encoding record.
3351 7; 20; 1; 12; "windows-1252";
3353 dnl End of dictionary.
3356 for variant in be le; do
3357 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3358 AT_DATA([sys-file.sps], [dnl
3359 GET FILE='sys-file.sav'.
3361 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3362 warning: `sys-file.sav' near offset 0xf4: Duplicate value label for `xyzzy ' on STR1.
3364 warning: `sys-file.sav' near offset 0x11c: Duplicate value label for 1 on NUM1.
3369 AT_SETUP([missing attribute value])
3370 AT_KEYWORDS([sack synthetic system file negative])
3371 AT_DATA([sys-file.sack], [dnl
3373 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3374 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3377 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3379 dnl Data file attributes record.
3384 dnl Variable attributes record.
3390 dnl Character encoding record.
3391 7; 20; 1; 12; "windows-1252";
3393 dnl Dictionary termination record.
3396 for variant in be le; do
3397 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3398 AT_DATA([sys-file.sps], [dnl
3399 GET FILE='sys-file.sav'.
3401 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3402 warning: `sys-file.sav' near offset 0xde: Error parsing attribute value Attr1[[1]].
3404 warning: `sys-file.sav' near offset 0x101: Error parsing attribute value fred[[2]].
3409 AT_SETUP([unquoted attribute value])
3410 AT_KEYWORDS([sack synthetic system file negative])
3411 AT_DATA([sys-file.sack], [dnl
3413 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3414 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3417 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3419 dnl Data file attributes record.
3421 "Attr1(value"; i8 10;
3425 dnl Variable attributes record.
3428 "fred(23"; i8 10; ")"
3431 dnl Character encoding record.
3432 7; 20; 1; 12; "windows-1252";
3434 dnl Dictionary termination record.
3437 for variant in be le; do
3438 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3439 AT_DATA([sys-file.sps], [dnl
3440 GET FILE='sys-file.sav'.
3442 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3443 warning: `sys-file.sav' near offset 0xe4: Attribute value Attr1[[1]] is not quoted: value.
3445 warning: `sys-file.sav' near offset 0x106: Attribute value fred[[1]] is not quoted: 23.
3450 AT_SETUP([bad variable name in long string value label])
3451 AT_KEYWORDS([sack synthetic system file negative])
3452 AT_DATA([sys-file.sack], [dnl
3454 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3455 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3458 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3459 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3460 2; -1; 0; 0; 0; 0; s8 "";
3463 dnl No variable named STR9.
3464 COUNT(>>"STR9"<<); 9;
3465 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3467 dnl NUM1 is numeric.
3468 COUNT(>>"NUM1"<<); 0;
3469 1; COUNT("xyz"); COUNT("value label for 1.0");
3471 dnl Wrong width for STR14.
3472 COUNT("STR14"); >>9<<;
3473 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3475 dnl Wrong width for value.
3477 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3479 dnl Duplicate value label.
3480 COUNT("STR14"); 14; 2;
3481 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3482 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3485 dnl Character encoding record.
3486 7; 20; 1; 12; "windows-1252";
3488 dnl Dictionary termination record.
3491 for variant in be le; do
3492 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3493 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3495 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3496 warning: `sys-file.sav' near offset 0x128: Ignoring long string value label record for unknown variable STR9.
3498 warning: `sys-file.sav' near offset 0x164: Ignoring long string value label record for numeric variable NUM1.
3500 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).
3502 "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."
3504 warning: `sys-file.sav' near offset 0x259: Duplicate value label for `abcdefghijklmn' on str14.
3509 AT_SETUP([fewer data records than indicated by file header])
3510 AT_KEYWORDS([sack synthetic system file negative])
3511 AT_DATA([sys-file.sack], [dnl
3513 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3514 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3516 dnl Numeric variables.
3517 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3518 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3520 dnl Character encoding record.
3521 7; 20; 1; 12; "windows-1252";
3529 dnl Missing record here.
3531 for variant in be le; do
3532 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3533 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3536 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3537 [error: Error reading case from file `sys-file.sav'.
3549 AT_SETUP([partial data record between variables])
3550 AT_KEYWORDS([sack synthetic system file negative])
3551 AT_DATA([sys-file.sack], [dnl
3553 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3554 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3556 dnl Numeric variables.
3557 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3558 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3560 dnl Character encoding record.
3561 7; 20; 1; 12; "windows-1252";
3568 for variant in be le; do
3569 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3570 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3573 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3574 [error: `sys-file.sav' near offset 0x12c: File ends in partial case.
3583 AT_SETUP([partial data record within long string])
3584 AT_KEYWORDS([sack synthetic system file negative])
3585 AT_DATA([sys-file.sack], [dnl
3587 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3588 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3590 dnl Numeric variables.
3591 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3592 2; -1; 0; 0; 0; 0; s8 "";
3594 dnl Character encoding record.
3595 7; 20; 1; 12; "windows-1252";
3599 s14 "one data item";
3602 for variant in be le; do
3603 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3604 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3607 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3608 [error: `sys-file.sav' near offset 0x12a: Unexpected end of file.
3617 AT_SETUP([partial compressed data record])
3618 AT_KEYWORDS([sack synthetic system file positive])
3619 AT_DATA([sys-file.sack], [dnl
3621 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3623 6; dnl Nominal case size
3626 -1; dnl Unspecified number of cases.
3628 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3631 dnl Numeric variables.
3632 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3633 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3635 dnl String variable.
3636 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3637 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3638 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3639 2; -1; 0; 0; 0; 0; s8 "";
3641 dnl Character encoding record.
3642 7; 20; 1; 12; "windows-1252";
3644 dnl Dictionary termination record.
3647 dnl Compressed data.
3648 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3650 for variant in be le; do
3651 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3652 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3655 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3656 [error: `sys-file.sav' near offset 0x1ac: File ends in partial case.
3659 num1,num2,str4,str8,str15
3660 -99,0,,abcdefgh,0123 @&t@
3665 AT_SETUP([zcompressed data - bad zheader_ofs])
3666 AT_KEYWORDS([sack synthetic system file negative zlib])
3667 zcompressed_sack | sed 's/.*zheader_ofs.*/>>i64 0<<;/' > sys-file.sack
3668 for variant in be le; do
3669 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3670 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3672 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).
3677 AT_SETUP([zcompressed data - bad ztrailer_ofs])
3678 AT_KEYWORDS([sack synthetic system file negative zlib])
3679 zcompressed_sack | sed 's/.*ztrailer_ofs.*/>>i64 0<<;/' > sys-file.sack
3680 for variant in be le; do
3681 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3682 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3684 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Impossible ZLIB trailer offset 0x0.
3689 # ztrailer_len must be a multiple of 24 and at least 48,
3690 # so a value of 12 is impossible.
3691 AT_SETUP([zcompressed data - invalid ztrailer_len])
3692 AT_KEYWORDS([sack synthetic system file negative zlib])
3693 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 12<<;/' > sys-file.sack
3694 for variant in be le; do
3695 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3696 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3698 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Invalid ZLIB trailer length 12.
3703 # ztrailer_ofs + ztrailer_len must be the file size.
3704 AT_SETUP([zcompressed data - wrong ztrailer_len])
3705 AT_KEYWORDS([sack synthetic system file negative zlib])
3706 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 72<<;/' > sys-file.sack
3707 for variant in be le; do
3708 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3709 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3711 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).
3712 error: `sys-file.sav' near offset 0x21d: 72-byte ZLIB trailer specifies 1 data blocks (expected 2).
3717 AT_SETUP([zcompressed data - wrong ztrailer_bias])
3718 AT_KEYWORDS([sack synthetic system file negative zlib])
3719 zcompressed_sack | sed 's/.*ztrailer_bias.*/>>i64 0<<;/' > sys-file.sack
3720 for variant in be le; do
3721 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3722 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3724 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).
3729 AT_SETUP([zcompressed data - wrong ztrailer_zero])
3730 AT_KEYWORDS([sack synthetic system file negative zlib])
3731 zcompressed_sack | sed 's/.*ztrailer_zero.*/>>i64 100<<;/' > sys-file.sack
3732 for variant in be le; do
3733 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3734 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3736 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.
3741 AT_SETUP([zcompressed data - wrong block_size])
3742 AT_KEYWORDS([sack synthetic system file negative zlib])
3743 zcompressed_sack | sed 's/.*block_size.*/>>0x1000<<;/' > sys-file.sack
3744 for variant in be le; do
3745 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3746 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3748 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.
3753 AT_SETUP([zcompressed data - wrong n_blocks])
3754 AT_KEYWORDS([sack synthetic system file negative zlib])
3755 zcompressed_sack | sed 's/.*n_blocks.*/>>2<<;/' > sys-file.sack
3756 for variant in be le; do
3757 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3758 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3760 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).
3765 AT_SETUP([zcompressed data - wrong uncompressed_ofs])
3766 AT_KEYWORDS([sack synthetic system file negative zlib])
3767 zcompressed_sack | sed 's/.*uncompressed_ofs.*/i64 >>0x177<<;/' > sys-file.sack
3768 for variant in be le; do
3769 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3770 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3772 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.
3777 AT_SETUP([zcompressed data - wrong compressed_ofs])
3778 AT_KEYWORDS([sack synthetic system file negative zlib])
3779 zcompressed_sack | sed 's/.*@%:@ compressed_ofs.*/i64 >>0x191<<;/' > sys-file.sack
3780 for variant in be le; do
3781 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3782 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3784 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.
3789 AT_SETUP([zcompressed data - compressed sizes don't add up])
3790 AT_KEYWORDS([sack synthetic system file negative zlib])
3791 AT_DATA([sys-file.sack], [dnl
3793 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3795 6; dnl Nominal case size
3796 2; dnl zlib compressed
3798 -1; dnl Unspecified number of cases.
3800 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3803 dnl Numeric variables.
3804 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3805 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3807 dnl String variable.
3808 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3809 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3810 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3811 2; -1; 0; 0; 0; 0; s8 "";
3813 dnl Character encoding record.
3814 7; 20; 1; 12; "windows-1252";
3816 dnl Dictionary termination record.
3819 dnl ZLIB data header.
3820 i64 0x194; # zheader_ofs
3821 i64 0x1ac; # ztrailer_ofs
3822 i64 72; # ztrailer_len
3824 dnl This is where the ZLIB data blocks would go, but we don't need any to
3825 dnl provoke this message so we omit them.
3827 dnl ZLIB data trailer fixed header:
3828 i64 -100; # ztrailer_bias
3829 i64 0; # ztrailer_zero
3830 0x3ff000; # block_size
3833 dnl ZLIB block descriptor 1:
3834 i64 0x194; # uncompressed_ofs
3835 i64 0x1ac; # compressed_ofs
3836 0x100000; # uncompressed_size
3837 0x12345; # compressed_size
3839 dnl ZLIB block descriptor 2:
3840 i64 0x100194; # uncompressed_ofs
3841 i64 0x12421; # compressed_ofs
3842 0x100000; # uncompressed_size
3843 0x12345; # compressed_size
3845 for variant in be le; do
3846 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3847 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3849 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.
3850 error: `sys-file.sav' near offset 0x1dc: ZLIB block descriptor 1 reported compressed data offset 0x12421, when 0x124f1 was expected.
3855 AT_SETUP([zcompressed data - uncompressed_size > block_size])
3856 AT_KEYWORDS([sack synthetic system file negative zlib])
3857 zcompressed_sack | sed 's/.*uncompressed_size.*/>>0x400000<<;/' > sys-file.sack
3858 for variant in be le; do
3859 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3860 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3862 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.
3867 AT_SETUP([zcompressed data - compression expands data too much])
3868 AT_KEYWORDS([sack synthetic system file negative zlib])
3869 zcompressed_sack | sed 's/.*uncompressed_size.*/>>50<<;/
3870 s/.*@%:@ compressed_size.*/>>100<<;/' > sys-file.sack
3871 for variant in be le; do
3872 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3873 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3875 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.
3880 AT_SETUP([zcompressed data - compressed sizes don't add up])
3881 AT_KEYWORDS([sack synthetic system file negative zlib])
3882 zcompressed_sack | sed 's/.*@%:@ compressed_size.*/>>88<<;/' > sys-file.sack
3883 for variant in be le; do
3884 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3885 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3887 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.
3893 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467004.
3894 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
3895 # See also https://security-tracker.debian.org/tracker/CVE-2017-10791.
3896 # Found by team OWL337, using the collAFL fuzzer.
3897 AT_SETUP([integer overflows in long string missing values])
3898 cp $top_srcdir/tests/data/CVE-2017-10791.sav .
3899 AT_CHECK([pspp-convert -O csv CVE-2017-10791.sav -], [0], [], [dnl
3900 `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.
3901 `CVE-2017-10791.sav' near offset 0x217: Extension record subtype 21 ends unexpectedly.
3906 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467005.
3907 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
3908 # See also https://security-tracker.debian.org/tracker/CVE-2017-10792.
3909 # Reported by team OWL337, with fuzzer collAFL.
3910 AT_SETUP([null dereference skipping bad extension record 18])
3911 cp $top_srcdir/tests/data/CVE-2017-10792.sav .
3912 AT_CHECK([pspp-convert -O csv CVE-2017-10792.sav -], [0], [], [dnl
3913 `CVE-2017-10792.sav' near offset 0x1c0: Record type 7, subtype 18 has bad size 4 (expected 1).
3914 `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.