1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
17 AT_BANNER([system file reader - positive])
19 AT_SETUP([variable labels and missing values])
20 AT_KEYWORDS([sack synthetic system file positive])
21 AT_DATA([sys-file.sack], [dnl
23 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
25 28; dnl Nominal case size
30 "01 Jan 11"; "20:53:52";
31 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
34 dnl Numeric variable, no label or missing values.
35 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
37 dnl Numeric variable, variable label.
38 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
39 32; "Numeric variable 2's label ("; i8 249; i8 250; i8 251; ")";
41 dnl Numeric variable, one missing value.
42 2; 0; 0; 1; 0x050800 *2; s8 "NUM3";
45 dnl Numeric variable, variable label and missing value.
46 2; 0; 1; 1; 0x050800 *2; s8 "NUM4";
47 30; "Another numeric variable label"; i8 0 * 2;
50 dnl Numeric variable, two missing values.
51 2; 0; 0; 2; 0x050800 *2; s8 "NUM5"; 1.0; 2.0;
53 dnl Numeric variable, three missing values.
54 2; 0; 0; 3; 0x050800 *2; s8 "NUM6"; 1.0; 2.0; 3.0;
56 dnl Numeric variable, range of missing values.
57 2; 0; 0; -2; 0x050800 *2; s8 "NUM7"; 1.0; 3.0;
59 dnl Numeric variables, range of missing values plus discrete value.
60 2; 0; 0; -3; 0x050800 *2; s8 "NUM8"; 1.0; 3.0; 5.0;
61 2; 0; 0; -3; 0x050800 *2; s8 "NUM9"; 1.0; HIGHEST; -5.0;
62 2; 0; 0; -3; 0x050800 *2; "NUM"; i8 192; i8 200; i8 204; i8 209; i8 210;
65 dnl String variable, no label or missing values.
66 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
68 dnl String variable, variable label.
69 2; 4; 1; 0; 0x010400 *2; s8 "STR2";
70 25; "String variable 2's label"; i8 0 * 3;
72 dnl String variable, one missing value.
73 2; 4; 0; 1; 0x010400 *2; s8 "STR3"; s8 "MISS";
75 dnl String variable, variable label and missing value.
76 2; 4; 1; 1; 0x010400 *2; s8 "STR4";
77 29; "Another string variable label"; i8 0 * 3;
80 dnl String variable, two missing values.
81 2; 4; 0; 2; 0x010400 *2; s8 "STR5"; s8 "MISS"; s8 "OTHR";
83 dnl String variable, three missing values.
84 2; 4; 0; 3; 0x010400 *2; s8 "STR6"; s8 "MISS"; s8 "OTHR"; s8 "MORE";
86 dnl Long string variable, one missing value.
87 dnl (This is not how SPSS represents missing values for long strings--it
88 dnl uses a separate record as shown later below--but old versions of PSPP
89 dnl did use this representation so we continue supporting it for backward
91 2; 11; 0; 1; 0x010b00 *2; s8 "STR7"; "first8by";
92 2; -1; 0; 0; 0; 0; s8 "";
94 dnl Long string variables that will have missing values added with a
96 2; 9; 0; 0; 0x010900 *2; s8 "STR8";
97 2; -1; 0; 0; 0; 0; s8 "";
98 2; 10; 0; 0; 0x010a00 *2; s8 "STR9";
99 2; -1; 0; 0; 0; 0; s8 "";
100 2; 11; 0; 0; 0x010b00 *2; s8 "STR10";
101 2; -1; 0; 0; 0; 0; s8 "";
103 dnl Long string variable, value label.
104 2; 25; 1; 0; 0x011900 *2; s8 "STR11"; 14; "25-byte string"; i8 0 * 2;
105 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
106 dnl Variable label fields on continuation records have been spotted in system
107 dnl files created by "SPSS Power Macintosh Release 6.1".
108 2; -1; 1; 0; 0; 0; s8 ""; 20; "dummy variable label";
110 dnl Machine integer info record.
111 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
113 dnl Machine floating-point info record.
114 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
116 dnl Long string variable missing values record.
118 dnl One missing value for STR8.
119 COUNT("STR8"); i8 1; 8; "abcdefgh";
121 dnl Two missing values for STR9.
122 COUNT("STR9"); i8 2; 8; "abcdefgh"; 8; "01234567";
124 dnl Three missing values for STR9.
125 COUNT("STR10"); i8 3; 8; "abcdefgh"; 8; "01234567"; 8; "0 ";
128 dnl Character encoding record.
129 7; 20; 1; 12; "windows-1252";
131 dnl Dictionary termination record.
135 1.0; 2.0; 3.0; 4.0; 5.0; 6.0; 7.0; 8.0; 9.0; 10.0;
136 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
137 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
138 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
140 for variant in be le; do
141 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
142 AT_DATA([sys-file.sps], [dnl
143 GET FILE='sys-file.sav'.
148 AT_CHECK([pspp -o pspp.csv sys-file.sps])
149 AT_CHECK([cat pspp.csv], [0], [dnl
150 File label: PSPP synthetic test file: ôõöø
153 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
154 num1,1,,Scale,Input,8,Right,F8.0,F8.0,
155 num2,2,Numeric variable 2's label (ùúû),Scale,Input,8,Right,F8.0,F8.0,
156 num3,3,,Scale,Input,8,Right,F8.0,F8.0,1
157 num4,4,Another numeric variable label,Scale,Input,8,Right,F8.0,F8.0,1
158 num5,5,,Scale,Input,8,Right,F8.0,F8.0,1; 2
159 num6,6,,Scale,Input,8,Right,F8.0,F8.0,1; 2; 3
160 num7,7,,Scale,Input,8,Right,F8.0,F8.0,1 THRU 3
161 num8,8,,Scale,Input,8,Right,F8.0,F8.0,1 THRU 3; 5
162 num9,9,,Scale,Input,8,Right,F8.0,F8.0,1 THRU HIGHEST; -5
163 numàèìñò,10,,Scale,Input,8,Right,F8.0,F8.0,LOWEST THRU 1; 5
164 str1,11,,Nominal,Input,4,Left,A4,A4,
165 str2,12,String variable 2's label,Nominal,Input,4,Left,A4,A4,
166 str3,13,,Nominal,Input,4,Left,A4,A4,"""MISS"""
167 str4,14,Another string variable label,Nominal,Input,4,Left,A4,A4,"""OTHR"""
168 str5,15,,Nominal,Input,4,Left,A4,A4,"""MISS""; ""OTHR"""
169 str6,16,,Nominal,Input,4,Left,A4,A4,"""MISS""; ""OTHR""; ""MORE"""
170 str7,17,,Nominal,Input,11,Left,A11,A11,"""first8by"""
171 str8,18,,Nominal,Input,9,Left,A9,A9,"""abcdefgh"""
172 str9,19,,Nominal,Input,10,Left,A10,A10,"""abcdefgh""; ""01234567"""
173 str10,20,,Nominal,Input,11,Left,A11,A11,"""abcdefgh""; ""01234567""; ""0 """
174 str11,21,25-byte string,Nominal,Input,25,Left,A25,A25,
177 num1,num2,num3,num4,num5,num6,num7,num8,num9,numàèìñò,str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11
178 1,2,3,4,5,6,7,8,9,10,abcd,efgh,ijkl,mnop,qrst,uvwx,yzABCDEFGHI,JKLMNOPQR,STUVWXYZ01,23456789abc,defghijklmnopqstuvwxyzABC
183 AT_SETUP([unspecified number of variable positions])
184 AT_KEYWORDS([sack synthetic system file positive])
185 AT_DATA([sys-file.sack], [dnl
187 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
189 -1; dnl Nominal case size (unspecified)
190 0; dnl Not compressed
194 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
197 dnl Numeric variable, no label or missing values.
198 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
200 dnl Numeric variable, variable label.
201 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
202 26; "Numeric variable 2's label"; i8 0 *2;
204 dnl Character encoding record.
205 7; 20; 1; 12; "windows-1252";
207 dnl Dictionary termination record.
213 for variant in be le; do
214 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
215 AT_DATA([sys-file.sps], [dnl
216 GET FILE='sys-file.sav'.
220 AT_CHECK([pspp -o pspp.csv sys-file.sps])
221 AT_CHECK([cat pspp.csv], [0], [dnl
223 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
224 num1,1,,Scale,Input,8,Right,F8.0,F8.0,
225 num2,2,Numeric variable 2's label,Scale,Input,8,Right,F8.0,F8.0,
234 AT_SETUP([wrong number of variable positions but version 13])
235 AT_KEYWORDS([sack synthetic system file positive])
236 AT_DATA([sys-file.sack], [dnl
238 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
240 -1; dnl Nominal case size (unspecified)
241 0; dnl Not compressed
245 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
248 dnl Numeric variable, no label or missing values.
249 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
251 dnl Numeric variable, variable label.
252 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
253 26; "Numeric variable 2's label"; i8 0 *2;
255 dnl Machine integer info record (SPSS 13).
256 7; 3; 4; 8; 13; 2; 3; -1; 1; 1; ENDIAN; 1252;
258 dnl Character encoding record.
259 7; 20; 1; 12; "windows-1252";
261 dnl Dictionary termination record.
267 for variant in be le; do
268 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
269 AT_DATA([sys-file.sps], [dnl
270 GET FILE='sys-file.sav'.
274 AT_CHECK([pspp -o pspp.csv sys-file.sps])
275 AT_CHECK([cat pspp.csv], [0], [dnl
277 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
278 num1,1,,Scale,Input,8,Right,F8.0,F8.0,
279 num2,2,Numeric variable 2's label,Scale,Input,8,Right,F8.0,F8.0,
288 AT_SETUP([value labels])
289 AT_KEYWORDS([sack synthetic system file positive])
290 AT_DATA([sys-file.sack], [dnl
292 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
294 22; dnl Nominal case size
295 0; dnl Not compressed
299 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
302 dnl Numeric variables.
303 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
304 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
305 2; 0; 0; 0; 0x050800 *2; s8 "NUM3";
306 2; 0; 0; 0; 0x050800 *2; s8 "NUM4";
307 2; 0; 0; 0; 0x050800 *2; s8 "NUM5";
309 dnl String variables.
310 2; 1; 0; 0; 0x010100 *2; s8 "STR1"; dnl index 6
311 2; 2; 0; 0; 0x010200 *2; s8 "STR2"; dnl index 7
312 2; 3; 0; 0; 0x010300 *2; s8 "STR3"; dnl index 8
313 2; 4; 0; 0; 0x010400 *2; s8 "STR4"; dnl index 9
314 2; 4; 0; 0; 0x010400 *2; s8 "STR5"; dnl index 10
315 2; 6; 0; 0; 0x010600 *2; s8 "STR6"; dnl index 11
316 2; 7; 0; 0; 0x010700 *2; s8 "STR7"; dnl index 12
317 2; 8; 0; 0; 0x010800 *2; s8 "STR8"; dnl index 13
318 2; 9; 0; 0; 0x010900 *2; "STR9"; i8 230; s3 ""; dnl index 14
319 2; -1; 0; 0; 0; 0; s8 "";
320 2; 12; 0; 0; 0x010c00 *2; s8 "STR12"; dnl index 16
321 2; -1; 0; 0; 0; 0; s8 "";
322 2; 16; 0; 0; 0x011000 *2; s8 "STR16"; dnl index 18
323 2; -1; 0; 0; 0; 0; s8 "";
324 2; 17; 0; 0; 0x011100 *2; s8 "STR17"; dnl index 20
325 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
327 dnl One value label for NUM1.
328 3; 1; 1.0; i8 17; i8 238; i8 228; i8 232; i8 237; s19 " (in Russian)"; 4; 1; 1;
330 dnl Two value labels for NUM2, as a single pair of type 3 and type 4 records.
331 3; 2; 1.0; i8 3; s7 "one"; 2.0; i8 3; s7 "two"; 4; 1; 2;
333 dnl Two value labels for NUM3, as two pairs of type 3 and type 4 records.
334 3; 1; 3.0; i8 5; s7 "three"; 4; 1; 3;
335 3; 1; 4.0; i8 4; s7 "four"; 4; 1; 3;
337 dnl Two common value labels for NUM4 and NUM5, plus two different ones for each.
338 3; 1; 5.0; i8 4; s7 "five"; 4; 1; 4;
339 3; 1; 6.0; i8 3; s7 "six"; 4; 1; 5;
340 3; 2; 7.0; i8 5; s7 "seven"; 8.0; i8 5; s7 "eight"; 4; 2; 4; 5;
341 3; 1; 9.0; i8 4; s7 "nine"; 4; 1; 4;
342 3; 1; 10.0; i8 3; s7 "ten"; 4; 1; 5;
344 dnl One value label for STR1.
345 3; 1; s8 "a"; i8 19; s23 "value label for `a'"; 4; 1; 6;
347 dnl Two value labels for STR2, as a single pair of type 3 and type 4 records.
349 s8 "bc"; i8 20; s23 "value label for `bc'";
350 s8 "de"; i8 20; s23 "value label for `de'";
353 dnl Two value labels for STR3, as two pairs of type 3 and type 4 records.
354 3; 1; s8 "fgh"; i8 21; s23 "value label for `fgh'"; 4; 1; 8;
355 3; 1; s8 "ijk"; i8 21; s23 "value label for `ijk'"; 4; 1; 8;
357 dnl Two common value labels for STR4 and STR5, plus two different ones for each.
358 3; 1; s8 "lmno"; i8 22; s23 "value label for `lmno'"; 4; 1; 9;
359 3; 1; s8 "pqrs"; i8 22; s23 "value label for `pqrs'"; 4; 1; 10;
361 s8 "tuvw"; i8 22; s23 "value label for `tuvw'";
362 s8 "xyzA"; i8 22; s23 "value label for `xyzA'";
364 3; 1; s8 "BCDE"; i8 22; s23 "value label for `BCDE'"; 4; 1; 9;
365 3; 1; s8 "FGHI"; i8 22; s23 "value label for `FGHI'"; 4; 1; 10;
367 dnl One value label for STR6, STR7, STR8.
368 3; 1; s8 "JKLMNO"; i8 24; s31 "value label for `JKLMNO'"; 4; 1; 11;
369 3; 1; s8 "JKLMNOP"; i8 25; s31 "value label for `JKLMNOP'"; 4; 1; 12;
370 3; 1; s8 "JKLMNOPQ"; i8 26; s31 "value label for `JKLMNOPQ'"; 4; 1; 13;
372 dnl Machine integer info record.
373 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1251;
375 dnl Character encoding record.
376 7; 20; 1; 12; "windows-1251";
379 dnl One value label for STR9ж,
380 COUNT("STR9"; i8 230); 9; 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
382 dnl Two value labels for STR12.
383 COUNT("STR12"); 12; 2;
384 COUNT("0123456789ab"); COUNT("value label for `0123456789ab'");
385 COUNT("cdefghijklmn"); COUNT("value label for `cdefghijklmn'");
387 dnl Three value labels for STR16.
388 COUNT("STR16"); 16; 3;
389 COUNT("opqrstuvwxyzABCD"); COUNT("value label for `opqrstuvwxyzABCD'");
390 COUNT("EFGHIJKLMNOPQRST"); COUNT("value label for `EFGHIJKLMNOPQRST'");
391 COUNT("UVWXYZ0123456789"); COUNT("value label for `UVWXYZ0123456789' with Cyrillic letters: `"; i8 244; i8 245; i8 246; "'");
393 dnl One value label for STR17.
394 COUNT("STR17"); 17; 1;
395 COUNT("abcdefghijklmnopq"); COUNT("value label for `abcdefghijklmnopq'");
398 dnl Dictionary termination record.
401 for variant in be le; do
402 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
403 AT_DATA([sys-file.sps], [dnl
404 GET FILE='sys-file.sav'.
407 AT_CHECK([pspp -o pspp.csv sys-file.sps])
408 AT_CHECK([cat pspp.csv], [0], [dnl
410 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
411 num1,1,,Scale,Input,8,Right,F8.0,F8.0,
412 num2,2,,Scale,Input,8,Right,F8.0,F8.0,
413 num3,3,,Scale,Input,8,Right,F8.0,F8.0,
414 num4,4,,Scale,Input,8,Right,F8.0,F8.0,
415 num5,5,,Scale,Input,8,Right,F8.0,F8.0,
416 str1,6,,Nominal,Input,1,Left,A1,A1,
417 str2,7,,Nominal,Input,2,Left,A2,A2,
418 str3,8,,Nominal,Input,3,Left,A3,A3,
419 str4,9,,Nominal,Input,4,Left,A4,A4,
420 str5,10,,Nominal,Input,4,Left,A4,A4,
421 str6,11,,Nominal,Input,6,Left,A6,A6,
422 str7,12,,Nominal,Input,7,Left,A7,A7,
423 str8,13,,Nominal,Input,8,Left,A8,A8,
424 str9ж,14,,Nominal,Input,9,Left,A9,A9,
425 str12,15,,Nominal,Input,12,Left,A12,A12,
426 str16,16,,Nominal,Input,16,Left,A16,A16,
427 str17,17,,Nominal,Input,17,Left,A17,A17,
431 num1,1,один (in Russian)
444 str1,a,value label for `a'
445 str2,bc,value label for `bc'
446 ,de,value label for `de'
447 str3,fgh,value label for `fgh'
448 ,ijk,value label for `ijk'
449 str4,BCDE,value label for `BCDE'
450 ,lmno,value label for `lmno'
451 ,tuvw,value label for `tuvw'
452 ,xyzA,value label for `xyzA'
453 str5,FGHI,value label for `FGHI'
454 ,pqrs,value label for `pqrs'
455 ,tuvw,value label for `tuvw'
456 ,xyzA,value label for `xyzA'
457 str6,JKLMNO,value label for `JKLMNO'
458 str7,JKLMNOP,value label for `JKLMNOP'
459 str8,JKLMNOPQ,value label for `JKLMNOPQ'
460 str9ж,RSTUVWXYZ,value label for `RSTUVWXYZ'
461 str12,0123456789ab,value label for `0123456789ab'
462 ,cdefghijklmn,value label for `cdefghijklmn'
463 str16,EFGHIJKLMNOPQRST,value label for `EFGHIJKLMNOPQRST'
464 ,UVWXYZ0123456789,value label for `UVWXYZ0123456789' with Cyrillic letters: `фхц'
465 ,opqrstuvwxyzABCD,value label for `opqrstuvwxyzABCD'
466 str17,abcdefghijklmnopq,value label for `abcdefghijklmnopq'
471 AT_SETUP([documents])
472 AT_KEYWORDS([sack synthetic system file positive])
473 AT_DATA([sys-file.sack], [dnl
475 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
477 1; dnl Nominal case size
478 0; dnl Not compressed
482 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
485 dnl Numeric variable, no label or missing values.
486 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
488 dnl Machine integer info record.
489 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
493 s80 "First line of documents";
494 s80 "Second line of documents";
495 "abb"; i8 233; " appliqu"; i8 233; " attach"; i8 233; " blas"; i8 233; " caf"; i8 233; " canap"; i8 233; " clich"; i8 233; " consomm"; i8 233;
498 s80 "Last line of documents";
500 dnl Character encoding record.
501 7; 20; 1; 12; "windows-1252";
503 dnl Dictionary termination record.
509 for variant in be le; do
510 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
511 AT_DATA([sys-file.sps], [dnl
512 GET FILE='sys-file.sav'.
516 AT_CHECK([pspp -o pspp.csv sys-file.sps])
517 AT_CHECK([cat pspp.csv], [0], [dnl
518 Documents in the active dataset:
520 First line of documents
522 Second line of documents
524 abbé appliqué attaché blasé café canapé cliché consommé
528 Last line of documents
537 AT_SETUP([empty document record])
538 AT_KEYWORDS([sack synthetic system file positive])
539 AT_DATA([sys-file.sack], [dnl
541 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
543 1; dnl Nominal case size
544 0; dnl Not compressed
548 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
551 dnl Numeric variable, no label or missing values.
552 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
554 dnl Machine integer info record.
555 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
560 dnl Character encoding record.
561 7; 20; 1; 12; "windows-1252";
563 dnl Dictionary termination record.
569 for variant in be le; do
570 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
571 AT_DATA([sys-file.sps], [dnl
572 GET FILE='sys-file.sav'.
575 AT_CHECK([pspp -o pspp.csv sys-file.sps])
576 AT_CHECK([cat pspp.csv], [0], [dnl
584 AT_SETUP([multiple response sets])
585 AT_KEYWORDS([sack synthetic system file positive])
586 AT_DATA([sys-file.sack], [dnl
588 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
590 16; dnl Nominal case size
591 0; dnl Not compressed
595 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
599 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
600 2; 0; 0; 0; 0x050800 *2; s8 "B";
601 2; 0; 0; 0; 0x050800 *2; s8 "C";
604 2; 0; 0; 0; 0x050800 *2; s8 "D";
605 2; 0; 0; 0; 0x050800 *2; s8 "E";
606 2; 0; 0; 0; 0x050800 *2; s8 "F";
607 2; 0; 0; 0; 0x050800 *2; s8 "G";
610 2; 4; 0; 0; 0x010400 *2; s8 "H";
611 2; 4; 0; 0; 0x010400 *2; s8 "I";
612 2; 4; 0; 0; 0x010400 *2; s8 "J";
615 2; 0; 0; 0; 0x050800 *2; s8 "K";
616 2; 0; 0; 0; 0x050800 *2; s8 "L";
617 2; 0; 0; 0; 0x050800 *2; s8 "M";
620 2; 6; 0; 0; 0x010600 *2; s8 "N";
621 2; 6; 0; 0; 0x010600 *2; s8 "O";
622 2; 6; 0; 0; 0x010600 *2; s8 "P";
624 dnl Machine integer info record.
625 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
629 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
630 "$b=D2 55 0 g e f d"; i8 10; i8 10;
631 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
636 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
637 "$e=E 11 6 choice 0 n o p"; i8 10; i8 10; i8 10; i8 10);
639 dnl Character encoding record.
640 7; 20; 1; 9; "shift_jis";
642 dnl Dictionary termination record.
645 for variant in be le; do
646 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
647 AT_DATA([sys-file.sps], [dnl
648 GET FILE='sys-file.sav'.
649 MRSETS /DISPLAY NAME=ALL.
651 AT_CHECK([pspp -o pspp.csv sys-file.sps])
652 AT_CHECK([cat pspp.csv], [0], [dnl
653 Table: Multiple Response Sets
654 Name,Variables,Details
658 ","Multiple category set
665 ","Multiple dichotomy set
667 Category label source: Variable labels
672 ","Multiple dichotomy set
674 Label source: Provided by user
676 Category label source: Variable labels
681 ","Multiple dichotomy set
683 Label source: Provided by user
685 Category label source: Value labels of counted value
690 ","Multiple dichotomy set
691 Label source: First variable label among variables
692 Counted value: `choice'
693 Category label source: Value labels of counted value
699 dnl Also checks for handling of CR-only line ends in file label and
700 dnl extra product info.
701 AT_SETUP([extra product info])
702 AT_KEYWORDS([sack synthetic system file positive])
703 AT_DATA([sys-file.sack], [dnl
705 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
707 4; dnl Nominal case size
708 0; dnl Not compressed
712 "01 Jan 11"; "20:53:52"; "PSPP synthetic"; i8 13; s49 "test file";
715 dnl Numeric variables.
716 2; 0; 0; 0; 0x050800 *2; s8 "A";
717 2; 0; 0; 0; 0x050800 *2; s8 "B";
718 2; 0; 0; 0; 0x050800 *2; s8 "C";
719 2; 0; 0; 0; 0x050800 *2; s8 "D";
721 dnl Extra product info.
722 7; 10; 1; COUNT ("Extra product info"; i8 13; "another line"; i8 13; "blah");
724 dnl Character encoding record.
725 7; 20; 1; 12; "windows-1252";
727 dnl Dictionary termination record.
730 for variant in be le; do
731 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
732 AT_DATA([sys-file.sps], [dnl
733 SYSFILE INFO FILE='sys-file.sav'.
735 AT_CHECK([pspp -o pspp.csv sys-file.sps])
736 AT_CHECK([sed 7q pspp.csv], [0], [dnl
738 Label:,"PSPP synthetic
740 Created:,01 Jan 11 20:53:52 by $(@%:@) SPSS DATA FILE PSPP synthetic test file
741 Product:,"Extra product info
748 AT_SETUP([variable display parameters, without width])
749 AT_KEYWORDS([sack synthetic system file positive])
750 AT_DATA([sys-file.sack], [dnl
752 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
754 19; dnl Nominal case size
755 0; dnl Not compressed
759 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
762 dnl Numeric variables.
763 2; 0; 0; 0; 0x050800 *2; s8 "A";
764 2; 0; 0; 0; 0x050800 *2; s8 "B";
765 2; 0; 0; 0; 0x050800 *2; s8 "C";
766 2; 0; 0; 0; 0x050800 *2; s8 "D";
768 dnl Short string variables.
769 2; 3; 0; 0; 0x010300 *2; s8 "H";
770 2; 3; 0; 0; 0x010300 *2; s8 "I";
771 2; 3; 0; 0; 0x010300 *2; s8 "J";
772 2; 3; 0; 0; 0x010300 *2; s8 "K";
774 dnl Long string variables.
775 2; 9; 0; 0; 0x010900 *2; s8 "L";
776 2; -1; 0; 0; 0; 0; s8 "";
777 2; 10; 0; 0; 0x010a00 *2; s8 "M";
778 2; -1; 0; 0; 0; 0; s8 "";
779 2; 17; 0; 0; 0x011100 *2; s8 "N";
780 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
781 2; 25; 0; 0; 0x011900 *2; s8 "O";
782 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
784 dnl Variable display parameters
799 dnl Character encoding record.
800 7; 20; 1; 12; "windows-1252";
802 dnl Dictionary termination record.
805 for variant in be le; do
806 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
807 AT_DATA([sys-file.sps], [dnl
808 GET FILE='sys-file.sav'.
811 AT_CHECK([pspp -o pspp.csv sys-file.sps])
812 AT_CHECK([cat pspp.csv], [0], [dnl
814 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
815 a,1,,Nominal,Input,8,Left,F8.0,F8.0,
816 b,2,,Ordinal,Input,8,Left,F8.0,F8.0,
817 c,3,,Scale,Input,8,Left,F8.0,F8.0,
818 d,4,,Nominal,Input,8,Right,F8.0,F8.0,
819 h,5,,Ordinal,Input,3,Right,A3,A3,
820 i,6,,Scale,Input,3,Right,A3,A3,
821 j,7,,Nominal,Input,3,Center,A3,A3,
822 k,8,,Ordinal,Input,3,Center,A3,A3,
823 l,9,,Scale,Input,9,Center,A9,A9,
824 m,10,,Nominal,Input,10,Left,A10,A10,
825 n,11,,Nominal,Input,17,Right,A17,A17,
826 o,12,,Nominal,Input,25,Center,A25,A25,
831 AT_SETUP([variable display parameters, with width])
832 AT_KEYWORDS([sack synthetic system file positive])
833 AT_DATA([sys-file.sack], [dnl
835 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
837 19; dnl Nominal case size
838 0; dnl Not compressed
842 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
845 dnl Numeric variables.
846 2; 0; 0; 0; 0x050800 *2; s8 "A";
847 2; 0; 0; 0; 0x050800 *2; s8 "B";
848 2; 0; 0; 0; 0x050800 *2; s8 "C";
849 2; 0; 0; 0; 0x050800 *2; s8 "D";
851 dnl Short string variables.
852 2; 3; 0; 0; 0x010300 *2; s8 "H";
853 2; 3; 0; 0; 0x010300 *2; s8 "I";
854 2; 3; 0; 0; 0x010300 *2; s8 "J";
855 2; 3; 0; 0; 0x010300 *2; s8 "K";
857 dnl Long string variables.
858 2; 9; 0; 0; 0x010900 *2; s8 "L";
859 2; -1; 0; 0; 0; 0; s8 "";
860 2; 10; 0; 0; 0x010a00 *2; s8 "M";
861 2; -1; 0; 0; 0; 0; s8 "";
862 2; 17; 0; 0; 0x011100 *2; s8 "N";
863 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
864 2; 25; 0; 0; 0x011900 *2; s8 "O";
865 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
867 dnl Variable display parameters
882 dnl Character encoding record.
883 7; 20; 1; 12; "windows-1252";
885 dnl Dictionary termination record.
888 for variant in be le; do
889 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
890 AT_DATA([sys-file.sps], [dnl
891 GET FILE='sys-file.sav'.
894 AT_CHECK([pspp -o pspp.csv sys-file.sps])
895 AT_CHECK([cat pspp.csv], [0], [dnl
897 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
898 a,1,,Nominal,Input,1,Left,F8.0,F8.0,
899 b,2,,Ordinal,Input,2,Left,F8.0,F8.0,
900 c,3,,Scale,Input,3,Left,F8.0,F8.0,
901 d,4,,Nominal,Input,4,Right,F8.0,F8.0,
902 h,5,,Ordinal,Input,5,Right,A3,A3,
903 i,6,,Scale,Input,6,Right,A3,A3,
904 j,7,,Nominal,Input,7,Center,A3,A3,
905 k,8,,Ordinal,Input,8,Center,A3,A3,
906 l,9,,Scale,Input,9,Center,A9,A9,
907 m,10,,Nominal,Input,10,Left,A10,A10,
908 n,11,,Nominal,Input,11,Right,A17,A17,
909 o,12,,Nominal,Input,12,Center,A25,A25,
914 AT_SETUP([long variable names])
915 AT_KEYWORDS([sack synthetic system file positive])
916 AT_DATA([sys-file.sack], [dnl
918 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
920 7; dnl Nominal case size
921 0; dnl Not compressed
925 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
928 dnl Numeric variables.
929 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
930 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
931 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
932 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
933 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDINA";
934 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_A";
935 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_B";
937 dnl Machine integer info record.
938 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
940 dnl Machine floating-point info record.
941 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
943 dnl Long variable names.
945 "LONGVARI=LongVariableName1"; i8 9;
946 "LONGVA_A=LongVariableName2"; i8 9;
947 "LONGVA_B=LongVariableName3"; i8 9;
948 "LONGVA_C=LongVariableName4"; i8 9;
949 "CO"; i8 214; "RDINA=Co"; i8 246; "rdinate_X"; i8 9;
950 "CO"; i8 214; "RDI_A=Co"; i8 246; "rdinate_Y"; i8 9;
951 "CO"; i8 214; "RDI_B=Co"; i8 246; "rdinate_Z";
954 dnl Character encoding record.
955 7; 20; 1; 12; "windows-1252";
957 dnl Dictionary termination record.
960 for variant in be le; do
961 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
962 AT_DATA([sys-file.sps], [dnl
963 GET FILE='sys-file.sav'.
966 AT_CHECK([pspp -o pspp.csv sys-file.sps])
967 AT_CHECK([cat pspp.csv], [0], [dnl
969 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
970 LongVariableName1,1,,Scale,Input,8,Right,F8.0,F8.0,
971 LongVariableName2,2,,Scale,Input,8,Right,F8.0,F8.0,
972 LongVariableName3,3,,Scale,Input,8,Right,F8.0,F8.0,
973 LongVariableName4,4,,Scale,Input,8,Right,F8.0,F8.0,
974 Coördinate_X,5,,Scale,Input,8,Right,F8.0,F8.0,
975 Coördinate_Y,6,,Scale,Input,8,Right,F8.0,F8.0,
976 Coördinate_Z,7,,Scale,Input,8,Right,F8.0,F8.0,
981 AT_SETUP([very long strings])
982 AT_KEYWORDS([sack synthetic system file positive])
983 AT_DATA([sys-file.sack], [dnl
985 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
987 109; dnl Nominal case size
988 0; dnl Not compressed
992 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
996 2; 255; 0; 0; 0x01FF00 *2; "S"; i8 201; s6 "Q256";
997 (2; -1; 0; 0; 0; 0; s8 "") * 31;
998 2; 4; 0; 0; 0x010400 *2; "S"; i8 201; "Q256_1";
1000 dnl 600-byte string.
1001 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600";
1002 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1003 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600_1";
1004 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1005 2; 96; 0; 0; 0x016000 *2; s8 "STR600_2";
1006 (2; -1; 0; 0; 0; 0; s8 "") * 11;
1008 dnl Machine integer info record.
1009 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1011 dnl Very long string record.
1013 "S"; i8 201; "Q256=00256"; i8 0; i8 9;
1014 "STR600=00600"; i8 0; i8 9;
1017 dnl Character encoding record.
1018 7; 20; 1; 12; "windows-1252";
1020 dnl Dictionary termination record.
1024 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 4;
1026 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 9;
1027 "abcdefghijklmnopqrstuvwxyzABCDEF";
1029 for variant in be le; do
1030 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1031 AT_DATA([sys-file.sps], [dnl
1032 GET FILE='sys-file.sav'.
1036 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1037 AT_CHECK([cat pspp.csv], [0], [dnl
1039 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
1040 séq256,1,,Nominal,Input,32,Left,A256,A256,
1041 str600,2,,Nominal,Input,32,Left,A600,A600,
1045 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@a,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyz
1050 AT_SETUP([data file and variable attributes])
1051 AT_KEYWORDS([sack synthetic system file positive])
1052 AT_DATA([sys-file.sack], [dnl
1054 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1056 3; dnl Nominal case size
1057 0; dnl Not compressed
1061 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1065 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
1066 2; 0; 0; 0; 0x050800 *2; s8 "SECONDVA";
1067 2; 0; 0; 0; 0x050800 *2; s8 "THIRDVAR";
1069 dnl Machine integer info record.
1070 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1072 dnl Long variable names.
1074 "FIRSTVAR=FirstVariable"; i8 9;
1075 "SECONDVA=S"; i8 233; "condVariable"; i8 9;
1076 "THIRDVAR=ThirdVariable"; i8 9
1079 dnl Data file attributes record.
1081 "Attr1('Value1'"; i8 10; "''d"; i8 233; "claration''"; i8 10; ")";
1082 "S"; i8 233; "condAttr('123'"; i8 10; "'456'"; i8 10; ")";
1085 dnl Variable attributes record.
1088 "ad"; i8 232; "le('23'"; i8 10; "'34'"; i8 10; ")";
1089 "bert('123'"; i8 10; ")";
1090 "$@Role('1'"; i8 10; ")";
1091 "/S"; i8 233; "condVariable:";
1092 "xyzzy('quux'"; i8 10; ")";
1095 dnl Another variable attributes record.
1096 dnl Only system files written by "Stata 14.1/-savespss- 1.77 by S.Radyakin"
1097 dnl include multiple variable attributes records.
1098 7; 18; 1; COUNT ("ThirdVariable:fizz('buzz'"; i8 10; ")";);
1100 dnl Character encoding record.
1101 7; 20; 1; 12; "windows-1252";
1103 dnl Dictionary termination record.
1106 for variant in be le; do
1107 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1108 AT_DATA([sys-file.sps], [dnl
1109 GET FILE='sys-file.sav'.
1110 DISPLAY @ATTRIBUTES.
1112 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1113 AT_CHECK([cat pspp.csv], [0],
1114 [[Table: Variable and Dataset Attributes
1116 (dataset),Attr1[1],Value1
1117 ,Attr1[2],'déclaration'
1120 FirstVariable,$@Role,1
1124 SécondVariable,xyzzy,quux
1125 ThirdVariable,fizz,buzz
1127 AT_DATA([sys-file.sps], [dnl
1128 GET FILE='sys-file.sav'.
1131 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1132 AT_CHECK([cat pspp.csv], [0],
1134 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
1135 FirstVariable,1,,Scale,Output,8,Right,F8.0,F8.0,
1136 SécondVariable,2,,Scale,Input,8,Right,F8.0,F8.0,
1137 ThirdVariable,3,,Scale,Input,8,Right,F8.0,F8.0,
1142 AT_SETUP([variable roles])
1143 AT_KEYWORDS([sack synthetic system file positive])
1144 AT_DATA([sys-file.sack], [dnl
1146 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1148 7; dnl Nominal case size
1149 0; dnl Not compressed
1153 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1157 2; 0; 0; 0; 0x050800 *2; s8 "I";
1158 2; 0; 0; 0; 0x050800 *2; s8 "O";
1159 2; 0; 0; 0; 0x050800 *2; s8 "B";
1160 2; 0; 0; 0; 0x050800 *2; s8 "N";
1161 2; 0; 0; 0; 0x050800 *2; s8 "P";
1162 2; 0; 0; 0; 0x050800 *2; s8 "S";
1163 2; 0; 0; 0; 0x050800 *2; s8 "X";
1165 dnl Machine integer info record.
1166 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1168 dnl Variable attributes record.
1170 "I:$@Role('0'"; i8 10; ")";
1171 "/O:$@Role('1'"; i8 10; ")";
1172 "/B:$@Role('2'"; i8 10; ")";
1173 "/N:$@Role('3'"; i8 10; ")";
1174 "/P:$@Role('4'"; i8 10; ")";
1175 "/S:$@Role('5'"; i8 10; ")";
1176 "/X:$@Role('6'"; i8 10; ")";
1179 dnl Character encoding record.
1180 7; 20; 1; 12; "windows-1252";
1182 dnl Dictionary termination record.
1185 for variant in be le; do
1186 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1187 AT_DATA([sys-file.sps], [dnl
1188 GET FILE='sys-file.sav'.
1191 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [dnl
1192 warning: `sys-file.sav': Invalid role for variable x.
1194 AT_CHECK([cat pspp.csv], [0], [dnl
1195 warning: `sys-file.sav': Invalid role for variable x.
1198 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
1199 i,1,,Scale,Input,8,Right,F8.0,F8.0,
1200 o,2,,Scale,Output,8,Right,F8.0,F8.0,
1201 b,3,,Scale,Both,8,Right,F8.0,F8.0,
1202 n,4,,Scale,None,8,Right,F8.0,F8.0,
1203 p,5,,Scale,Partition,8,Right,F8.0,F8.0,
1204 s,6,,Scale,Split,8,Right,F8.0,F8.0,
1205 x,7,,Scale,Input,8,Right,F8.0,F8.0,
1210 AT_SETUP([compressed data])
1211 AT_KEYWORDS([sack synthetic system file positive])
1212 AT_DATA([sys-file.sack], [dnl
1214 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1216 6; dnl Nominal case size
1217 1; dnl Simple compression
1219 -1; dnl Unspecified number of cases.
1221 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1224 dnl Numeric variables.
1225 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1226 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1228 dnl String variable.
1229 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1230 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1231 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1232 2; -1; 0; 0; 0; 0; s8 "";
1234 dnl Character encoding record.
1235 7; 20; 1; 12; "windows-1252";
1237 dnl Dictionary termination record.
1240 dnl Compressed data.
1241 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1242 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1243 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1244 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1247 for variant in be le; do
1248 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1249 AT_DATA([sys-file.sps], [dnl
1250 GET FILE='sys-file.sav'.
1254 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1255 AT_CHECK([cat pspp.csv], [0], [dnl
1257 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
1258 num1,1,,Scale,Input,8,Right,F8.0,F8.0,
1259 num2,2,,Scale,Input,8,Right,F8.0,F8.0,
1260 str4,3,,Nominal,Input,4,Left,A4,A4,
1261 str8,4,,Nominal,Input,8,Left,A8,A8,
1262 str15,5,,Nominal,Input,15,Left,A15,A15,
1265 num1,num2,str4,str8,str15
1266 -99,0,,abcdefgh,0123 @&t@
1267 .,151,jklm,nopqrstu,vwxyzABC @&t@
1268 1,2,DEFG,HIJKLMNO,PQRSTUV
1273 AT_SETUP([compressed data, zero bias])
1274 AT_KEYWORDS([sack synthetic system file positive])
1275 AT_DATA([sys-file.sack], [dnl
1277 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1279 6; dnl Nominal case size
1280 1; dnl Simple compression.
1282 -1; dnl Unspecified number of cases.
1284 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1287 dnl Numeric variables.
1288 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1289 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1291 dnl String variable.
1292 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1293 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1294 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1295 2; -1; 0; 0; 0; 0; s8 "";
1297 dnl Character encoding record.
1298 7; 20; 1; 12; "windows-1252";
1300 dnl Dictionary termination record.
1303 dnl Compressed data.
1304 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1305 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1306 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1307 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1310 for variant in be le; do
1311 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1312 AT_DATA([sys-file.sps], [dnl
1313 GET FILE='sys-file.sav'.
1317 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1318 AT_CHECK([cat pspp.csv], [0], [dnl
1320 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
1321 num1,1,,Scale,Input,8,Right,F8.0,F8.0,
1322 num2,2,,Scale,Input,8,Right,F8.0,F8.0,
1323 str4,3,,Nominal,Input,4,Left,A4,A4,
1324 str8,4,,Nominal,Input,8,Left,A8,A8,
1325 str15,5,,Nominal,Input,15,Left,A15,A15,
1328 num1,num2,str4,str8,str15
1329 1,100,,abcdefgh,0123 @&t@
1330 .,251,jklm,nopqrstu,vwxyzABC @&t@
1331 101,102,DEFG,HIJKLMNO,PQRSTUV
1336 AT_SETUP([compressed data, other bias])
1337 AT_KEYWORDS([sack synthetic system file positive])
1338 AT_DATA([sys-file.sack], [dnl
1340 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1342 6; dnl Nominal case size
1343 1; dnl Simple compression.
1345 -1; dnl Unspecified number of cases.
1347 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1350 dnl Numeric variables.
1351 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1352 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1354 dnl String variable.
1355 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1356 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1357 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1358 2; -1; 0; 0; 0; 0; s8 "";
1360 dnl Character encoding record.
1361 7; 20; 1; 12; "windows-1252";
1363 dnl Dictionary termination record.
1366 dnl Compressed data.
1367 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1368 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1369 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1370 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1373 for variant in be le; do
1374 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1375 AT_DATA([sys-file.sps], [dnl
1376 GET FILE='sys-file.sav'.
1380 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0],
1381 [warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1383 AT_CHECK([cat pspp.csv], [0], [dnl
1384 "warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1387 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
1388 num1,1,,Scale,Input,8,Right,F8.0,F8.0,
1389 num2,2,,Scale,Input,8,Right,F8.0,F8.0,
1390 str4,3,,Nominal,Input,4,Left,A4,A4,
1391 str8,4,,Nominal,Input,8,Left,A8,A8,
1392 str15,5,,Nominal,Input,15,Left,A15,A15,
1395 num1,num2,str4,str8,str15
1396 -49,50,,abcdefgh,0123 @&t@
1397 .,201,jklm,nopqrstu,vwxyzABC @&t@
1398 51,52,DEFG,HIJKLMNO,PQRSTUV
1403 m4_divert_push([PREPARE_TESTS])
1404 zcompressed_sack () {
1407 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1409 6; dnl Nominal case size
1410 2; dnl zlib compressed
1412 -1; dnl Unspecified number of cases.
1414 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1417 dnl Numeric variables.
1418 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1419 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1421 dnl String variable.
1422 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1423 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1424 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1425 2; -1; 0; 0; 0; 0; s8 "";
1427 dnl Character encoding record.
1428 7; 20; 1; 12; "windows-1252";
1430 dnl Dictionary termination record.
1433 dnl ZLIB data header.
1434 i64 0x194; # zheader_ofs
1435 i64 0x205; # ztrailer_ofs
1436 i64 48; # ztrailer_len
1438 dnl ZLIB data block.
1440 dnl This is the compressed form of:
1442 dnl 01 64 fe fd fe fd ff fb 61 62 63 64 65 66 67 68 |.d......abcdefgh|
1443 dnl 30 31 32 33 20 20 20 20 fd fd fd fe 65 66 fd fd |0123 ....ef..|
1444 dnl 6a 6b 6c 6d 20 20 20 20 6e 6f 70 71 72 73 74 75 |jklm nopqrstu|
1445 dnl 76 77 78 79 7a 41 42 43 44 45 46 47 20 20 20 20 |vwxyzABCDEFG |
1446 dnl 48 49 4a 4b 4c 4d 4e 4f fe fd fc 00 00 00 00 00 |HIJKLMNO........|
1447 dnl 50 51 52 53 54 55 56 57 |PQRSTUVW|
1449 dnl which is the data from the "compressed data" test.
1450 hex "78 01 63 4c f9 f7 f7 df df ff bf 13 93 92 53 52";
1451 hex "d3 d2 33 0c 0c 8d 8c 15 80 e0 ef df bf ff 52 d3";
1452 hex "fe fe cd ca ce c9 05 f1 f3 f2 0b 0a 8b 8a 4b 4a";
1453 hex "cb ca 2b 2a ab 1c 9d 9c 5d 5c dd dc 41 e2 1e 9e";
1454 hex "5e de 3e be 7e fe ff fe fe 61 00 81 80 c0 a0 e0";
1455 hex "90 d0 b0 70 00 0f 3f 23 d7";
1457 dnl ZLIB data trailer fixed header:
1458 i64 -100; # ztrailer_bias
1459 i64 0; # ztrailer_zero
1460 0x3ff000; # block_size
1463 dnl ZLIB block descriptor:
1464 i64 0x194; # uncompressed_ofs
1465 i64 0x1ac; # compressed_ofs
1466 88; # uncompressed_size
1467 89; # compressed_size
1470 m4_divert_pop([PREPARE_TESTS])
1472 AT_SETUP([zcompressed data])
1473 AT_KEYWORDS([sack synthetic system file positive zlib])
1474 zcompressed_sack > sys-file.sack
1475 for variant in be le; do
1476 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1477 AT_DATA([sys-file.sps], [dnl
1478 GET FILE='sys-file.sav'.
1482 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1483 AT_CHECK([cat pspp.csv], [0], [dnl
1485 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
1486 num1,1,,Scale,Input,8,Right,F8.0,F8.0,
1487 num2,2,,Scale,Input,8,Right,F8.0,F8.0,
1488 str4,3,,Nominal,Input,4,Left,A4,A4,
1489 str8,4,,Nominal,Input,8,Left,A8,A8,
1490 str15,5,,Nominal,Input,15,Left,A15,A15,
1493 num1,num2,str4,str8,str15
1494 -99,0,,abcdefgh,0123 @&t@
1495 .,151,jklm,nopqrstu,vwxyzABC @&t@
1496 1,2,DEFG,HIJKLMNO,PQRSTUV
1501 AT_BANNER([system file reader - negative])
1503 AT_SETUP([no variables])
1504 AT_KEYWORDS([sack synthetic system file negative])
1505 AT_DATA([sys-file.sack], [dnl
1507 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1509 0; dnl Nominal case size (empty)
1510 0; dnl Not compressed
1514 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1517 dnl Character encoding record.
1518 7; 20; 1; 12; "windows-1252";
1520 dnl Dictionary termination record.
1523 for variant in be le; do
1524 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1525 AT_DATA([sys-file.sps], [dnl
1526 GET FILE='sys-file.sav'.
1528 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1529 sys-file.sps:1: error: GET: `sys-file.sav': Data file dictionary has no variables.
1532 dnl At one point pspp-convert would hang forever if there were no variables,
1533 dnl so check against regression.
1534 AT_CHECK([pspp-convert sys-file.sav sys-file.txt])
1535 AT_CHECK([cat sys-file.txt], [0], [
1540 AT_SETUP([unspecified character encoding])
1541 AT_KEYWORDS([sack synthetic system file positive])
1542 AT_DATA([sys-file.sack], [dnl
1544 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1546 4; dnl Nominal case size
1547 0; dnl Not compressed
1551 "01 Jan 11"; "20:53:52";
1552 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1555 dnl Numeric variables.
1556 2; 0; 0; 0; 0x050800 *2; s8 "A";
1557 2; 0; 0; 0; 0x050800 *2; s8 "B";
1558 2; 0; 0; 0; 0x050800 *2; s8 "C";
1559 2; 0; 0; 0; 0x050800 *2; s8 "D";
1561 dnl Dictionary termination record.
1564 for variant in be le; do
1565 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1566 AT_DATA([sys-file.sps], [dnl
1569 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [stdout])
1570 AT_CHECK([sed 's/default encoding.*For/default encoding. For/' stdout], [0], [dnl
1571 "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."
1576 AT_SETUP([misplaced type 4 record])
1577 AT_KEYWORDS([sack synthetic system file negative])
1578 AT_DATA([sys-file.sack], [dnl
1580 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1581 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1583 dnl Numeric variable.
1584 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1589 for variant in be le; do
1590 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1591 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1593 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1594 [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1599 AT_SETUP([bad record type])
1600 AT_KEYWORDS([sack synthetic system file negative])
1601 AT_DATA([sys-file.sack], [dnl
1603 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1604 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1606 dnl Numeric variable.
1607 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1609 dnl Type 8 record (not a valid type).
1612 for variant in be le; do
1613 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1614 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1616 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1617 [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1622 AT_SETUP([wrong number of variable positions])
1623 AT_KEYWORDS([sack synthetic system file negative])
1624 AT_DATA([sys-file.sack], [dnl
1626 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1627 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1629 dnl Numeric variable.
1630 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1632 dnl Character encoding record.
1633 7; 20; 1; 12; "windows-1252";
1635 dnl End of dictionary.
1638 for variant in be le; do
1639 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1640 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1642 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1643 [warning: `sys-file.sav': File header claims 2 variable positions but 1 were read from file.
1648 AT_SETUP([variable name may not begin with `#'])
1649 AT_KEYWORDS([sack synthetic system file negative])
1650 AT_DATA([sys-file.sack], [dnl
1652 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1653 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1655 dnl Numeric variable.
1656 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1658 dnl Character encoding record.
1659 7; 20; 1; 12; "windows-1252";
1661 dnl End of dictionary.
1664 for variant in be le; do
1665 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1666 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1668 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1669 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `$UM1'.
1674 AT_SETUP([variable name may not be reserved word])
1675 AT_KEYWORDS([sack synthetic system file negative])
1676 AT_DATA([sys-file.sack], [dnl
1678 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1679 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1681 dnl Numeric variable.
1682 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1684 dnl Character encoding record.
1685 7; 20; 1; 12; "windows-1252";
1687 dnl End of dictionary.
1690 for variant in be le; do
1691 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1692 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1694 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1695 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `TO'.
1700 AT_SETUP([variable width must be between 0 and 255])
1701 AT_KEYWORDS([sack synthetic system file negative])
1702 AT_DATA([sys-file.sack], [dnl
1704 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1705 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1707 dnl String variable with invalid width 256.
1708 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1710 dnl Character encoding record.
1711 7; 20; 1; 12; "windows-1252";
1713 dnl End of dictionary.
1716 for variant in be le; do
1717 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1718 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1720 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1721 [error: `sys-file.sav' near offset 0xb4: Bad width 256 for variable VAR1.
1726 dnl SPSS-generated system file can contain duplicate variable names
1727 dnl (see bug #41475).
1728 AT_SETUP([duplicate variable name])
1729 AT_KEYWORDS([sack synthetic system file negative])
1730 AT_DATA([sys-file.sack], [dnl
1732 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1733 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1735 dnl Numeric variables.
1736 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1737 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1739 dnl Character encoding record.
1740 7; 20; 1; 12; "windows-1252";
1742 dnl End of dictionary.
1745 for variant in be le; do
1746 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1747 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1750 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1751 [warning: `sys-file.sav' near offset 0xd4: Renaming variable with duplicate name `VAR1' to `VAR001'.
1754 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
1755 var1,1,,Scale,Input,8,Right,F8.0,F8.0,
1756 var001,2,,Scale,Input,8,Right,F8.0,F8.0,
1761 AT_SETUP([variable label indicator not 0 or 1])
1762 AT_KEYWORDS([sack synthetic system file negative])
1763 AT_DATA([sys-file.sack], [dnl
1765 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1766 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1768 dnl Numeric variable.
1769 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1771 dnl Character encoding record.
1772 7; 20; 1; 12; "windows-1252";
1774 dnl End of dictionary.
1777 for variant in be le; do
1778 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1779 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1781 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1782 [error: `sys-file.sav' near offset 0xb4: Variable label indicator field is not 0 or 1.
1787 AT_SETUP([invalid numeric missing value indicator])
1788 AT_KEYWORDS([sack synthetic system file negative])
1789 AT_DATA([sys-file.sack], [dnl
1791 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1792 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1794 dnl Numeric variable.
1795 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1797 dnl Character encoding record.
1798 7; 20; 1; 12; "windows-1252";
1800 dnl End of dictionary.
1803 for variant in be le; do
1804 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1805 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1807 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1808 ["error: `sys-file.sav' near offset 0xb4: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1813 AT_SETUP([invalid string missing value indicator])
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 String variable.
1821 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1823 dnl Character encoding record.
1824 7; 20; 1; 12; "windows-1252";
1826 dnl End of dictionary.
1829 for variant in be le; do
1830 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1831 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1833 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1834 ["error: `sys-file.sav' near offset 0xb4: String missing value indicator field is not 0, 1, 2, or 3."
1839 AT_SETUP([missing string continuation record])
1840 AT_KEYWORDS([sack synthetic system file negative])
1841 AT_DATA([sys-file.sack], [dnl
1843 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1844 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1846 dnl String variable.
1847 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1848 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
1850 dnl Character encoding record.
1851 7; 20; 1; 12; "windows-1252";
1853 dnl End of dictionary.
1856 for variant in be le; do
1857 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1858 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1860 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1861 [error: `sys-file.sav' near offset 0xb4: Missing string continuation record.
1866 AT_SETUP([invalid variable format])
1867 AT_KEYWORDS([sack synthetic system file negative])
1868 AT_DATA([sys-file.sack], [dnl
1870 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1871 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1873 dnl Numeric variable, invalid format types.
1874 dnl No warning is issued for type 0 because it has been observed in real
1876 2; 0; 0; 0; >>0xff0800; 0<<; s8 "NUM1";
1878 dnl Numeric variable, string formats.
1879 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
1881 dnl String variable, numeric formats.
1882 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
1884 dnl String variable, wrong width formats.
1885 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
1887 dnl Character encoding record.
1888 7; 20; 1; 12; "windows-1252";
1890 dnl End of dictionary.
1893 for variant in be le; do
1894 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1895 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1897 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1898 warning: `sys-file.sav' near offset 0xc0: Variable NUM1 with width 0 has invalid print format 0xff0800.
1900 warning: `sys-file.sav' near offset 0xe0: Variable VAR1 with width 0 has invalid print format 0x10800.
1902 warning: `sys-file.sav' near offset 0xe4: Variable VAR1 with width 0 has invalid write format 0x21000.
1904 warning: `sys-file.sav' near offset 0x100: Variable STR1 with width 4 has invalid print format 0x50800.
1906 warning: `sys-file.sav' near offset 0x104: Variable STR1 with width 4 has invalid write format 0x110a01.
1908 warning: `sys-file.sav' near offset 0x120: Variable STR2 with width 4 has invalid print format 0x10800.
1910 warning: `sys-file.sav' near offset 0x124: Variable STR2 with width 4 has invalid write format 0x20400.
1915 AT_SETUP([invalid long string missing values])
1916 AT_KEYWORDS([sack synthetic system file negative])
1917 AT_DATA([sys-file.sack], [dnl
1919 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1921 7; dnl Nominal case size
1922 0; dnl Not compressed
1926 "01 Jan 11"; "20:53:52";
1927 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1930 dnl One numeric variable.
1931 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1933 dnl Long string variables that will have missing values added with a
1935 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
1936 2; -1; 0; 0; 0; 0; s8 "";
1937 2; 10; 0; 0; 0x010a00 *2; s8 "STR2";
1938 2; -1; 0; 0; 0; 0; s8 "";
1939 2; 11; 0; 0; 0x010b00 *2; s8 "STR3";
1940 2; -1; 0; 0; 0; 0; s8 "";
1942 dnl Machine integer info record.
1943 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1945 dnl Machine floating-point info record.
1946 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
1948 dnl Long string variable missing values record.
1950 dnl Zero missing values (not allowed) for STR1 .
1951 COUNT("STR1"); i8 >>0<<;
1953 dnl Four missing values (not allowed) for STR2.
1954 COUNT("STR2"); i8 4;
1955 8; "abcdefgh"; 8; "ijklmnop"; 8; "qrstuvwx"; 8; "yz012345";
1957 dnl Missing values for unknown variable
1958 COUNT(>>"Nonexistent"<<); i8 1; 8; "abcdefgh";
1960 dnl Missing values for numeric variable
1961 COUNT(>>"NUM1"<<); i8 1; 8; "abcdefgh";
1963 dnl Too long missing value
1964 COUNT("STR3"); i8 1; >>COUNT("abcdefghijkl")<<;
1967 dnl Character encoding record.
1968 7; 20; 1; 12; "windows-1252";
1970 dnl Dictionary termination record.
1972 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
1973 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
1974 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
1977 for variant in be le; do
1978 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1979 AT_DATA([sys-file.sps], [dnl
1980 GET FILE='sys-file.sav'.
1983 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1984 ["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."
1986 "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."
1988 warning: `sys-file.sav' near offset 0x242: Ignoring long string missing value record for unknown variable Nonexistent.
1990 warning: `sys-file.sav' near offset 0x257: Ignoring long string missing value record for numeric variable NUM1.
1992 "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."
1995 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
1996 num1,1,,Scale,Input,8,Right,F8.0,F8.0,
1997 str1,2,,Nominal,Input,9,Left,A9,A9,
1998 str2,3,,Nominal,Input,10,Left,A10,A10,"""abcdefgh""; ""ijklmnop""; ""qrstuvwx"""
1999 str3,4,,Nominal,Input,11,Left,A11,A11,
2004 AT_SETUP([weighting variable must be numeric])
2005 AT_KEYWORDS([sack synthetic system file negative])
2006 AT_DATA([sys-file.sack], [dnl
2008 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2009 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2011 dnl Numeric variable.
2012 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2014 dnl String variable.
2015 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2017 dnl Character encoding record.
2018 7; 20; 1; 12; "windows-1252";
2020 dnl End of dictionary.
2023 for variant in be le; do
2024 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2025 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2028 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2029 [warning: `sys-file.sav': Ignoring string variable `STR1' set as weighting variable.
2032 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
2033 num1,1,,Scale,Input,8,Right,F8.0,F8.0,
2034 str1,2,,Nominal,Input,4,Left,A4,A4,
2039 AT_SETUP([bad weighting variable index])
2040 AT_KEYWORDS([sack synthetic system file negative])
2041 AT_DATA([sys-file.sack], [dnl
2043 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2044 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2046 dnl Numeric variable.
2047 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2049 dnl String variable.
2050 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2052 dnl Character encoding record.
2053 7; 20; 1; 12; "windows-1252";
2055 dnl End of dictionary.
2058 for variant in be le; do
2059 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2060 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2062 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2063 [error: `sys-file.sav' near offset 0x4c: Variable index 3 not in valid range 1...2.
2068 AT_SETUP([variable index is long string contination])
2069 AT_KEYWORDS([sack synthetic system file negative])
2070 AT_DATA([sys-file.sack], [dnl
2072 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2073 2; 3; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2075 dnl Numeric variable.
2076 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2078 dnl Long string variable.
2079 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2080 (2; -1; 0; 0; 0; 0; s8 "");
2082 dnl Character encoding record.
2083 7; 20; 1; 12; "windows-1252";
2085 dnl End of dictionary.
2088 for variant in be le; do
2089 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2090 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2092 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2093 [error: `sys-file.sav' near offset 0x4c: Variable index 3 refers to long string continuation.
2098 AT_SETUP([multiple documents records])
2099 AT_KEYWORDS([sack synthetic system file negative])
2100 AT_DATA([sys-file.sack], [dnl
2102 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2103 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2105 dnl Numeric variable, no label or missing values.
2106 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2108 dnl Two document records.
2109 (6; 1; s80 "One line of documents") >>* 2<<;
2111 dnl Dictionary termination record.
2114 dnl Character encoding record.
2115 7; 20; 1; 12; "windows-1252";
2120 for variant in be le; do
2121 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2122 AT_DATA([sys-file.sps], [dnl
2123 GET FILE='sys-file.sav'.
2125 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2126 error: `sys-file.sav' near offset 0x12c: Duplicate type 6 (document) record.
2132 AT_SETUP([extension record too large])
2133 AT_KEYWORDS([sack synthetic system file negative])
2134 AT_DATA([sys-file.sack], [dnl
2136 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2137 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2139 dnl Numeric variable, no label or missing values.
2140 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2142 dnl Too-large extension record.
2143 7; 3; >>0xfffff000 * 2<<;
2145 for variant in be le; do
2146 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2147 AT_DATA([sys-file.sps], [dnl
2148 GET FILE='sys-file.sav'.
2150 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2151 error: `sys-file.sav' near offset 0xd8: Record type 7 subtype 3 too large.
2156 AT_SETUP([unknown extension record])
2157 AT_KEYWORDS([sack synthetic system file negative])
2158 AT_DATA([sys-file.sack], [dnl
2160 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2161 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2163 dnl Numeric variable, no label or missing values.
2164 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2166 dnl Unknown extension record type.
2169 dnl Character encoding record.
2170 7; 20; 1; 12; "windows-1252";
2172 dnl End of dictionary.
2175 for variant in be le; do
2176 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2177 AT_DATA([sys-file.sps], [dnl
2178 GET FILE='sys-file.sav'.
2180 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2181 "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}."
2186 AT_SETUP([bad machine integer info size])
2187 AT_KEYWORDS([sack synthetic system file negative])
2188 AT_DATA([sys-file.sack], [dnl
2190 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2191 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2193 dnl Numeric variable, no label or missing values.
2194 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2196 dnl Machine integer info record.
2197 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252; >>1234<<;
2199 dnl Character encoding record.
2200 7; 20; 1; 12; "windows-1252";
2202 dnl End of dictionary.
2205 for variant in be le; do
2206 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2207 AT_DATA([sys-file.sps], [dnl
2208 GET FILE='sys-file.sav'.
2210 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2211 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 3 has bad count 9 (expected 8)."
2216 AT_SETUP([bad machine integer info float format])
2217 AT_KEYWORDS([sack synthetic system file negative])
2218 AT_DATA([sys-file.sack], [dnl
2220 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2221 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2223 dnl Numeric variable, no label or missing values.
2224 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2226 dnl Machine integer info record.
2227 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
2229 dnl Character encoding record.
2230 7; 20; 1; 12; "windows-1252";
2232 dnl End of dictionary.
2235 for variant in be le; do
2236 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2237 AT_DATA([sys-file.sps], [dnl
2238 GET FILE='sys-file.sav'.
2240 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2241 error: `sys-file.sav' near offset 0xd8: Floating-point representation indicated by system file (2) differs from expected (1).
2246 AT_SETUP([bad machine integer info endianness])
2247 AT_KEYWORDS([sack synthetic system file negative])
2248 AT_DATA([sys-file.sack], [dnl
2250 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2251 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2253 dnl Numeric variable, no label or missing values.
2254 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2256 dnl Machine integer info record.
2257 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
2259 dnl Character encoding record.
2260 7; 20; 1; 12; "windows-1252";
2262 dnl End of dictionary.
2265 for variant in "be 1" "le 2"; do
2267 AT_CHECK([sack --$[1] sys-file.sack > sys-file.sav])
2268 AT_DATA([sys-file.sps], [dnl
2269 GET FILE='sys-file.sav'.
2272 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2273 warning: \`sys-file.sav' near offset 0xd8: Integer format indicated by system file (3) differs from expected ($[2]).
2276 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
2277 num1,1,,Scale,Input,8,Right,F8.0,F8.0,
2283 AT_SETUP([bad machine floating-point info size])
2284 AT_KEYWORDS([sack synthetic system file negative])
2285 AT_DATA([sys-file.sack], [dnl
2287 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2288 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2290 dnl Numeric variable, no label or missing values.
2291 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2293 dnl Machine floating-point info record.
2294 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2296 dnl Character encoding record.
2297 7; 20; 1; 12; "windows-1252";
2299 dnl End of dictionary.
2302 for variant in be le; do
2303 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2304 AT_DATA([sys-file.sps], [dnl
2305 GET FILE='sys-file.sav'.
2307 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2308 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 4 has bad count 4 (expected 3)."
2313 AT_SETUP([wrong special floating point values])
2314 AT_KEYWORDS([sack synthetic system file negative])
2315 AT_DATA([sys-file.sack], [dnl
2317 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2318 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2320 dnl Numeric variable, no label or missing values.
2321 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2323 dnl Machine floating-point info record.
2324 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2326 dnl Character encoding record.
2327 7; 20; 1; 12; "windows-1252";
2329 dnl End of dictionary.
2332 for variant in be le; do
2333 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2334 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2336 AT_CHECK([pspp -O format=csv sys-file.sps | sed 's/ [(].*/.../'], [0], [dnl
2337 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 0...
2339 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 1...
2341 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 2...
2346 AT_SETUP([bad mrsets name])
2347 AT_KEYWORDS([sack synthetic system file negative multiple response])
2348 AT_DATA([sys-file.sack], [dnl
2350 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2352 16; dnl Nominal case size
2353 0; dnl Not compressed
2357 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2361 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2362 2; 0; 0; 0; 0x050800 *2; s8 "B";
2363 2; 0; 0; 0; 0x050800 *2; s8 "C";
2366 2; 0; 0; 0; 0x050800 *2; s8 "D";
2367 2; 0; 0; 0; 0x050800 *2; s8 "E";
2368 2; 0; 0; 0; 0x050800 *2; s8 "F";
2369 2; 0; 0; 0; 0x050800 *2; s8 "G";
2372 2; 4; 0; 0; 0x010400 *2; s8 "H";
2373 2; 4; 0; 0; 0x010400 *2; s8 "I";
2374 2; 4; 0; 0; 0x010400 *2; s8 "J";
2377 2; 0; 0; 0; 0x050800 *2; s8 "K";
2378 2; 0; 0; 0; 0x050800 *2; s8 "L";
2379 2; 0; 0; 0; 0x050800 *2; s8 "M";
2382 2; 6; 0; 0; 0x010600 *2; s8 "N";
2383 2; 6; 0; 0; 0x010600 *2; s8 "O";
2384 2; 6; 0; 0; 0x010600 *2; s8 "P";
2386 dnl Machine integer info record.
2387 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2391 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
2392 "b=D2 55 0 g e f d"; i8 10;
2393 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
2397 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
2398 "e=E 11 6 choice 0 n o p"; i8 10);
2400 dnl Character encoding record.
2401 7; 20; 1; 9; "shift_jis";
2403 dnl Dictionary termination record.
2406 for variant in be le; do
2407 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2408 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2409 MRSETS /DISPLAY NAME=ALL.
2411 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2412 warning: `sys-file.sav': Invalid multiple response set name `b'.
2414 warning: `sys-file.sav': Invalid multiple response set name `e'.
2416 Table: Multiple Response Sets
2417 Name,Variables,Details
2421 ","Multiple category set
2427 ","Multiple dichotomy set
2429 Label source: Provided by user
2431 Category label source: Variable labels
2436 ","Multiple dichotomy set
2437 Label: third mdgroup
2438 Label source: Provided by user
2440 Category label source: Value labels of counted value
2446 AT_SETUP([missing space after C in mrsets])
2447 AT_KEYWORDS([sack synthetic system file negative multiple response])
2448 AT_DATA([sys-file.sack], [dnl
2450 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2451 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2453 dnl Numeric variable, no label or missing values.
2454 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2456 dnl Multiple response sets.
2457 7; 7; 1; COUNT("$a=Cx");
2459 dnl Character encoding record.
2460 7; 20; 1; 12; "windows-1252";
2464 for variant in be le; do
2465 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2466 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2468 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2469 warning: `sys-file.sav' near offset 0xd8: Missing space following `C' at offset 4 in MRSETS record.
2474 AT_SETUP([missing space after E in mrsets])
2475 AT_KEYWORDS([sack synthetic system file negative multiple response])
2476 AT_DATA([sys-file.sack], [dnl
2478 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2479 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2481 dnl Numeric variable, no label or missing values.
2482 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2484 dnl Multiple response sets.
2485 7; 7; 1; COUNT("$a=Ex");
2487 dnl Character encoding record.
2488 7; 20; 1; 12; "windows-1252";
2492 for variant in be le; do
2493 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2494 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2496 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2497 warning: `sys-file.sav' near offset 0xd8: Missing space following `E' at offset 4 in MRSETS record.
2502 AT_SETUP([missing label source in mrsets])
2503 AT_KEYWORDS([sack synthetic system file negative multiple response])
2504 AT_DATA([sys-file.sack], [dnl
2506 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2507 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2509 dnl Numeric variable, no label or missing values.
2510 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2512 dnl Multiple response sets.
2513 7; 7; 1; COUNT("$a=E ");
2515 dnl Character encoding record.
2516 7; 20; 1; 12; "windows-1252";
2520 for variant in be le; do
2521 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2522 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2524 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2525 warning: `sys-file.sav' near offset 0xd8: Missing label source value following `E' at offset 5 in MRSETS record.
2527 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 5 in MRSETS record.
2532 AT_SETUP([unexpected label source in mrsets])
2533 AT_KEYWORDS([sack synthetic system file negative multiple response])
2534 AT_DATA([sys-file.sack], [dnl
2536 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2537 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2539 dnl Numeric variable, no label or missing values.
2540 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2542 dnl Multiple response sets.
2543 7; 7; 1; COUNT("$a=E 2");
2545 dnl Character encoding record.
2546 7; 20; 1; 12; "windows-1252";
2550 for variant in be le; do
2551 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2552 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2554 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2555 warning: `sys-file.sav' near offset 0xd8: Unexpected label source value following `E' at offset 7 in MRSETS record.
2557 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 7 in MRSETS record.
2562 AT_SETUP([bad type character in mrsets])
2563 AT_KEYWORDS([sack synthetic system file negative multiple response])
2564 AT_DATA([sys-file.sack], [dnl
2566 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2567 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2569 dnl Numeric variable, no label or missing values.
2570 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2572 dnl Multiple response sets.
2573 7; 7; 1; COUNT("$a=");
2575 dnl Character encoding record.
2576 7; 20; 1; 12; "windows-1252";
2580 for variant in be le; do
2581 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2582 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2584 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2585 "warning: `sys-file.sav' near offset 0xd8: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2590 AT_SETUP([bad counted string length in mrsets])
2591 AT_KEYWORDS([sack synthetic system file negative multiple response])
2592 AT_DATA([sys-file.sack], [dnl
2594 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2595 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2597 dnl Numeric variable, no label or missing values.
2598 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2600 dnl Multiple response sets.
2601 7; 7; 1; COUNT("$a=Dx");
2603 dnl Character encoding record.
2604 7; 20; 1; 12; "windows-1252";
2608 for variant in be le; do
2609 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2610 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2612 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2613 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 4 in MRSETS record.
2618 AT_SETUP([missing space in counted string in mrsets])
2619 AT_KEYWORDS([sack synthetic system file negative multiple response])
2620 AT_DATA([sys-file.sack], [dnl
2622 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2623 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2625 dnl Numeric variable, no label or missing values.
2626 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2628 dnl Multiple response sets.
2629 7; 7; 1; COUNT("$a=D1x");
2631 dnl Character encoding record.
2632 7; 20; 1; 12; "windows-1252";
2636 for variant in be le; do
2637 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2638 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2640 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2641 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 5 in MRSETS record.
2646 AT_SETUP([counted string too long in mrsets])
2647 AT_KEYWORDS([sack synthetic system file negative multiple response])
2648 AT_DATA([sys-file.sack], [dnl
2650 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2651 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2653 dnl Numeric variable, no label or missing values.
2654 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2656 dnl Multiple response sets.
2657 7; 7; 1; COUNT("$a=D4 abc");
2659 dnl Character encoding record.
2660 7; 20; 1; 12; "windows-1252";
2664 for variant in be le; do
2665 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2666 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2668 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2669 warning: `sys-file.sav' near offset 0xd8: 4-byte string starting at offset 6 exceeds record length 9.
2674 AT_SETUP([missing space after counted string in mrsets])
2675 AT_KEYWORDS([sack synthetic system file negative multiple response])
2676 AT_DATA([sys-file.sack], [dnl
2678 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2679 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2681 dnl Numeric variable, no label or missing values.
2682 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2684 dnl Multiple response sets.
2685 7; 7; 1; COUNT("$a=D3 abcx");
2687 dnl Character encoding record.
2688 7; 20; 1; 12; "windows-1252";
2692 for variant in be le; do
2693 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2694 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2696 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2697 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 9 following 3-byte string.
2702 AT_SETUP([missing newline after variable name in mrsets])
2703 AT_KEYWORDS([sack synthetic system file negative multiple response])
2704 AT_DATA([sys-file.sack], [dnl
2706 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2707 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2709 dnl Numeric variable, no label or missing values.
2710 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2712 dnl Multiple response sets.
2713 7; 7; 1; COUNT("$a=C 0 NUM1");
2715 dnl Character encoding record.
2716 7; 20; 1; 12; "windows-1252";
2720 for variant in be le; do
2721 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2722 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2724 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2725 warning: `sys-file.sav' near offset 0xd8: Missing new-line parsing variable names at offset 13 in MRSETS record.
2727 warning: `sys-file.sav': MRSET $a has only one variable.
2732 AT_SETUP([duplicate variable name in mrsets])
2733 AT_KEYWORDS([sack synthetic system file negative multiple response])
2734 AT_DATA([sys-file.sack], [dnl
2736 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2737 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2739 dnl Numeric variable, no label or missing values.
2740 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2742 dnl Multiple response sets.
2743 7; 7; 1; COUNT("$a=C 0 NUM1 NUM1"; i8 10);
2745 dnl Character encoding record.
2746 7; 20; 1; 12; "windows-1252";
2750 for variant in be le; do
2751 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2752 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2754 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2755 warning: `sys-file.sav': MRSET $a contains duplicate variable name NUM1.
2757 warning: `sys-file.sav': MRSET $a has only one variable.
2762 AT_SETUP([mixed variable types in mrsets])
2763 AT_KEYWORDS([sack synthetic system file negative multiple response])
2764 AT_DATA([sys-file.sack], [dnl
2766 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2767 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2770 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2771 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2773 dnl Multiple response sets.
2774 7; 7; 1; COUNT("$a=C 0 NUM1 STR1"; i8 10);
2776 dnl Character encoding record.
2777 7; 20; 1; 12; "windows-1252";
2781 for variant in be le; do
2782 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2783 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2785 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2786 warning: `sys-file.sav': MRSET $a contains both string and numeric variables.
2788 warning: `sys-file.sav': MRSET $a has only one variable.
2793 AT_SETUP([missing newline after variable name in mrsets])
2794 AT_KEYWORDS([sack synthetic system file negative multiple response])
2795 AT_DATA([sys-file.sack], [dnl
2797 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2798 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2800 dnl Numeric variable, no label or missing values.
2801 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2803 dnl Multiple response sets.
2804 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10);
2806 dnl Character encoding record.
2807 7; 20; 1; 12; "windows-1252";
2811 for variant in be le; do
2812 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2813 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2815 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2816 warning: `sys-file.sav': MRSET $a has only one variable.
2821 AT_SETUP([zero or one variable in mrset])
2822 AT_KEYWORDS([sack synthetic system file negative multiple response])
2823 AT_DATA([sys-file.sack], [dnl
2825 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2826 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2828 dnl Numeric variable, no label or missing values.
2829 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2831 dnl Multiple response sets.
2832 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10; "$b=C 0 "; i8 10);
2834 dnl Character encoding record.
2835 7; 20; 1; 12; "windows-1252";
2839 for variant in be le; do
2840 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2841 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2843 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2844 warning: `sys-file.sav': MRSET $a has only one variable.
2846 warning: `sys-file.sav': MRSET $b has no variables.
2851 AT_SETUP([wrong display parameter size])
2852 AT_KEYWORDS([sack synthetic system file negative])
2853 AT_DATA([sys-file.sack], [dnl
2855 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2856 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2858 dnl Numeric variable, no label or missing values.
2859 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2861 dnl Display parameters record.
2862 7; 11; >>8<<; 2; 1.0; 1.0;
2864 dnl Character encoding record.
2865 7; 20; 1; 12; "windows-1252";
2867 dnl End of dictionary.
2870 for variant in be le; do
2871 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2872 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2874 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2875 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 11 has bad size 8 (expected 4)."
2880 AT_SETUP([wrong display parameter count])
2881 AT_KEYWORDS([sack synthetic system file negative])
2882 AT_DATA([sys-file.sack], [dnl
2884 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2885 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2887 dnl Numeric variable, no label or missing values.
2888 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2890 dnl Display parameters record.
2891 7; 11; 4; >>4<<; 1; 1; 2; 2;
2893 dnl Character encoding record.
2894 7; 20; 1; 12; "windows-1252";
2896 dnl End of dictionary.
2899 for variant in be le; do
2900 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2901 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2903 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2904 warning: `sys-file.sav' near offset 0xd8: Extension 11 has bad count 4 (for 1 variables).
2909 AT_SETUP([wrong display measurement level])
2910 AT_KEYWORDS([sack synthetic system file negative])
2911 AT_DATA([sys-file.sack], [dnl
2913 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2914 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2916 dnl Numeric variable, no label or missing values.
2917 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2919 dnl Display parameters record.
2920 7; 11; 4; 2; >>4<<; 0;
2922 dnl Character encoding record.
2923 7; 20; 1; 12; "windows-1252";
2925 dnl End of dictionary.
2928 for variant in be le; do
2929 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2930 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2932 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2933 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
2938 AT_SETUP([wrong display alignment])
2939 AT_KEYWORDS([sack synthetic system file negative])
2940 AT_DATA([sys-file.sack], [dnl
2942 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2943 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2945 dnl Numeric variable, no label or missing values.
2946 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2948 dnl Display parameters record.
2949 7; 11; 4; 2; 1; >>-1<<;
2951 dnl Character encoding record.
2952 7; 20; 1; 12; "windows-1252";
2954 dnl End of dictionary.
2957 for variant in be le; do
2958 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2959 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2961 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2962 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
2967 AT_SETUP([bad variable name in variable/value pair])
2968 AT_KEYWORDS([sack synthetic system file negative])
2969 AT_DATA([sys-file.sack], [dnl
2971 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2972 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2974 dnl Numeric variables.
2975 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2977 dnl Long variable names.
2978 7; 13; 1; COUNT (>>"xyzzy"<<);
2980 dnl Character encoding record.
2981 7; 20; 1; 12; "windows-1252";
2983 dnl Dictionary termination record.
2986 for variant in be le; do
2987 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2988 AT_DATA([sys-file.sps], [dnl
2989 GET FILE='sys-file.sav'.
2991 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2992 warning: `sys-file.sav' near offset 0xde: Dictionary record refers to unknown variable xyzzy.
2997 AT_SETUP([duplicate long variable name])
2998 AT_KEYWORDS([sack synthetic system file negative])
2999 AT_DATA([sys-file.sack], [dnl
3001 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3002 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3004 dnl Numeric variables.
3005 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
3006 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
3007 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
3008 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
3010 dnl Long variable names.
3012 "LONGVARI=_Invalid"; i8 9;
3013 "LONGVARI=$Invalid"; i8 9;
3014 "LONGVARI=#Invalid"; i8 9;
3015 "LONGVA_A=LongVariableName"; i8 9;
3016 "LONGVA_B=LONGVARIABLENAME"; i8 9;
3019 dnl Character encoding record.
3020 7; 20; 1; 12; "windows-1252";
3022 dnl Dictionary termination record.
3025 for variant in be le; do
3026 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3027 AT_DATA([sys-file.sps], [dnl
3028 GET FILE='sys-file.sav'.
3030 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3031 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
3033 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `$Invalid'.
3035 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `#Invalid'.
3037 warning: `sys-file.sav' near offset 0x138: Duplicate long variable name `LONGVARIABLENAME'.
3042 AT_SETUP([bad very long string length])
3043 AT_KEYWORDS([sack synthetic system file negative])
3044 AT_DATA([sys-file.sack], [dnl
3046 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3047 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3049 dnl Numeric variable.
3050 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3052 dnl Very long string map.
3054 "NUM1=00000"; i8 0; i8 9;
3055 "NUM1=00255"; i8 0; i8 9;
3056 "NUM1=00256"; i8 0; i8 9;
3059 dnl Character encoding record.
3060 7; 20; 1; 12; "windows-1252";
3062 dnl Dictionary termination record.
3065 for variant in be le; do
3066 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3067 AT_DATA([sys-file.sps], [dnl
3068 GET FILE='sys-file.sav'.
3070 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3071 warning: `sys-file.sav' near offset 0xd8: NUM1 listed as string of invalid length 00000 in very long string record.
3073 "warning: `sys-file.sav' near offset 0xd8: NUM1 listed in very long string record with width 00255, which requires only one segment."
3075 error: `sys-file.sav' near offset 0xd8: Very long string NUM1 overflows dictionary.
3080 AT_SETUP([bad very long string segment width])
3081 AT_KEYWORDS([sack synthetic system file negative])
3082 AT_DATA([sys-file.sack], [dnl
3084 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3085 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3088 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
3089 (2; -1; 0; 0; 0; 0; s8 "") * 31;
3090 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
3091 >>2; -1; 0; 0; 0; 0; s8 "";<<
3093 dnl Very long string map.
3095 "STR1=00256"; i8 0; i8 9;
3098 dnl Character encoding record.
3099 7; 20; 1; 12; "windows-1252";
3101 dnl Dictionary termination record.
3104 for variant in be le; do
3105 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3106 AT_DATA([sys-file.sps], [dnl
3107 GET FILE='sys-file.sav'.
3109 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3110 error: `sys-file.sav' near offset 0x4f8: Very long string with width 256 has segment 1 of width 9 (expected 4).
3115 AT_SETUP([too many value labels])
3116 AT_KEYWORDS([sack synthetic system file negative])
3117 AT_DATA([sys-file.sack], [dnl
3119 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3120 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3122 dnl Numeric variable.
3123 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3126 for variant in be le; do
3127 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3128 AT_DATA([sys-file.sps], [dnl
3129 GET FILE='sys-file.sav'.
3131 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3132 error: `sys-file.sav' near offset 0xd4: Invalid number of labels 2147483647.
3137 AT_SETUP([missing type 4 record])
3138 AT_KEYWORDS([sack synthetic system file negative])
3139 AT_DATA([sys-file.sack], [dnl
3141 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3142 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3144 dnl Numeric variable.
3145 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3147 dnl Value label with missing type 4 record.
3148 3; 1; 1.0; i8 3; s7 "one";
3150 dnl Character encoding record.
3151 7; 20; 1; 12; "windows-1252";
3153 dnl End of dictionary.
3156 for variant in be le; do
3157 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3158 AT_DATA([sys-file.sps], [dnl
3159 GET FILE='sys-file.sav'.
3161 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3162 error: `sys-file.sav' near offset 0xe8: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
3167 AT_SETUP([value label with no associated variables])
3168 AT_KEYWORDS([sack synthetic system file negative])
3169 AT_DATA([sys-file.sack], [dnl
3171 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3172 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3174 dnl Numeric variable.
3175 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3177 dnl Value label with no variables.
3178 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
3180 for variant in be le; do
3181 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3182 AT_DATA([sys-file.sps], [dnl
3183 GET FILE='sys-file.sav'.
3185 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3186 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).
3191 AT_SETUP([type 4 record names long string variable])
3192 AT_KEYWORDS([sack synthetic system file negative])
3193 AT_DATA([sys-file.sack], [dnl
3195 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3196 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3198 dnl Long string variable.
3199 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3200 2; -1; 0; 0; 0; 0; s8 "";
3202 dnl Value label that names long string variable.
3203 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
3205 dnl Character encoding record.
3206 7; 20; 1; 12; "windows-1252";
3208 dnl End of dictionary.
3211 for variant in be le; do
3212 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3213 AT_DATA([sys-file.sps], [dnl
3214 GET FILE='sys-file.sav'.
3216 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3217 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.
3222 AT_SETUP([variables for value label must all be same type])
3223 AT_KEYWORDS([sack synthetic system file negative])
3224 AT_DATA([sys-file.sack], [dnl
3226 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3227 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3230 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3231 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3233 dnl Value label that names numeric and string variables.
3234 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
3236 dnl Character encoding record.
3237 7; 20; 1; 12; "windows-1252";
3239 dnl End of dictionary.
3242 for variant in be le; do
3243 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3244 AT_DATA([sys-file.sps], [dnl
3245 GET FILE='sys-file.sav'.
3247 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3248 "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."
3253 AT_SETUP([duplicate value labels type])
3254 AT_KEYWORDS([sack synthetic system file negative])
3255 AT_DATA([sys-file.sack], [dnl
3257 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3258 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3261 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3262 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3264 dnl Duplicate value labels.
3265 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
3266 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
3268 dnl Character encoding record.
3269 7; 20; 1; 12; "windows-1252";
3271 dnl End of dictionary.
3274 for variant in be le; do
3275 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3276 AT_DATA([sys-file.sps], [dnl
3277 GET FILE='sys-file.sav'.
3279 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3280 warning: `sys-file.sav' near offset 0xf4: Duplicate value label for `xyzzy ' on STR1.
3282 warning: `sys-file.sav' near offset 0x11c: Duplicate value label for 1 on NUM1.
3287 AT_SETUP([missing attribute value])
3288 AT_KEYWORDS([sack synthetic system file negative])
3289 AT_DATA([sys-file.sack], [dnl
3291 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3292 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3295 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3297 dnl Data file attributes record.
3302 dnl Variable attributes record.
3308 dnl Character encoding record.
3309 7; 20; 1; 12; "windows-1252";
3311 dnl Dictionary termination record.
3314 for variant in be le; do
3315 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3316 AT_DATA([sys-file.sps], [dnl
3317 GET FILE='sys-file.sav'.
3319 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3320 warning: `sys-file.sav' near offset 0xde: Error parsing attribute value Attr1[[1]].
3322 warning: `sys-file.sav' near offset 0x101: Error parsing attribute value fred[[2]].
3327 AT_SETUP([unquoted attribute value])
3328 AT_KEYWORDS([sack synthetic system file negative])
3329 AT_DATA([sys-file.sack], [dnl
3331 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3332 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3335 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3337 dnl Data file attributes record.
3339 "Attr1(value"; i8 10;
3343 dnl Variable attributes record.
3346 "fred(23"; i8 10; ")"
3349 dnl Character encoding record.
3350 7; 20; 1; 12; "windows-1252";
3352 dnl Dictionary termination record.
3355 for variant in be le; do
3356 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3357 AT_DATA([sys-file.sps], [dnl
3358 GET FILE='sys-file.sav'.
3360 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3361 warning: `sys-file.sav' near offset 0xe4: Attribute value Attr1[[1]] is not quoted: value.
3363 warning: `sys-file.sav' near offset 0x106: Attribute value fred[[1]] is not quoted: 23.
3368 AT_SETUP([duplicate attribute name])
3369 AT_KEYWORDS([sack synthetic system file negative])
3370 AT_DATA([sys-file.sack], [dnl
3372 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3373 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3376 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3378 dnl Data file attributes record.
3380 "Attr1('value'"; i8 10; ")";
3381 "Attr1('value'"; i8 10; ")";
3384 dnl Variable attributes record.
3387 "fred('23'"; i8 10; ")";
3388 "fred('23'"; i8 10; ")";
3391 dnl Character encoding record.
3392 7; 20; 1; 12; "windows-1252";
3394 dnl Dictionary termination record.
3397 for variant in be le; do
3398 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3399 AT_DATA([sys-file.sps], [dnl
3400 GET FILE='sys-file.sav'.
3402 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3403 warning: `sys-file.sav' near offset 0xf6: Duplicate attribute Attr1.
3405 warning: `sys-file.sav' near offset 0x125: Duplicate attribute fred.
3410 AT_SETUP([bad variable name in long string value label])
3411 AT_KEYWORDS([sack synthetic system file negative])
3412 AT_DATA([sys-file.sack], [dnl
3414 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3415 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3418 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3419 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3420 2; -1; 0; 0; 0; 0; s8 "";
3423 dnl No variable named STR9.
3424 COUNT(>>"STR9"<<); 9;
3425 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3427 dnl NUM1 is numeric.
3428 COUNT(>>"NUM1"<<); 0;
3429 1; COUNT("xyz"); COUNT("value label for 1.0");
3431 dnl Wrong width for STR14.
3432 COUNT("STR14"); >>9<<;
3433 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3435 dnl Wrong width for value.
3437 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3439 dnl Duplicate value label.
3440 COUNT("STR14"); 14; 2;
3441 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3442 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3445 dnl Character encoding record.
3446 7; 20; 1; 12; "windows-1252";
3448 dnl Dictionary termination record.
3451 for variant in be le; do
3452 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3453 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3455 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3456 warning: `sys-file.sav' near offset 0x128: Ignoring long string value label record for unknown variable STR9.
3458 warning: `sys-file.sav' near offset 0x164: Ignoring long string value label record for numeric variable NUM1.
3460 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).
3462 "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."
3464 warning: `sys-file.sav' near offset 0x259: Duplicate value label for `abcdefghijklmn' on str14.
3469 AT_SETUP([fewer data records than indicated by file header])
3470 AT_KEYWORDS([sack synthetic system file negative])
3471 AT_DATA([sys-file.sack], [dnl
3473 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3474 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3476 dnl Numeric variables.
3477 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3478 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3480 dnl Character encoding record.
3481 7; 20; 1; 12; "windows-1252";
3489 dnl Missing record here.
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'.
3496 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3497 [error: Error reading case from file `sys-file.sav'.
3509 AT_SETUP([partial data record between variables])
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; -1; 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";
3528 for variant in be le; do
3529 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3530 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3533 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3534 [error: `sys-file.sav' near offset 0x12c: File ends in partial case.
3543 AT_SETUP([partial data record within long string])
3544 AT_KEYWORDS([sack synthetic system file negative])
3545 AT_DATA([sys-file.sack], [dnl
3547 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3548 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3550 dnl Numeric variables.
3551 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3552 2; -1; 0; 0; 0; 0; s8 "";
3554 dnl Character encoding record.
3555 7; 20; 1; 12; "windows-1252";
3559 s14 "one data item";
3562 for variant in be le; do
3563 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3564 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3567 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3568 [error: `sys-file.sav' near offset 0x12a: Unexpected end of file.
3577 AT_SETUP([partial compressed data record])
3578 AT_KEYWORDS([sack synthetic system file positive])
3579 AT_DATA([sys-file.sack], [dnl
3581 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3583 6; dnl Nominal case size
3586 -1; dnl Unspecified number of cases.
3588 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3591 dnl Numeric variables.
3592 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3593 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3595 dnl String variable.
3596 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3597 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3598 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3599 2; -1; 0; 0; 0; 0; s8 "";
3601 dnl Character encoding record.
3602 7; 20; 1; 12; "windows-1252";
3604 dnl Dictionary termination record.
3607 dnl Compressed data.
3608 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3610 for variant in be le; do
3611 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3612 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3615 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3616 [error: `sys-file.sav' near offset 0x1ac: File ends in partial case.
3619 num1,num2,str4,str8,str15
3620 -99,0,,abcdefgh,0123 @&t@
3625 AT_SETUP([zcompressed data - bad zheader_ofs])
3626 AT_KEYWORDS([sack synthetic system file negative zlib])
3627 zcompressed_sack | sed 's/.*zheader_ofs.*/>>i64 0<<;/' > sys-file.sack
3628 for variant in be le; do
3629 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3630 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3632 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).
3637 AT_SETUP([zcompressed data - bad ztrailer_ofs])
3638 AT_KEYWORDS([sack synthetic system file negative zlib])
3639 zcompressed_sack | sed 's/.*ztrailer_ofs.*/>>i64 0<<;/' > sys-file.sack
3640 for variant in be le; do
3641 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3642 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3644 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Impossible ZLIB trailer offset 0x0.
3649 # ztrailer_len must be a multiple of 24 and at least 48,
3650 # so a value of 12 is impossible.
3651 AT_SETUP([zcompressed data - invalid ztrailer_len])
3652 AT_KEYWORDS([sack synthetic system file negative zlib])
3653 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 12<<;/' > sys-file.sack
3654 for variant in be le; do
3655 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3656 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3658 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Invalid ZLIB trailer length 12.
3663 # ztrailer_ofs + ztrailer_len must be the file size.
3664 AT_SETUP([zcompressed data - wrong ztrailer_len])
3665 AT_KEYWORDS([sack synthetic system file negative zlib])
3666 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 72<<;/' > sys-file.sack
3667 for variant in be le; do
3668 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3669 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3671 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).
3672 error: `sys-file.sav' near offset 0x21d: 72-byte ZLIB trailer specifies 1 data blocks (expected 2).
3677 AT_SETUP([zcompressed data - wrong ztrailer_bias])
3678 AT_KEYWORDS([sack synthetic system file negative zlib])
3679 zcompressed_sack | sed 's/.*ztrailer_bias.*/>>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 0x20d: ZLIB trailer bias (0) differs from file header bias (100.00).
3689 AT_SETUP([zcompressed data - wrong ztrailer_zero])
3690 AT_KEYWORDS([sack synthetic system file negative zlib])
3691 zcompressed_sack | sed 's/.*ztrailer_zero.*/>>i64 100<<;/' > sys-file.sack
3692 for variant in be le; do
3693 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3694 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3696 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.
3701 AT_SETUP([zcompressed data - wrong block_size])
3702 AT_KEYWORDS([sack synthetic system file negative zlib])
3703 zcompressed_sack | sed 's/.*block_size.*/>>0x1000<<;/' > sys-file.sack
3704 for variant in be le; do
3705 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3706 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3708 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.
3713 AT_SETUP([zcompressed data - wrong n_blocks])
3714 AT_KEYWORDS([sack synthetic system file negative zlib])
3715 zcompressed_sack | sed 's/.*n_blocks.*/>>2<<;/' > sys-file.sack
3716 for variant in be le; do
3717 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3718 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3720 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).
3725 AT_SETUP([zcompressed data - wrong uncompressed_ofs])
3726 AT_KEYWORDS([sack synthetic system file negative zlib])
3727 zcompressed_sack | sed 's/.*uncompressed_ofs.*/i64 >>0x177<<;/' > sys-file.sack
3728 for variant in be le; do
3729 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3730 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3732 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.
3737 AT_SETUP([zcompressed data - wrong compressed_ofs])
3738 AT_KEYWORDS([sack synthetic system file negative zlib])
3739 zcompressed_sack | sed 's/.*@%:@ compressed_ofs.*/i64 >>0x191<<;/' > sys-file.sack
3740 for variant in be le; do
3741 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3742 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3744 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.
3749 AT_SETUP([zcompressed data - compressed sizes don't add up])
3750 AT_KEYWORDS([sack synthetic system file negative zlib])
3751 AT_DATA([sys-file.sack], [dnl
3753 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3755 6; dnl Nominal case size
3756 2; dnl zlib compressed
3758 -1; dnl Unspecified number of cases.
3760 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3763 dnl Numeric variables.
3764 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3765 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3767 dnl String variable.
3768 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3769 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3770 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3771 2; -1; 0; 0; 0; 0; s8 "";
3773 dnl Character encoding record.
3774 7; 20; 1; 12; "windows-1252";
3776 dnl Dictionary termination record.
3779 dnl ZLIB data header.
3780 i64 0x194; # zheader_ofs
3781 i64 0x1ac; # ztrailer_ofs
3782 i64 72; # ztrailer_len
3784 dnl This is where the ZLIB data blocks would go, but we don't need any to
3785 dnl provoke this message so we omit them.
3787 dnl ZLIB data trailer fixed header:
3788 i64 -100; # ztrailer_bias
3789 i64 0; # ztrailer_zero
3790 0x3ff000; # block_size
3793 dnl ZLIB block descriptor 1:
3794 i64 0x194; # uncompressed_ofs
3795 i64 0x1ac; # compressed_ofs
3796 0x100000; # uncompressed_size
3797 0x12345; # compressed_size
3799 dnl ZLIB block descriptor 2:
3800 i64 0x100194; # uncompressed_ofs
3801 i64 0x12421; # compressed_ofs
3802 0x100000; # uncompressed_size
3803 0x12345; # compressed_size
3805 for variant in be le; do
3806 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3807 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3809 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.
3810 error: `sys-file.sav' near offset 0x1dc: ZLIB block descriptor 1 reported compressed data offset 0x12421, when 0x124f1 was expected.
3815 AT_SETUP([zcompressed data - uncompressed_size > block_size])
3816 AT_KEYWORDS([sack synthetic system file negative zlib])
3817 zcompressed_sack | sed 's/.*uncompressed_size.*/>>0x400000<<;/' > sys-file.sack
3818 for variant in be le; do
3819 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3820 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3822 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.
3827 AT_SETUP([zcompressed data - compression expands data too much])
3828 AT_KEYWORDS([sack synthetic system file negative zlib])
3829 zcompressed_sack | sed 's/.*uncompressed_size.*/>>50<<;/
3830 s/.*@%:@ compressed_size.*/>>100<<;/' > sys-file.sack
3831 for variant in be le; do
3832 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3833 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3835 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.
3840 AT_SETUP([zcompressed data - compressed sizes don't add up])
3841 AT_KEYWORDS([sack synthetic system file negative zlib])
3842 zcompressed_sack | sed 's/.*@%:@ compressed_size.*/>>88<<;/' > sys-file.sack
3843 for variant in be le; do
3844 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3845 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3847 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.
3853 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467004.
3854 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
3855 # See also https://security-tracker.debian.org/tracker/CVE-2017-10791.
3856 # Found by team OWL337, using the collAFL fuzzer.
3857 AT_SETUP([integer overflows in long string missing values])
3858 AT_KEYWORDS([system file negative])
3859 cp $top_srcdir/tests/data/CVE-2017-10791.sav .
3860 AT_CHECK([pspp-convert -O csv -e ASCII CVE-2017-10791.sav -], [0], [], [dnl
3861 `CVE-2017-10791.sav' near offset 0x217: Extension record subtype 21 ends unexpectedly.
3866 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467005.
3867 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
3868 # See also https://security-tracker.debian.org/tracker/CVE-2017-10792.
3869 # Reported by team OWL337, with fuzzer collAFL.
3870 AT_SETUP([null dereference skipping bad extension record 18])
3871 AT_KEYWORDS([system file negative])
3872 cp $top_srcdir/tests/data/CVE-2017-10792.sav .
3873 AT_CHECK([pspp-convert -O csv -e ASCII CVE-2017-10792.sav -], [0], [], [dnl
3874 `CVE-2017-10792.sav' near offset 0x1c0: Record type 7, subtype 18 has bad size 4 (expected 1).