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
151 Label,PSPP synthetic test file: ôõöø
154 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
155 num1,1,,Scale,Input,8,Right,F8.0,F8.0,
156 num2,2,Numeric variable 2's label (ùúû),Scale,Input,8,Right,F8.0,F8.0,
157 num3,3,,Scale,Input,8,Right,F8.0,F8.0,1
158 num4,4,Another numeric variable label,Scale,Input,8,Right,F8.0,F8.0,1
159 num5,5,,Scale,Input,8,Right,F8.0,F8.0,1; 2
160 num6,6,,Scale,Input,8,Right,F8.0,F8.0,1; 2; 3
161 num7,7,,Scale,Input,8,Right,F8.0,F8.0,1 THRU 3
162 num8,8,,Scale,Input,8,Right,F8.0,F8.0,1 THRU 3; 5
163 num9,9,,Scale,Input,8,Right,F8.0,F8.0,1 THRU HIGHEST; -5
164 numàèìñò,10,,Scale,Input,8,Right,F8.0,F8.0,LOWEST THRU 1; 5
165 str1,11,,Nominal,Input,4,Left,A4,A4,
166 str2,12,String variable 2's label,Nominal,Input,4,Left,A4,A4,
167 str3,13,,Nominal,Input,4,Left,A4,A4,"""MISS"""
168 str4,14,Another string variable label,Nominal,Input,4,Left,A4,A4,"""OTHR"""
169 str5,15,,Nominal,Input,4,Left,A4,A4,"""MISS""; ""OTHR"""
170 str6,16,,Nominal,Input,4,Left,A4,A4,"""MISS""; ""OTHR""; ""MORE"""
171 str7,17,,Nominal,Input,11,Left,A11,A11,"""first8by"""
172 str8,18,,Nominal,Input,9,Left,A9,A9,"""abcdefgh"""
173 str9,19,,Nominal,Input,10,Left,A10,A10,"""abcdefgh""; ""01234567"""
174 str10,20,,Nominal,Input,11,Left,A11,A11,"""abcdefgh""; ""01234567""; ""0 """
175 str11,21,25-byte string,Nominal,Input,25,Left,A25,A25,
178 num1,num2,num3,num4,num5,num6,num7,num8,num9,numàèìñò,str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11
179 1,2,3,4,5,6,7,8,9,10,abcd,efgh,ijkl,mnop,qrst,uvwx,yzABCDEFGHI,JKLMNOPQR,STUVWXYZ01,23456789abc,defghijklmnopqstuvwxyzABC
184 AT_SETUP([unspecified number of variable positions])
185 AT_KEYWORDS([sack synthetic system file positive])
186 AT_DATA([sys-file.sack], [dnl
188 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
190 -1; dnl Nominal case size (unspecified)
191 0; dnl Not compressed
195 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
198 dnl Numeric variable, no label or missing values.
199 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
201 dnl Numeric variable, variable label.
202 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
203 26; "Numeric variable 2's label"; i8 0 *2;
205 dnl Character encoding record.
206 7; 20; 1; 12; "windows-1252";
208 dnl Dictionary termination record.
214 for variant in be le; do
215 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
216 AT_DATA([sys-file.sps], [dnl
217 GET FILE='sys-file.sav'.
221 AT_CHECK([pspp -o pspp.csv sys-file.sps])
222 AT_CHECK([cat pspp.csv], [0], [dnl
224 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
225 num1,1,,Scale,Input,8,Right,F8.0,F8.0
226 num2,2,Numeric variable 2's label,Scale,Input,8,Right,F8.0,F8.0
235 AT_SETUP([wrong number of variable positions but version 13])
236 AT_KEYWORDS([sack synthetic system file positive])
237 AT_DATA([sys-file.sack], [dnl
239 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
241 -1; dnl Nominal case size (unspecified)
242 0; dnl Not compressed
246 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
249 dnl Numeric variable, no label or missing values.
250 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
252 dnl Numeric variable, variable label.
253 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
254 26; "Numeric variable 2's label"; i8 0 *2;
256 dnl Machine integer info record (SPSS 13).
257 7; 3; 4; 8; 13; 2; 3; -1; 1; 1; ENDIAN; 1252;
259 dnl Character encoding record.
260 7; 20; 1; 12; "windows-1252";
262 dnl Dictionary termination record.
268 for variant in be le; do
269 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
270 AT_DATA([sys-file.sps], [dnl
271 GET FILE='sys-file.sav'.
275 AT_CHECK([pspp -o pspp.csv sys-file.sps])
276 AT_CHECK([cat pspp.csv], [0], [dnl
278 Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
279 num1,1,,Scale,Input,8,Right,F8.0,F8.0
280 num2,2,Numeric variable 2's label,Scale,Input,8,Right,F8.0,F8.0
289 AT_SETUP([value labels])
290 AT_KEYWORDS([sack synthetic system file positive])
291 AT_DATA([sys-file.sack], [dnl
293 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
295 22; dnl Nominal case size
296 0; dnl Not compressed
300 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
303 dnl Numeric variables.
304 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
305 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
306 2; 0; 0; 0; 0x050800 *2; s8 "NUM3";
307 2; 0; 0; 0; 0x050800 *2; s8 "NUM4";
308 2; 0; 0; 0; 0x050800 *2; s8 "NUM5";
310 dnl String variables.
311 2; 1; 0; 0; 0x010100 *2; s8 "STR1"; dnl index 6
312 2; 2; 0; 0; 0x010200 *2; s8 "STR2"; dnl index 7
313 2; 3; 0; 0; 0x010300 *2; s8 "STR3"; dnl index 8
314 2; 4; 0; 0; 0x010400 *2; s8 "STR4"; dnl index 9
315 2; 4; 0; 0; 0x010400 *2; s8 "STR5"; dnl index 10
316 2; 6; 0; 0; 0x010600 *2; s8 "STR6"; dnl index 11
317 2; 7; 0; 0; 0x010700 *2; s8 "STR7"; dnl index 12
318 2; 8; 0; 0; 0x010800 *2; s8 "STR8"; dnl index 13
319 2; 9; 0; 0; 0x010900 *2; "STR9"; i8 230; s3 ""; dnl index 14
320 2; -1; 0; 0; 0; 0; s8 "";
321 2; 12; 0; 0; 0x010c00 *2; s8 "STR12"; dnl index 16
322 2; -1; 0; 0; 0; 0; s8 "";
323 2; 16; 0; 0; 0x011000 *2; s8 "STR16"; dnl index 18
324 2; -1; 0; 0; 0; 0; s8 "";
325 2; 17; 0; 0; 0x011100 *2; s8 "STR17"; dnl index 20
326 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
328 dnl One value label for NUM1.
329 3; 1; 1.0; i8 17; i8 238; i8 228; i8 232; i8 237; s19 " (in Russian)"; 4; 1; 1;
331 dnl Two value labels for NUM2, as a single pair of type 3 and type 4 records.
332 3; 2; 1.0; i8 3; s7 "one"; 2.0; i8 3; s7 "two"; 4; 1; 2;
334 dnl Two value labels for NUM3, as two pairs of type 3 and type 4 records.
335 3; 1; 3.0; i8 5; s7 "three"; 4; 1; 3;
336 3; 1; 4.0; i8 4; s7 "four"; 4; 1; 3;
338 dnl Two common value labels for NUM4 and NUM5, plus two different ones for each.
339 3; 1; 5.0; i8 4; s7 "five"; 4; 1; 4;
340 3; 1; 6.0; i8 3; s7 "six"; 4; 1; 5;
341 3; 2; 7.0; i8 5; s7 "seven"; 8.0; i8 5; s7 "eight"; 4; 2; 4; 5;
342 3; 1; 9.0; i8 4; s7 "nine"; 4; 1; 4;
343 3; 1; 10.0; i8 3; s7 "ten"; 4; 1; 5;
345 dnl One value label for STR1.
346 3; 1; s8 "a"; i8 19; s23 "value label for `a'"; 4; 1; 6;
348 dnl Two value labels for STR2, as a single pair of type 3 and type 4 records.
350 s8 "bc"; i8 20; s23 "value label for `bc'";
351 s8 "de"; i8 20; s23 "value label for `de'";
354 dnl Two value labels for STR3, as two pairs of type 3 and type 4 records.
355 3; 1; s8 "fgh"; i8 21; s23 "value label for `fgh'"; 4; 1; 8;
356 3; 1; s8 "ijk"; i8 21; s23 "value label for `ijk'"; 4; 1; 8;
358 dnl Two common value labels for STR4 and STR5, plus two different ones for each.
359 3; 1; s8 "lmno"; i8 22; s23 "value label for `lmno'"; 4; 1; 9;
360 3; 1; s8 "pqrs"; i8 22; s23 "value label for `pqrs'"; 4; 1; 10;
362 s8 "tuvw"; i8 22; s23 "value label for `tuvw'";
363 s8 "xyzA"; i8 22; s23 "value label for `xyzA'";
365 3; 1; s8 "BCDE"; i8 22; s23 "value label for `BCDE'"; 4; 1; 9;
366 3; 1; s8 "FGHI"; i8 22; s23 "value label for `FGHI'"; 4; 1; 10;
368 dnl One value label for STR6, STR7, STR8.
369 3; 1; s8 "JKLMNO"; i8 24; s31 "value label for `JKLMNO'"; 4; 1; 11;
370 3; 1; s8 "JKLMNOP"; i8 25; s31 "value label for `JKLMNOP'"; 4; 1; 12;
371 3; 1; s8 "JKLMNOPQ"; i8 26; s31 "value label for `JKLMNOPQ'"; 4; 1; 13;
373 dnl Machine integer info record.
374 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1251;
376 dnl Character encoding record.
377 7; 20; 1; 12; "windows-1251";
380 dnl One value label for STR9ж,
381 COUNT("STR9"; i8 230); 9; 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
383 dnl Two value labels for STR12.
384 COUNT("STR12"); 12; 2;
385 COUNT("0123456789ab"); COUNT("value label for `0123456789ab'");
386 COUNT("cdefghijklmn"); COUNT("value label for `cdefghijklmn'");
388 dnl Three value labels for STR16.
389 COUNT("STR16"); 16; 3;
390 COUNT("opqrstuvwxyzABCD"); COUNT("value label for `opqrstuvwxyzABCD'");
391 COUNT("EFGHIJKLMNOPQRST"); COUNT("value label for `EFGHIJKLMNOPQRST'");
392 COUNT("UVWXYZ0123456789"); COUNT("value label for `UVWXYZ0123456789' with Cyrillic letters: `"; i8 244; i8 245; i8 246; "'");
394 dnl One value label for STR17.
395 COUNT("STR17"); 17; 1;
396 COUNT("abcdefghijklmnopq"); COUNT("value label for `abcdefghijklmnopq'");
399 dnl Dictionary termination record.
402 for variant in be le; do
403 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
404 AT_DATA([sys-file.sps], [dnl
405 GET FILE='sys-file.sav'.
408 AT_CHECK([pspp -o pspp.csv sys-file.sps])
409 AT_CHECK([cat pspp.csv], [0], [dnl
411 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
412 num1,1,Scale,Input,8,Right,F8.0,F8.0
413 num2,2,Scale,Input,8,Right,F8.0,F8.0
414 num3,3,Scale,Input,8,Right,F8.0,F8.0
415 num4,4,Scale,Input,8,Right,F8.0,F8.0
416 num5,5,Scale,Input,8,Right,F8.0,F8.0
417 str1,6,Nominal,Input,1,Left,A1,A1
418 str2,7,Nominal,Input,2,Left,A2,A2
419 str3,8,Nominal,Input,3,Left,A3,A3
420 str4,9,Nominal,Input,4,Left,A4,A4
421 str5,10,Nominal,Input,4,Left,A4,A4
422 str6,11,Nominal,Input,6,Left,A6,A6
423 str7,12,Nominal,Input,7,Left,A7,A7
424 str8,13,Nominal,Input,8,Left,A8,A8
425 str9ж,14,Nominal,Input,9,Left,A9,A9
426 str12,15,Nominal,Input,12,Left,A12,A12
427 str16,16,Nominal,Input,16,Left,A16,A16
428 str17,17,Nominal,Input,17,Left,A17,A17
431 Variable Value,,Label
432 num1,1,один (in Russian)
445 str1,a,value label for `a'
446 str2,bc,value label for `bc'
447 ,de,value label for `de'
448 str3,fgh,value label for `fgh'
449 ,ijk,value label for `ijk'
450 str4,BCDE,value label for `BCDE'
451 ,lmno,value label for `lmno'
452 ,tuvw,value label for `tuvw'
453 ,xyzA,value label for `xyzA'
454 str5,FGHI,value label for `FGHI'
455 ,pqrs,value label for `pqrs'
456 ,tuvw,value label for `tuvw'
457 ,xyzA,value label for `xyzA'
458 str6,JKLMNO,value label for `JKLMNO'
459 str7,JKLMNOP,value label for `JKLMNOP'
460 str8,JKLMNOPQ,value label for `JKLMNOPQ'
461 str9ж,RSTUVWXYZ,value label for `RSTUVWXYZ'
462 str12,0123456789ab,value label for `0123456789ab'
463 ,cdefghijklmn,value label for `cdefghijklmn'
464 str16,EFGHIJKLMNOPQRST,value label for `EFGHIJKLMNOPQRST'
465 ,UVWXYZ0123456789,value label for `UVWXYZ0123456789' with Cyrillic letters: `фхц'
466 ,opqrstuvwxyzABCD,value label for `opqrstuvwxyzABCD'
467 str17,abcdefghijklmnopq,value label for `abcdefghijklmnopq'
472 AT_SETUP([documents])
473 AT_KEYWORDS([sack synthetic system file positive])
474 AT_DATA([sys-file.sack], [dnl
476 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
478 1; dnl Nominal case size
479 0; dnl Not compressed
483 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
486 dnl Numeric variable, no label or missing values.
487 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
489 dnl Machine integer info record.
490 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
494 s80 "First line of documents";
495 s80 "Second line of documents";
496 "abb"; i8 233; " appliqu"; i8 233; " attach"; i8 233; " blas"; i8 233; " caf"; i8 233; " canap"; i8 233; " clich"; i8 233; " consomm"; i8 233;
499 s80 "Last line of documents";
501 dnl Character encoding record.
502 7; 20; 1; 12; "windows-1252";
504 dnl Dictionary termination record.
510 for variant in be le; do
511 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
512 AT_DATA([sys-file.sps], [dnl
513 GET FILE='sys-file.sav'.
517 AT_CHECK([pspp -o pspp.csv sys-file.sps])
518 AT_CHECK([cat pspp.csv], [0], [dnl
520 "First line of documents
521 Second line of documents
522 abbé appliqué attaché blasé café canapé cliché consommé
524 Last line of documents"
533 AT_SETUP([empty document record])
534 AT_KEYWORDS([sack synthetic system file positive])
535 AT_DATA([sys-file.sack], [dnl
537 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
539 1; dnl Nominal case size
540 0; dnl Not compressed
544 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
547 dnl Numeric variable, no label or missing values.
548 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
550 dnl Machine integer info record.
551 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
556 dnl Character encoding record.
557 7; 20; 1; 12; "windows-1252";
559 dnl Dictionary termination record.
565 for variant in be le; do
566 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
567 AT_DATA([sys-file.sps], [dnl
568 GET FILE='sys-file.sav'.
571 AT_CHECK([pspp -o pspp.csv sys-file.sps])
572 AT_CHECK([cat pspp.csv], [0], [dnl
580 AT_SETUP([multiple response sets])
581 AT_KEYWORDS([sack synthetic system file positive])
582 AT_DATA([sys-file.sack], [dnl
584 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
586 16; dnl Nominal case size
587 0; dnl Not compressed
591 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
595 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
596 2; 0; 0; 0; 0x050800 *2; s8 "B";
597 2; 0; 0; 0; 0x050800 *2; s8 "C";
600 2; 0; 0; 0; 0x050800 *2; s8 "D";
601 2; 0; 0; 0; 0x050800 *2; s8 "E";
602 2; 0; 0; 0; 0x050800 *2; s8 "F";
603 2; 0; 0; 0; 0x050800 *2; s8 "G";
606 2; 4; 0; 0; 0x010400 *2; s8 "H";
607 2; 4; 0; 0; 0x010400 *2; s8 "I";
608 2; 4; 0; 0; 0x010400 *2; s8 "J";
611 2; 0; 0; 0; 0x050800 *2; s8 "K";
612 2; 0; 0; 0; 0x050800 *2; s8 "L";
613 2; 0; 0; 0; 0x050800 *2; s8 "M";
616 2; 6; 0; 0; 0x010600 *2; s8 "N";
617 2; 6; 0; 0; 0x010600 *2; s8 "O";
618 2; 6; 0; 0; 0x010600 *2; s8 "P";
620 dnl Machine integer info record.
621 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
625 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
626 "$b=D2 55 0 g e f d"; i8 10; i8 10;
627 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
632 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
633 "$e=E 11 6 choice 0 n o p"; i8 10; i8 10; i8 10; i8 10);
635 dnl Character encoding record.
636 7; 20; 1; 9; "shift_jis";
638 dnl Dictionary termination record.
641 for variant in be le; do
642 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
643 AT_DATA([sys-file.sps], [dnl
644 GET FILE='sys-file.sav'.
645 MRSETS /DISPLAY NAME=ALL.
647 AT_CHECK([pspp -o pspp.csv sys-file.sps])
648 AT_CHECK([cat pspp.csv], [0], [dnl
649 Table: Multiple Response Sets
650 Name,Label,Encoding,Counted Value,Member Variables
651 $a,my mcgroup,Categories,,"あ
654 $b,,Dichotomies,55,"g
658 $c,mdgroup #2,Dichotomies,はい,"h
661 $d,third mdgroup,Dichotomies,34,"k
664 $e,,Dichotomies,choice,"n
671 dnl Also checks for handling of CR-only line ends in file label and
672 dnl extra product info.
673 AT_SETUP([extra product info])
674 AT_KEYWORDS([sack synthetic system file positive])
675 AT_DATA([sys-file.sack], [dnl
677 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
679 4; dnl Nominal case size
680 0; dnl Not compressed
684 "01 Jan 11"; "20:53:52"; "PSPP synthetic"; i8 13; s49 "test file";
687 dnl Numeric variables.
688 2; 0; 0; 0; 0x050800 *2; s8 "A";
689 2; 0; 0; 0; 0x050800 *2; s8 "B";
690 2; 0; 0; 0; 0x050800 *2; s8 "C";
691 2; 0; 0; 0; 0x050800 *2; s8 "D";
693 dnl Extra product info.
694 7; 10; 1; COUNT ("Extra product info"; i8 13; "another line"; i8 13; "blah");
696 dnl Character encoding record.
697 7; 20; 1; 12; "windows-1252";
699 dnl Dictionary termination record.
702 for variant in be; do
703 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
704 AT_DATA([sys-file.sps], [dnl
705 SYSFILE INFO FILE='sys-file.sav'.
707 AT_CHECK([pspp -o pspp.csv sys-file.sps])
708 AT_CHECK([sed 8q pspp.csv], [0], [dnl
709 Table: File Information
711 Label,"PSPP synthetic
713 Created,01 Jan 11 20:53:52 by $(@%:@) SPSS DATA FILE PSPP synthetic test file
714 Product,"Extra product info
721 AT_SETUP([variable display parameters, without width])
722 AT_KEYWORDS([sack synthetic system file positive])
723 AT_DATA([sys-file.sack], [dnl
725 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
727 19; dnl Nominal case size
728 0; dnl Not compressed
732 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
735 dnl Numeric variables.
736 2; 0; 0; 0; 0x050800 *2; s8 "A";
737 2; 0; 0; 0; 0x050800 *2; s8 "B";
738 2; 0; 0; 0; 0x050800 *2; s8 "C";
739 2; 0; 0; 0; 0x050800 *2; s8 "D";
741 dnl Short string variables.
742 2; 3; 0; 0; 0x010300 *2; s8 "H";
743 2; 3; 0; 0; 0x010300 *2; s8 "I";
744 2; 3; 0; 0; 0x010300 *2; s8 "J";
745 2; 3; 0; 0; 0x010300 *2; s8 "K";
747 dnl Long string variables.
748 2; 9; 0; 0; 0x010900 *2; s8 "L";
749 2; -1; 0; 0; 0; 0; s8 "";
750 2; 10; 0; 0; 0x010a00 *2; s8 "M";
751 2; -1; 0; 0; 0; 0; s8 "";
752 2; 17; 0; 0; 0x011100 *2; s8 "N";
753 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
754 2; 25; 0; 0; 0x011900 *2; s8 "O";
755 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
757 dnl Variable display parameters
772 dnl Character encoding record.
773 7; 20; 1; 12; "windows-1252";
775 dnl Dictionary termination record.
778 for variant in be le; do
779 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
780 AT_DATA([sys-file.sps], [dnl
781 GET FILE='sys-file.sav'.
784 AT_CHECK([pspp -o pspp.csv sys-file.sps])
785 AT_CHECK([cat pspp.csv], [0], [dnl
787 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
788 a,1,Nominal,Input,8,Left,F8.0,F8.0
789 b,2,Ordinal,Input,8,Left,F8.0,F8.0
790 c,3,Scale,Input,8,Left,F8.0,F8.0
791 d,4,Nominal,Input,8,Right,F8.0,F8.0
792 h,5,Ordinal,Input,3,Right,A3,A3
793 i,6,Scale,Input,3,Right,A3,A3
794 j,7,Nominal,Input,3,Center,A3,A3
795 k,8,Ordinal,Input,3,Center,A3,A3
796 l,9,Scale,Input,9,Center,A9,A9
797 m,10,Nominal,Input,10,Left,A10,A10
798 n,11,Nominal,Input,17,Right,A17,A17
799 o,12,Nominal,Input,25,Center,A25,A25
804 AT_SETUP([variable display parameters, with width])
805 AT_KEYWORDS([sack synthetic system file positive])
806 AT_DATA([sys-file.sack], [dnl
808 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
810 19; dnl Nominal case size
811 0; dnl Not compressed
815 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
818 dnl Numeric variables.
819 2; 0; 0; 0; 0x050800 *2; s8 "A";
820 2; 0; 0; 0; 0x050800 *2; s8 "B";
821 2; 0; 0; 0; 0x050800 *2; s8 "C";
822 2; 0; 0; 0; 0x050800 *2; s8 "D";
824 dnl Short string variables.
825 2; 3; 0; 0; 0x010300 *2; s8 "H";
826 2; 3; 0; 0; 0x010300 *2; s8 "I";
827 2; 3; 0; 0; 0x010300 *2; s8 "J";
828 2; 3; 0; 0; 0x010300 *2; s8 "K";
830 dnl Long string variables.
831 2; 9; 0; 0; 0x010900 *2; s8 "L";
832 2; -1; 0; 0; 0; 0; s8 "";
833 2; 10; 0; 0; 0x010a00 *2; s8 "M";
834 2; -1; 0; 0; 0; 0; s8 "";
835 2; 17; 0; 0; 0x011100 *2; s8 "N";
836 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
837 2; 25; 0; 0; 0x011900 *2; s8 "O";
838 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
840 dnl Variable display parameters
855 dnl Character encoding record.
856 7; 20; 1; 12; "windows-1252";
858 dnl Dictionary termination record.
861 for variant in be le; do
862 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
863 AT_DATA([sys-file.sps], [dnl
864 GET FILE='sys-file.sav'.
867 AT_CHECK([pspp -o pspp.csv sys-file.sps])
868 AT_CHECK([cat pspp.csv], [0], [dnl
870 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
871 a,1,Nominal,Input,1,Left,F8.0,F8.0
872 b,2,Ordinal,Input,2,Left,F8.0,F8.0
873 c,3,Scale,Input,3,Left,F8.0,F8.0
874 d,4,Nominal,Input,4,Right,F8.0,F8.0
875 h,5,Ordinal,Input,5,Right,A3,A3
876 i,6,Scale,Input,6,Right,A3,A3
877 j,7,Nominal,Input,7,Center,A3,A3
878 k,8,Ordinal,Input,8,Center,A3,A3
879 l,9,Scale,Input,9,Center,A9,A9
880 m,10,Nominal,Input,10,Left,A10,A10
881 n,11,Nominal,Input,11,Right,A17,A17
882 o,12,Nominal,Input,12,Center,A25,A25
887 AT_SETUP([long variable names])
888 AT_KEYWORDS([sack synthetic system file positive])
889 AT_DATA([sys-file.sack], [dnl
891 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
893 7; dnl Nominal case size
894 0; dnl Not compressed
898 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
901 dnl Numeric variables.
902 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
903 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
904 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
905 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
906 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDINA";
907 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_A";
908 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_B";
910 dnl Machine integer info record.
911 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
913 dnl Machine floating-point info record.
914 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
916 dnl Long variable names.
918 "LONGVARI=LongVariableName1"; i8 9;
919 "LONGVA_A=LongVariableName2"; i8 9;
920 "LONGVA_B=LongVariableName3"; i8 9;
921 "LONGVA_C=LongVariableName4"; i8 9;
922 "CO"; i8 214; "RDINA=Co"; i8 246; "rdinate_X"; i8 9;
923 "CO"; i8 214; "RDI_A=Co"; i8 246; "rdinate_Y"; i8 9;
924 "CO"; i8 214; "RDI_B=Co"; i8 246; "rdinate_Z";
927 dnl Character encoding record.
928 7; 20; 1; 12; "windows-1252";
930 dnl Dictionary termination record.
933 for variant in be le; do
934 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
935 AT_DATA([sys-file.sps], [dnl
936 GET FILE='sys-file.sav'.
939 AT_CHECK([pspp -o pspp.csv sys-file.sps])
940 AT_CHECK([cat pspp.csv], [0], [dnl
942 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
943 LongVariableName1,1,Scale,Input,8,Right,F8.0,F8.0
944 LongVariableName2,2,Scale,Input,8,Right,F8.0,F8.0
945 LongVariableName3,3,Scale,Input,8,Right,F8.0,F8.0
946 LongVariableName4,4,Scale,Input,8,Right,F8.0,F8.0
947 Coördinate_X,5,Scale,Input,8,Right,F8.0,F8.0
948 Coördinate_Y,6,Scale,Input,8,Right,F8.0,F8.0
949 Coördinate_Z,7,Scale,Input,8,Right,F8.0,F8.0
954 AT_SETUP([very long strings])
955 AT_KEYWORDS([sack synthetic system file positive])
956 AT_DATA([sys-file.sack], [dnl
958 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
960 109; dnl Nominal case size
961 0; dnl Not compressed
965 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
969 2; 255; 0; 0; 0x01FF00 *2; "S"; i8 201; s6 "Q256";
970 (2; -1; 0; 0; 0; 0; s8 "") * 31;
971 2; 4; 0; 0; 0x010400 *2; "S"; i8 201; "Q256_1";
974 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600";
975 (2; -1; 0; 0; 0; 0; s8 "") * 31;
976 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600_1";
977 (2; -1; 0; 0; 0; 0; s8 "") * 31;
978 2; 96; 0; 0; 0x016000 *2; s8 "STR600_2";
979 (2; -1; 0; 0; 0; 0; s8 "") * 11;
981 dnl Machine integer info record.
982 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
984 dnl Very long string record.
986 "S"; i8 201; "Q256=00256"; i8 0; i8 9;
987 "STR600=00600"; i8 0; i8 9;
990 dnl Character encoding record.
991 7; 20; 1; 12; "windows-1252";
993 dnl Dictionary termination record.
997 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 4;
999 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 9;
1000 "abcdefghijklmnopqrstuvwxyzABCDEF";
1002 for variant in be le; do
1003 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1004 AT_DATA([sys-file.sps], [dnl
1005 GET FILE='sys-file.sav'.
1009 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1010 AT_CHECK([cat pspp.csv], [0], [dnl
1012 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1013 séq256,1,Nominal,Input,32,Left,A256,A256
1014 str600,2,Nominal,Input,32,Left,A600,A600
1018 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@a,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyz
1023 AT_SETUP([data file and variable attributes])
1024 AT_KEYWORDS([sack synthetic system file positive])
1025 AT_DATA([sys-file.sack], [dnl
1027 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1029 3; dnl Nominal case size
1030 0; dnl Not compressed
1034 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1038 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
1039 2; 0; 0; 0; 0x050800 *2; s8 "SECONDVA";
1040 2; 0; 0; 0; 0x050800 *2; s8 "THIRDVAR";
1042 dnl Machine integer info record.
1043 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1045 dnl Long variable names.
1047 "FIRSTVAR=FirstVariable"; i8 9;
1048 "SECONDVA=S"; i8 233; "condVariable"; i8 9;
1049 "THIRDVAR=ThirdVariable"; i8 9
1052 dnl Data file attributes record.
1054 "Attr1('Value1'"; i8 10; "''d"; i8 233; "claration''"; i8 10; ")";
1055 "S"; i8 233; "condAttr('123'"; i8 10; "'456'"; i8 10; ")";
1058 dnl Variable attributes record.
1061 "ad"; i8 232; "le('23'"; i8 10; "'34'"; i8 10; ")";
1062 "bert('123'"; i8 10; ")";
1063 "$@Role('1'"; i8 10; ")";
1064 "/S"; i8 233; "condVariable:";
1065 "xyzzy('quux'"; i8 10; ")";
1068 dnl Another variable attributes record.
1069 dnl Only system files written by "Stata 14.1/-savespss- 1.77 by S.Radyakin"
1070 dnl include multiple variable attributes records.
1071 7; 18; 1; COUNT ("ThirdVariable:fizz('buzz'"; i8 10; ")";);
1073 dnl Character encoding record.
1074 7; 20; 1; 12; "windows-1252";
1076 dnl Dictionary termination record.
1079 for variant in be le; do
1080 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1081 AT_DATA([sys-file.sps], [dnl
1082 GET FILE='sys-file.sav'.
1083 DISPLAY @ATTRIBUTES.
1085 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1086 AT_CHECK([cat pspp.csv], [0],
1087 [[Table: Variable and Dataset Attributes
1088 Variable and Name,,Value
1089 (dataset),Attr1[1],Value1
1090 ,Attr1[2],'déclaration'
1093 FirstVariable,$@Role,1
1097 SécondVariable,xyzzy,quux
1098 ThirdVariable,fizz,buzz
1100 AT_DATA([sys-file.sps], [dnl
1101 GET FILE='sys-file.sav'.
1104 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1105 AT_CHECK([cat pspp.csv], [0],
1107 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1108 FirstVariable,1,Scale,Output,8,Right,F8.0,F8.0
1109 SécondVariable,2,Scale,Input,8,Right,F8.0,F8.0
1110 ThirdVariable,3,Scale,Input,8,Right,F8.0,F8.0
1115 AT_SETUP([variable roles])
1116 AT_KEYWORDS([sack synthetic system file positive])
1117 AT_DATA([sys-file.sack], [dnl
1119 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1121 7; dnl Nominal case size
1122 0; dnl Not compressed
1126 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1130 2; 0; 0; 0; 0x050800 *2; s8 "I";
1131 2; 0; 0; 0; 0x050800 *2; s8 "O";
1132 2; 0; 0; 0; 0x050800 *2; s8 "B";
1133 2; 0; 0; 0; 0x050800 *2; s8 "N";
1134 2; 0; 0; 0; 0x050800 *2; s8 "P";
1135 2; 0; 0; 0; 0x050800 *2; s8 "S";
1136 2; 0; 0; 0; 0x050800 *2; s8 "X";
1138 dnl Machine integer info record.
1139 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1141 dnl Variable attributes record.
1143 "I:$@Role('0'"; i8 10; ")";
1144 "/O:$@Role('1'"; i8 10; ")";
1145 "/B:$@Role('2'"; i8 10; ")";
1146 "/N:$@Role('3'"; i8 10; ")";
1147 "/P:$@Role('4'"; i8 10; ")";
1148 "/S:$@Role('5'"; i8 10; ")";
1149 "/X:$@Role('6'"; i8 10; ")";
1152 dnl Character encoding record.
1153 7; 20; 1; 12; "windows-1252";
1155 dnl Dictionary termination record.
1158 for variant in be le; do
1159 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1160 AT_DATA([sys-file.sps], [dnl
1161 GET FILE='sys-file.sav'.
1164 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [dnl
1165 warning: `sys-file.sav': Invalid role for variable x.
1167 AT_CHECK([cat pspp.csv], [0], [dnl
1168 warning: `sys-file.sav': Invalid role for variable x.
1171 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1172 i,1,Scale,Input,8,Right,F8.0,F8.0
1173 o,2,Scale,Output,8,Right,F8.0,F8.0
1174 b,3,Scale,Both,8,Right,F8.0,F8.0
1175 n,4,Scale,None,8,Right,F8.0,F8.0
1176 p,5,Scale,Partition,8,Right,F8.0,F8.0
1177 s,6,Scale,Split,8,Right,F8.0,F8.0
1178 x,7,Scale,Input,8,Right,F8.0,F8.0
1183 AT_SETUP([compressed data])
1184 AT_KEYWORDS([sack synthetic system file positive])
1185 AT_DATA([sys-file.sack], [dnl
1187 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1189 6; dnl Nominal case size
1190 1; dnl Simple compression
1192 -1; dnl Unspecified number of cases.
1194 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1197 dnl Numeric variables.
1198 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1199 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1201 dnl String variable.
1202 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1203 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1204 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1205 2; -1; 0; 0; 0; 0; s8 "";
1207 dnl Character encoding record.
1208 7; 20; 1; 12; "windows-1252";
1210 dnl Dictionary termination record.
1213 dnl Compressed data.
1214 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1215 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1216 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1217 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1220 for variant in be le; do
1221 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1222 AT_DATA([sys-file.sps], [dnl
1223 GET FILE='sys-file.sav'.
1227 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1228 AT_CHECK([cat pspp.csv], [0], [dnl
1230 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1231 num1,1,Scale,Input,8,Right,F8.0,F8.0
1232 num2,2,Scale,Input,8,Right,F8.0,F8.0
1233 str4,3,Nominal,Input,4,Left,A4,A4
1234 str8,4,Nominal,Input,8,Left,A8,A8
1235 str15,5,Nominal,Input,15,Left,A15,A15
1238 num1,num2,str4,str8,str15
1239 -99,0,,abcdefgh,0123
1240 .,151,jklm,nopqrstu,vwxyzABC
1241 1,2,DEFG,HIJKLMNO,PQRSTUV
1246 AT_SETUP([compressed data, zero bias])
1247 AT_KEYWORDS([sack synthetic system file positive])
1248 AT_DATA([sys-file.sack], [dnl
1250 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1252 6; dnl Nominal case size
1253 1; dnl Simple compression.
1255 -1; dnl Unspecified number of cases.
1257 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1260 dnl Numeric variables.
1261 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1262 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1264 dnl String variable.
1265 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1266 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1267 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1268 2; -1; 0; 0; 0; 0; s8 "";
1270 dnl Character encoding record.
1271 7; 20; 1; 12; "windows-1252";
1273 dnl Dictionary termination record.
1276 dnl Compressed data.
1277 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1278 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1279 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1280 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1283 for variant in be le; do
1284 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1285 AT_DATA([sys-file.sps], [dnl
1286 GET FILE='sys-file.sav'.
1290 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1291 AT_CHECK([cat pspp.csv], [0], [dnl
1293 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1294 num1,1,Scale,Input,8,Right,F8.0,F8.0
1295 num2,2,Scale,Input,8,Right,F8.0,F8.0
1296 str4,3,Nominal,Input,4,Left,A4,A4
1297 str8,4,Nominal,Input,8,Left,A8,A8
1298 str15,5,Nominal,Input,15,Left,A15,A15
1301 num1,num2,str4,str8,str15
1302 1,100,,abcdefgh,0123
1303 .,251,jklm,nopqrstu,vwxyzABC
1304 101,102,DEFG,HIJKLMNO,PQRSTUV
1309 AT_SETUP([compressed data, other bias])
1310 AT_KEYWORDS([sack synthetic system file positive])
1311 AT_DATA([sys-file.sack], [dnl
1313 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1315 6; dnl Nominal case size
1316 1; dnl Simple compression.
1318 -1; dnl Unspecified number of cases.
1320 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1323 dnl Numeric variables.
1324 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1325 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1327 dnl String variable.
1328 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1329 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1330 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1331 2; -1; 0; 0; 0; 0; s8 "";
1333 dnl Character encoding record.
1334 7; 20; 1; 12; "windows-1252";
1336 dnl Dictionary termination record.
1339 dnl Compressed data.
1340 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1341 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1342 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1343 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1346 for variant in be le; do
1347 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1348 AT_DATA([sys-file.sps], [dnl
1349 GET FILE='sys-file.sav'.
1353 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0],
1354 [warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1356 AT_CHECK([cat pspp.csv], [0], [dnl
1357 "warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1360 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1361 num1,1,Scale,Input,8,Right,F8.0,F8.0
1362 num2,2,Scale,Input,8,Right,F8.0,F8.0
1363 str4,3,Nominal,Input,4,Left,A4,A4
1364 str8,4,Nominal,Input,8,Left,A8,A8
1365 str15,5,Nominal,Input,15,Left,A15,A15
1368 num1,num2,str4,str8,str15
1369 -49,50,,abcdefgh,0123
1370 .,201,jklm,nopqrstu,vwxyzABC
1371 51,52,DEFG,HIJKLMNO,PQRSTUV
1376 m4_divert_push([PREPARE_TESTS])
1377 zcompressed_sack () {
1380 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1382 6; dnl Nominal case size
1383 2; dnl zlib compressed
1385 -1; dnl Unspecified number of cases.
1387 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1390 dnl Numeric variables.
1391 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1392 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1394 dnl String variable.
1395 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1396 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1397 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1398 2; -1; 0; 0; 0; 0; s8 "";
1400 dnl Character encoding record.
1401 7; 20; 1; 12; "windows-1252";
1403 dnl Dictionary termination record.
1406 dnl ZLIB data header.
1407 i64 0x194; # zheader_ofs
1408 i64 0x205; # ztrailer_ofs
1409 i64 48; # ztrailer_len
1411 dnl ZLIB data block.
1413 dnl This is the compressed form of:
1415 dnl 01 64 fe fd fe fd ff fb 61 62 63 64 65 66 67 68 |.d......abcdefgh|
1416 dnl 30 31 32 33 20 20 20 20 fd fd fd fe 65 66 fd fd |0123 ....ef..|
1417 dnl 6a 6b 6c 6d 20 20 20 20 6e 6f 70 71 72 73 74 75 |jklm nopqrstu|
1418 dnl 76 77 78 79 7a 41 42 43 44 45 46 47 20 20 20 20 |vwxyzABCDEFG |
1419 dnl 48 49 4a 4b 4c 4d 4e 4f fe fd fc 00 00 00 00 00 |HIJKLMNO........|
1420 dnl 50 51 52 53 54 55 56 57 |PQRSTUVW|
1422 dnl which is the data from the "compressed data" test.
1423 hex "78 01 63 4c f9 f7 f7 df df ff bf 13 93 92 53 52";
1424 hex "d3 d2 33 0c 0c 8d 8c 15 80 e0 ef df bf ff 52 d3";
1425 hex "fe fe cd ca ce c9 05 f1 f3 f2 0b 0a 8b 8a 4b 4a";
1426 hex "cb ca 2b 2a ab 1c 9d 9c 5d 5c dd dc 41 e2 1e 9e";
1427 hex "5e de 3e be 7e fe ff fe fe 61 00 81 80 c0 a0 e0";
1428 hex "90 d0 b0 70 00 0f 3f 23 d7";
1430 dnl ZLIB data trailer fixed header:
1431 i64 -100; # ztrailer_bias
1432 i64 0; # ztrailer_zero
1433 0x3ff000; # block_size
1436 dnl ZLIB block descriptor:
1437 i64 0x194; # uncompressed_ofs
1438 i64 0x1ac; # compressed_ofs
1439 88; # uncompressed_size
1440 89; # compressed_size
1443 m4_divert_pop([PREPARE_TESTS])
1445 AT_SETUP([zcompressed data])
1446 AT_KEYWORDS([sack synthetic system file positive zlib])
1447 zcompressed_sack > sys-file.sack
1448 for variant in be le; do
1449 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1450 AT_DATA([sys-file.sps], [dnl
1451 GET FILE='sys-file.sav'.
1455 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1456 AT_CHECK([cat pspp.csv], [0], [dnl
1458 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1459 num1,1,Scale,Input,8,Right,F8.0,F8.0
1460 num2,2,Scale,Input,8,Right,F8.0,F8.0
1461 str4,3,Nominal,Input,4,Left,A4,A4
1462 str8,4,Nominal,Input,8,Left,A8,A8
1463 str15,5,Nominal,Input,15,Left,A15,A15
1466 num1,num2,str4,str8,str15
1467 -99,0,,abcdefgh,0123
1468 .,151,jklm,nopqrstu,vwxyzABC
1469 1,2,DEFG,HIJKLMNO,PQRSTUV
1474 AT_BANNER([system file reader - negative])
1476 AT_SETUP([no variables])
1477 AT_KEYWORDS([sack synthetic system file negative])
1478 AT_DATA([sys-file.sack], [dnl
1480 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1482 0; dnl Nominal case size (empty)
1483 0; dnl Not compressed
1487 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1490 dnl Character encoding record.
1491 7; 20; 1; 12; "windows-1252";
1493 dnl Dictionary termination record.
1496 for variant in be le; do
1497 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1498 AT_DATA([sys-file.sps], [dnl
1499 GET FILE='sys-file.sav'.
1501 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1502 sys-file.sps:1: error: GET: `sys-file.sav': Data file dictionary has no variables.
1505 dnl At one point pspp-convert would hang forever if there were no variables,
1506 dnl so check against regression.
1507 AT_CHECK([pspp-convert sys-file.sav sys-file.txt])
1508 AT_CHECK([cat sys-file.txt], [0], [
1513 AT_SETUP([unspecified character encoding])
1514 AT_KEYWORDS([sack synthetic system file positive])
1515 AT_DATA([sys-file.sack], [dnl
1517 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1519 4; dnl Nominal case size
1520 0; dnl Not compressed
1524 "01 Jan 11"; "20:53:52";
1525 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1528 dnl Numeric variables.
1529 2; 0; 0; 0; 0x050800 *2; s8 "A";
1530 2; 0; 0; 0; 0x050800 *2; s8 "B";
1531 2; 0; 0; 0; 0x050800 *2; s8 "C";
1532 2; 0; 0; 0; 0x050800 *2; s8 "D";
1534 dnl Dictionary termination record.
1537 for variant in be le; do
1538 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1539 AT_DATA([sys-file.sps], [dnl
1542 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [stdout])
1543 AT_CHECK([sed 's/default encoding.*For/default encoding. For/' stdout], [0], [dnl
1544 "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."
1549 AT_SETUP([misplaced type 4 record])
1550 AT_KEYWORDS([sack synthetic system file negative])
1551 AT_DATA([sys-file.sack], [dnl
1553 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1554 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1556 dnl Numeric variable.
1557 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1562 for variant in be le; do
1563 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1564 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1566 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1567 [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1572 AT_SETUP([bad record type])
1573 AT_KEYWORDS([sack synthetic system file negative])
1574 AT_DATA([sys-file.sack], [dnl
1576 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1577 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1579 dnl Numeric variable.
1580 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1582 dnl Type 8 record (not a valid type).
1585 for variant in be le; do
1586 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1587 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1589 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1590 [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1595 AT_SETUP([wrong number of variable positions])
1596 AT_KEYWORDS([sack synthetic system file negative])
1597 AT_DATA([sys-file.sack], [dnl
1599 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1600 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1602 dnl Numeric variable.
1603 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1605 dnl Character encoding record.
1606 7; 20; 1; 12; "windows-1252";
1608 dnl End of dictionary.
1611 for variant in be le; do
1612 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1613 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1615 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1616 [warning: `sys-file.sav': File header claims 2 variable positions but 1 were read from file.
1621 AT_SETUP([variable name may not begin with `#'])
1622 AT_KEYWORDS([sack synthetic system file negative])
1623 AT_DATA([sys-file.sack], [dnl
1625 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1626 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1628 dnl Numeric variable.
1629 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1631 dnl Character encoding record.
1632 7; 20; 1; 12; "windows-1252";
1634 dnl End of dictionary.
1637 for variant in be le; do
1638 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1639 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1641 AT_CHECK([pspp -O format=csv sys-file.sps], 0,
1642 [warning: `sys-file.sav' near offset 0xb4: Renaming variable with invalid name `$UM1' to `VAR001'.
1647 AT_SETUP([variable name may not be reserved word])
1648 AT_KEYWORDS([sack synthetic system file negative])
1649 AT_DATA([sys-file.sack], [dnl
1651 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1652 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1654 dnl Numeric variable.
1655 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1657 dnl Character encoding record.
1658 7; 20; 1; 12; "windows-1252";
1660 dnl End of dictionary.
1663 for variant in be le; do
1664 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1665 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1667 AT_CHECK([pspp -O format=csv sys-file.sps], 0,
1668 [warning: `sys-file.sav' near offset 0xb4: Renaming variable with invalid name `TO' to `VAR001'.
1673 AT_SETUP([variable width must be between 0 and 255])
1674 AT_KEYWORDS([sack synthetic system file negative])
1675 AT_DATA([sys-file.sack], [dnl
1677 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1678 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1680 dnl String variable with invalid width 256.
1681 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1683 dnl Character encoding record.
1684 7; 20; 1; 12; "windows-1252";
1686 dnl End of dictionary.
1689 for variant in be le; do
1690 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1691 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1693 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1694 [error: `sys-file.sav' near offset 0xb4: Bad width 256 for variable VAR1.
1699 dnl SPSS-generated system file can contain duplicate variable names
1700 dnl (see bug #41475).
1701 AT_SETUP([duplicate variable name])
1702 AT_KEYWORDS([sack synthetic system file negative])
1703 AT_DATA([sys-file.sack], [dnl
1705 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1706 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1708 dnl Numeric variables.
1709 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1710 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1712 dnl Character encoding record.
1713 7; 20; 1; 12; "windows-1252";
1715 dnl End of dictionary.
1718 for variant in be le; do
1719 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1720 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1723 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1724 [warning: `sys-file.sav' near offset 0xd4: Renaming variable with duplicate name `VAR1' to `VAR001'.
1727 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1728 var1,1,Scale,Input,8,Right,F8.0,F8.0
1729 var001,2,Scale,Input,8,Right,F8.0,F8.0
1734 AT_SETUP([variable label indicator not 0 or 1])
1735 AT_KEYWORDS([sack synthetic system file negative])
1736 AT_DATA([sys-file.sack], [dnl
1738 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1739 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1741 dnl Numeric variable.
1742 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1744 dnl Character encoding record.
1745 7; 20; 1; 12; "windows-1252";
1747 dnl End of dictionary.
1750 for variant in be le; do
1751 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1752 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1754 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1755 [error: `sys-file.sav' near offset 0xb4: Variable label indicator field is not 0 or 1.
1760 AT_SETUP([invalid numeric missing value indicator])
1761 AT_KEYWORDS([sack synthetic system file negative])
1762 AT_DATA([sys-file.sack], [dnl
1764 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1765 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1767 dnl Numeric variable.
1768 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1770 dnl Character encoding record.
1771 7; 20; 1; 12; "windows-1252";
1773 dnl End of dictionary.
1776 for variant in be le; do
1777 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1778 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1780 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1781 ["error: `sys-file.sav' near offset 0xb4: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1786 AT_SETUP([invalid string missing value indicator])
1787 AT_KEYWORDS([sack synthetic system file negative])
1788 AT_DATA([sys-file.sack], [dnl
1790 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1791 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1793 dnl String variable.
1794 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1796 dnl Character encoding record.
1797 7; 20; 1; 12; "windows-1252";
1799 dnl End of dictionary.
1802 for variant in be le; do
1803 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1804 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1806 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1807 ["error: `sys-file.sav' near offset 0xb4: String missing value indicator field is not 0, 1, 2, or 3."
1812 AT_SETUP([missing string continuation record])
1813 AT_KEYWORDS([sack synthetic system file negative])
1814 AT_DATA([sys-file.sack], [dnl
1816 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1817 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1819 dnl String variable.
1820 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1821 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
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: Missing string continuation record.
1839 AT_SETUP([invalid variable format])
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; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1846 dnl Numeric variable, invalid format types.
1847 dnl No warning is issued for type 0 because it has been observed in real
1849 2; 0; 0; 0; >>0xff0800; 0<<; s8 "NUM1";
1851 dnl Numeric variable, string formats.
1852 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
1854 dnl String variable, numeric formats.
1855 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
1857 dnl String variable, wrong width formats.
1858 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
1860 dnl Character encoding record.
1861 7; 20; 1; 12; "windows-1252";
1863 dnl End of dictionary.
1866 for variant in be le; do
1867 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1868 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1870 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1871 warning: `sys-file.sav' near offset 0xc0: Variable NUM1 with width 0 has invalid print format 0xff0800.
1873 warning: `sys-file.sav' near offset 0xe0: Variable VAR1 with width 0 has invalid print format 0x10800.
1875 warning: `sys-file.sav' near offset 0xe4: Variable VAR1 with width 0 has invalid write format 0x21000.
1877 warning: `sys-file.sav' near offset 0x100: Variable STR1 with width 4 has invalid print format 0x50800.
1879 warning: `sys-file.sav' near offset 0x104: Variable STR1 with width 4 has invalid write format 0x110a01.
1881 warning: `sys-file.sav' near offset 0x120: Variable STR2 with width 4 has invalid print format 0x10800.
1883 warning: `sys-file.sav' near offset 0x124: Variable STR2 with width 4 has invalid write format 0x20400.
1888 AT_SETUP([invalid long string missing values])
1889 AT_KEYWORDS([sack synthetic system file negative])
1890 AT_DATA([sys-file.sack], [dnl
1892 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1894 7; dnl Nominal case size
1895 0; dnl Not compressed
1899 "01 Jan 11"; "20:53:52";
1900 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1903 dnl One numeric variable.
1904 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1906 dnl Long string variables that will have missing values added with a
1908 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
1909 2; -1; 0; 0; 0; 0; s8 "";
1910 2; 10; 0; 0; 0x010a00 *2; s8 "STR2";
1911 2; -1; 0; 0; 0; 0; s8 "";
1912 2; 11; 0; 0; 0x010b00 *2; s8 "STR3";
1913 2; -1; 0; 0; 0; 0; s8 "";
1915 dnl Machine integer info record.
1916 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1918 dnl Machine floating-point info record.
1919 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
1921 dnl Long string variable missing values record.
1923 dnl Zero missing values (not allowed) for STR1 .
1924 COUNT("STR1"); i8 >>0<<;
1926 dnl Four missing values (not allowed) for STR2.
1927 COUNT("STR2"); i8 4;
1928 8; "abcdefgh"; 8; "ijklmnop"; 8; "qrstuvwx"; 8; "yz012345";
1930 dnl Missing values for unknown variable
1931 COUNT(>>"Nonexistent"<<); i8 1; 8; "abcdefgh";
1933 dnl Missing values for numeric variable
1934 COUNT(>>"NUM1"<<); i8 1; 8; "abcdefgh";
1936 dnl Too long missing value
1937 COUNT("STR3"); i8 1; >>COUNT("abcdefghijkl")<<;
1940 dnl Character encoding record.
1941 7; 20; 1; 12; "windows-1252";
1943 dnl Dictionary termination record.
1945 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
1946 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
1947 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
1950 for variant in be le; do
1951 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1952 AT_DATA([sys-file.sps], [dnl
1953 GET FILE='sys-file.sav'.
1956 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1957 ["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."
1959 "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."
1961 warning: `sys-file.sav' near offset 0x242: Ignoring long string missing value record for unknown variable Nonexistent.
1963 warning: `sys-file.sav' near offset 0x257: Ignoring long string missing value record for numeric variable NUM1.
1965 "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."
1968 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
1969 num1,1,Scale,Input,8,Right,F8.0,F8.0,
1970 str1,2,Nominal,Input,9,Left,A9,A9,
1971 str2,3,Nominal,Input,10,Left,A10,A10,"""abcdefgh""; ""ijklmnop""; ""qrstuvwx"""
1972 str3,4,Nominal,Input,11,Left,A11,A11,
1977 AT_SETUP([weighting variable must be numeric])
1978 AT_KEYWORDS([sack synthetic system file negative])
1979 AT_DATA([sys-file.sack], [dnl
1981 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1982 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1984 dnl Numeric variable.
1985 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1987 dnl String variable.
1988 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
1990 dnl Character encoding record.
1991 7; 20; 1; 12; "windows-1252";
1993 dnl End of dictionary.
1996 for variant in be le; do
1997 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1998 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2001 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2002 [warning: `sys-file.sav' near offset 0x4c: Ignoring string variable `STR1' set as weighting variable.
2005 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
2006 num1,1,Scale,Input,8,Right,F8.0,F8.0
2007 str1,2,Nominal,Input,4,Left,A4,A4
2012 AT_SETUP([bad weighting variable index])
2013 AT_KEYWORDS([sack synthetic system file negative])
2014 AT_DATA([sys-file.sack], [dnl
2016 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2017 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2019 dnl Numeric variable.
2020 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2022 dnl String variable.
2023 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2025 dnl Character encoding record.
2026 7; 20; 1; 12; "windows-1252";
2028 dnl End of dictionary.
2031 for variant in be le; do
2032 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2033 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2035 AT_CHECK([pspp -O format=csv sys-file.sps], 0,
2036 [warning: `sys-file.sav' near offset 0x4c: Weight variable index 3 not in valid range 1...2. Treating file as unweighted.
2041 AT_SETUP([variable index is long string continuation])
2042 AT_KEYWORDS([sack synthetic system file negative])
2043 AT_DATA([sys-file.sack], [dnl
2045 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2046 2; 3; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2048 dnl Numeric variable.
2049 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2051 dnl Long string variable.
2052 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2053 (2; -1; 0; 0; 0; 0; s8 "");
2055 dnl Character encoding record.
2056 7; 20; 1; 12; "windows-1252";
2058 dnl End of dictionary.
2061 for variant in be le; do
2062 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2063 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2065 AT_CHECK([pspp -O format=csv sys-file.sps], 0,
2066 [warning: `sys-file.sav' near offset 0x4c: Weight variable index 3 refers to long string continuation. Treating file as unweighted.
2071 AT_SETUP([multiple documents records])
2072 AT_KEYWORDS([sack synthetic system file negative])
2073 AT_DATA([sys-file.sack], [dnl
2075 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2076 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2078 dnl Numeric variables, no label or missing values.
2079 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2080 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
2082 dnl Two document records.
2083 (6; 1; s80 "One line of documents") >>* 2<<;
2085 dnl Character encoding record.
2086 7; 20; 1; 12; "windows-1252";
2088 dnl Dictionary termination record.
2094 for variant in be le; do
2095 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2096 AT_DATA([sys-file.sps], [dnl
2097 GET FILE='sys-file.sav'.
2099 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
2100 warning: `sys-file.sav' near offset 0x14c: Duplicate type 6 (document) record.
2106 AT_SETUP([extension record too large])
2107 AT_KEYWORDS([sack synthetic system file negative])
2108 AT_DATA([sys-file.sack], [dnl
2110 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2111 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2113 dnl Numeric variable, no label or missing values.
2114 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2116 dnl Too-large extension record.
2117 7; 3; >>0xfffff000 * 2<<;
2119 for variant in be le; do
2120 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2121 AT_DATA([sys-file.sps], [dnl
2122 GET FILE='sys-file.sav'.
2124 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2125 error: `sys-file.sav' near offset 0xd8: Record type 7 subtype 3 too large.
2130 AT_SETUP([unknown extension record])
2131 AT_KEYWORDS([sack synthetic system file negative])
2132 AT_DATA([sys-file.sack], [dnl
2134 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2135 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2137 dnl Numeric variable, no label or missing values.
2138 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2140 dnl Unknown extension record type.
2143 dnl Character encoding record.
2144 7; 20; 1; 12; "windows-1252";
2146 dnl End of dictionary.
2149 for variant in be le; do
2150 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2151 AT_DATA([sys-file.sps], [dnl
2152 GET FILE='sys-file.sav'.
2154 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2155 "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}."
2160 AT_SETUP([bad machine integer info size])
2161 AT_KEYWORDS([sack synthetic system file negative])
2162 AT_DATA([sys-file.sack], [dnl
2164 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2165 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2167 dnl Numeric variable, no label or missing values.
2168 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2170 dnl Machine integer info record.
2171 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252; >>1234<<;
2173 dnl Character encoding record.
2174 7; 20; 1; 12; "windows-1252";
2176 dnl End of dictionary.
2179 for variant in be le; do
2180 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2181 AT_DATA([sys-file.sps], [dnl
2182 GET FILE='sys-file.sav'.
2184 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2185 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 3 has bad count 9 (expected 8)."
2190 AT_SETUP([bad machine integer info float format])
2191 AT_KEYWORDS([sack synthetic system file negative])
2192 AT_DATA([sys-file.sack], [dnl
2194 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2195 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2197 dnl Numeric variable, no label or missing values.
2198 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2200 dnl Machine integer info record.
2201 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
2203 dnl Character encoding record.
2204 7; 20; 1; 12; "windows-1252";
2206 dnl End of dictionary.
2209 for variant in be le; do
2210 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2211 AT_DATA([sys-file.sps], [dnl
2212 GET FILE='sys-file.sav'.
2214 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2215 error: `sys-file.sav' near offset 0xd8: Floating-point representation indicated by system file (2) differs from expected (1).
2220 AT_SETUP([bad machine integer info endianness])
2221 AT_KEYWORDS([sack synthetic system file negative])
2222 AT_DATA([sys-file.sack], [dnl
2224 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2225 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2227 dnl Numeric variable, no label or missing values.
2228 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2230 dnl Machine integer info record.
2231 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
2233 dnl Character encoding record.
2234 7; 20; 1; 12; "windows-1252";
2236 dnl End of dictionary.
2239 for variant in "be 1" "le 2"; do
2241 AT_CHECK([sack --$[1] sys-file.sack > sys-file.sav])
2242 AT_DATA([sys-file.sps], [dnl
2243 GET FILE='sys-file.sav'.
2246 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2247 warning: \`sys-file.sav' near offset 0xd8: Integer format indicated by system file (3) differs from expected ($[2]).
2250 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
2251 num1,1,Scale,Input,8,Right,F8.0,F8.0
2257 AT_SETUP([bad machine floating-point info size])
2258 AT_KEYWORDS([sack synthetic system file negative])
2259 AT_DATA([sys-file.sack], [dnl
2261 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2262 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2264 dnl Numeric variable, no label or missing values.
2265 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2267 dnl Machine floating-point info record.
2268 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2270 dnl Character encoding record.
2271 7; 20; 1; 12; "windows-1252";
2273 dnl End of dictionary.
2276 for variant in be le; do
2277 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2278 AT_DATA([sys-file.sps], [dnl
2279 GET FILE='sys-file.sav'.
2281 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2282 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 4 has bad count 4 (expected 3)."
2287 AT_SETUP([wrong special floating point values])
2288 AT_KEYWORDS([sack synthetic system file negative])
2289 AT_DATA([sys-file.sack], [dnl
2291 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2292 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2294 dnl Numeric variable, no label or missing values.
2295 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2297 dnl Machine floating-point info record.
2298 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2300 dnl Character encoding record.
2301 7; 20; 1; 12; "windows-1252";
2303 dnl End of dictionary.
2306 for variant in be le; do
2307 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2308 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2310 AT_CHECK([pspp -O format=csv sys-file.sps | sed 's/ [(].*/.../'], [0], [dnl
2311 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 0...
2313 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 1...
2315 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 2...
2320 AT_SETUP([bad mrsets name])
2321 AT_KEYWORDS([sack synthetic system file negative multiple response])
2322 AT_DATA([sys-file.sack], [dnl
2324 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2326 16; dnl Nominal case size
2327 0; dnl Not compressed
2331 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2335 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2336 2; 0; 0; 0; 0x050800 *2; s8 "B";
2337 2; 0; 0; 0; 0x050800 *2; s8 "C";
2340 2; 0; 0; 0; 0x050800 *2; s8 "D";
2341 2; 0; 0; 0; 0x050800 *2; s8 "E";
2342 2; 0; 0; 0; 0x050800 *2; s8 "F";
2343 2; 0; 0; 0; 0x050800 *2; s8 "G";
2346 2; 4; 0; 0; 0x010400 *2; s8 "H";
2347 2; 4; 0; 0; 0x010400 *2; s8 "I";
2348 2; 4; 0; 0; 0x010400 *2; s8 "J";
2351 2; 0; 0; 0; 0x050800 *2; s8 "K";
2352 2; 0; 0; 0; 0x050800 *2; s8 "L";
2353 2; 0; 0; 0; 0x050800 *2; s8 "M";
2356 2; 6; 0; 0; 0x010600 *2; s8 "N";
2357 2; 6; 0; 0; 0x010600 *2; s8 "O";
2358 2; 6; 0; 0; 0x010600 *2; s8 "P";
2360 dnl Machine integer info record.
2361 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2365 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
2366 "b=D2 55 0 g e f d"; i8 10;
2367 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
2371 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
2372 "e=E 11 6 choice 0 n o p"; i8 10);
2374 dnl Character encoding record.
2375 7; 20; 1; 9; "shift_jis";
2377 dnl Dictionary termination record.
2380 for variant in be le; do
2381 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2382 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2383 MRSETS /DISPLAY NAME=ALL.
2385 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2386 warning: `sys-file.sav': Invalid multiple response set name `b'.
2388 warning: `sys-file.sav': Invalid multiple response set name `e'.
2390 Table: Multiple Response Sets
2391 Name,Label,Encoding,Counted Value,Member Variables
2392 $a,my mcgroup,Categories,,"あ
2395 $c,mdgroup #2,Dichotomies,はい,"h
2398 $d,third mdgroup,Dichotomies,34,"k
2405 AT_SETUP([missing space after C in mrsets])
2406 AT_KEYWORDS([sack synthetic system file negative multiple response])
2407 AT_DATA([sys-file.sack], [dnl
2409 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2410 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2412 dnl Numeric variable, no label or missing values.
2413 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2415 dnl Multiple response sets.
2416 7; 7; 1; COUNT("$a=Cx");
2418 dnl Character encoding record.
2419 7; 20; 1; 12; "windows-1252";
2423 for variant in be le; do
2424 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2425 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2427 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2428 warning: `sys-file.sav' near offset 0xd8: Missing space following `C' at offset 4 in MRSETS record.
2433 AT_SETUP([missing space after E in mrsets])
2434 AT_KEYWORDS([sack synthetic system file negative multiple response])
2435 AT_DATA([sys-file.sack], [dnl
2437 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2438 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2440 dnl Numeric variable, no label or missing values.
2441 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2443 dnl Multiple response sets.
2444 7; 7; 1; COUNT("$a=Ex");
2446 dnl Character encoding record.
2447 7; 20; 1; 12; "windows-1252";
2451 for variant in be le; do
2452 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2453 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2455 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2456 warning: `sys-file.sav' near offset 0xd8: Missing space following `E' at offset 4 in MRSETS record.
2461 AT_SETUP([missing label source in mrsets])
2462 AT_KEYWORDS([sack synthetic system file negative multiple response])
2463 AT_DATA([sys-file.sack], [dnl
2465 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2466 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2468 dnl Numeric variable, no label or missing values.
2469 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2471 dnl Multiple response sets.
2472 7; 7; 1; COUNT("$a=E ");
2474 dnl Character encoding record.
2475 7; 20; 1; 12; "windows-1252";
2479 for variant in be le; do
2480 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2481 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2483 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2484 warning: `sys-file.sav' near offset 0xd8: Missing label source value following `E' at offset 5 in MRSETS record.
2486 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 5 in MRSETS record.
2491 AT_SETUP([unexpected label source in mrsets])
2492 AT_KEYWORDS([sack synthetic system file negative multiple response])
2493 AT_DATA([sys-file.sack], [dnl
2495 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2496 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2498 dnl Numeric variable, no label or missing values.
2499 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2501 dnl Multiple response sets.
2502 7; 7; 1; COUNT("$a=E 2");
2504 dnl Character encoding record.
2505 7; 20; 1; 12; "windows-1252";
2509 for variant in be le; do
2510 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2511 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2513 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2514 warning: `sys-file.sav' near offset 0xd8: Unexpected label source value following `E' at offset 7 in MRSETS record.
2516 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 7 in MRSETS record.
2521 AT_SETUP([bad type character in mrsets])
2522 AT_KEYWORDS([sack synthetic system file negative multiple response])
2523 AT_DATA([sys-file.sack], [dnl
2525 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2526 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2528 dnl Numeric variable, no label or missing values.
2529 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2531 dnl Multiple response sets.
2532 7; 7; 1; COUNT("$a=");
2534 dnl Character encoding record.
2535 7; 20; 1; 12; "windows-1252";
2539 for variant in be le; do
2540 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2541 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2543 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2544 "warning: `sys-file.sav' near offset 0xd8: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2549 AT_SETUP([bad counted string length in mrsets])
2550 AT_KEYWORDS([sack synthetic system file negative multiple response])
2551 AT_DATA([sys-file.sack], [dnl
2553 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2554 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2556 dnl Numeric variable, no label or missing values.
2557 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2559 dnl Multiple response sets.
2560 7; 7; 1; COUNT("$a=Dx");
2562 dnl Character encoding record.
2563 7; 20; 1; 12; "windows-1252";
2567 for variant in be le; do
2568 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2569 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2571 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2572 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 4 in MRSETS record.
2577 AT_SETUP([missing space in counted string in mrsets])
2578 AT_KEYWORDS([sack synthetic system file negative multiple response])
2579 AT_DATA([sys-file.sack], [dnl
2581 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2582 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2584 dnl Numeric variable, no label or missing values.
2585 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2587 dnl Multiple response sets.
2588 7; 7; 1; COUNT("$a=D1x");
2590 dnl Character encoding record.
2591 7; 20; 1; 12; "windows-1252";
2595 for variant in be le; do
2596 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2597 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2599 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2600 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 5 in MRSETS record.
2605 AT_SETUP([counted string too long in mrsets])
2606 AT_KEYWORDS([sack synthetic system file negative multiple response])
2607 AT_DATA([sys-file.sack], [dnl
2609 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2610 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2612 dnl Numeric variable, no label or missing values.
2613 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2615 dnl Multiple response sets.
2616 7; 7; 1; COUNT("$a=D4 abc");
2618 dnl Character encoding record.
2619 7; 20; 1; 12; "windows-1252";
2623 for variant in be le; do
2624 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2625 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2627 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2628 warning: `sys-file.sav' near offset 0xd8: 4-byte string starting at offset 6 exceeds record length 9.
2633 AT_SETUP([missing space after counted string in mrsets])
2634 AT_KEYWORDS([sack synthetic system file negative multiple response])
2635 AT_DATA([sys-file.sack], [dnl
2637 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2638 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2640 dnl Numeric variable, no label or missing values.
2641 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2643 dnl Multiple response sets.
2644 7; 7; 1; COUNT("$a=D3 abcx");
2646 dnl Character encoding record.
2647 7; 20; 1; 12; "windows-1252";
2651 for variant in be le; do
2652 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2653 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2655 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2656 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 9 following 3-byte string.
2661 AT_SETUP([missing newline after variable name in mrsets])
2662 AT_KEYWORDS([sack synthetic system file negative multiple response])
2663 AT_DATA([sys-file.sack], [dnl
2665 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2666 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2668 dnl Numeric variable, no label or missing values.
2669 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2671 dnl Multiple response sets.
2672 7; 7; 1; COUNT("$a=C 0 NUM1");
2674 dnl Character encoding record.
2675 7; 20; 1; 12; "windows-1252";
2679 for variant in be le; do
2680 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2681 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2683 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2684 warning: `sys-file.sav' near offset 0xd8: Missing new-line parsing variable names at offset 13 in MRSETS record.
2686 warning: `sys-file.sav': MRSET $a has only one variable.
2691 AT_SETUP([duplicate variable name in mrsets])
2692 AT_KEYWORDS([sack synthetic system file negative multiple response])
2693 AT_DATA([sys-file.sack], [dnl
2695 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2696 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2698 dnl Numeric variable, no label or missing values.
2699 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2701 dnl Multiple response sets.
2702 7; 7; 1; COUNT("$a=C 0 NUM1 NUM1"; i8 10);
2704 dnl Character encoding record.
2705 7; 20; 1; 12; "windows-1252";
2709 for variant in be le; do
2710 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2711 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2713 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2714 warning: `sys-file.sav': MRSET $a contains duplicate variable name NUM1.
2716 warning: `sys-file.sav': MRSET $a has only one variable.
2721 AT_SETUP([mixed variable types in mrsets])
2722 AT_KEYWORDS([sack synthetic system file negative multiple response])
2723 AT_DATA([sys-file.sack], [dnl
2725 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2726 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2729 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2730 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2732 dnl Multiple response sets.
2733 7; 7; 1; COUNT("$a=C 0 NUM1 STR1"; i8 10);
2735 dnl Character encoding record.
2736 7; 20; 1; 12; "windows-1252";
2740 for variant in be le; do
2741 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2742 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2744 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2745 warning: `sys-file.sav': MRSET $a contains both string and numeric variables.
2747 warning: `sys-file.sav': MRSET $a has only one variable.
2752 AT_SETUP([missing newline after variable name in mrsets])
2753 AT_KEYWORDS([sack synthetic system file negative multiple response])
2754 AT_DATA([sys-file.sack], [dnl
2756 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2757 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2759 dnl Numeric variable, no label or missing values.
2760 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2762 dnl Multiple response sets.
2763 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10);
2765 dnl Character encoding record.
2766 7; 20; 1; 12; "windows-1252";
2770 for variant in be le; do
2771 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2772 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2774 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2775 warning: `sys-file.sav': MRSET $a has only one variable.
2780 AT_SETUP([zero or one variable in mrset])
2781 AT_KEYWORDS([sack synthetic system file negative multiple response])
2782 AT_DATA([sys-file.sack], [dnl
2784 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2785 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2787 dnl Numeric variable, no label or missing values.
2788 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2790 dnl Multiple response sets.
2791 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10; "$b=C 0 "; i8 10);
2793 dnl Character encoding record.
2794 7; 20; 1; 12; "windows-1252";
2798 for variant in be le; do
2799 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2800 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2802 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2803 warning: `sys-file.sav': MRSET $a has only one variable.
2805 warning: `sys-file.sav': MRSET $b has no variables.
2810 AT_SETUP([wrong display parameter size])
2811 AT_KEYWORDS([sack synthetic system file negative])
2812 AT_DATA([sys-file.sack], [dnl
2814 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2815 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2817 dnl Numeric variable, no label or missing values.
2818 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2820 dnl Display parameters record.
2821 7; 11; >>8<<; 2; 1.0; 1.0;
2823 dnl Character encoding record.
2824 7; 20; 1; 12; "windows-1252";
2826 dnl End of dictionary.
2829 for variant in be le; do
2830 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2831 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2833 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2834 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 11 has bad size 8 (expected 4)."
2839 AT_SETUP([wrong display parameter count])
2840 AT_KEYWORDS([sack synthetic system file negative])
2841 AT_DATA([sys-file.sack], [dnl
2843 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2844 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2846 dnl Numeric variable, no label or missing values.
2847 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2849 dnl Display parameters record.
2850 7; 11; 4; >>4<<; 1; 1; 2; 2;
2852 dnl Character encoding record.
2853 7; 20; 1; 12; "windows-1252";
2855 dnl End of dictionary.
2858 for variant in be le; do
2859 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2860 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2862 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2863 warning: `sys-file.sav' near offset 0xd8: Extension 11 has bad count 4 (for 1 variables).
2868 AT_SETUP([wrong display measurement level])
2869 AT_KEYWORDS([sack synthetic system file negative])
2870 AT_DATA([sys-file.sack], [dnl
2872 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2873 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2875 dnl Numeric variable, no label or missing values.
2876 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2878 dnl Display parameters record.
2879 7; 11; 4; 2; >>4<<; 0;
2881 dnl Character encoding record.
2882 7; 20; 1; 12; "windows-1252";
2884 dnl End of dictionary.
2887 for variant in be le; do
2888 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2889 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2891 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2892 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
2897 AT_SETUP([wrong display alignment])
2898 AT_KEYWORDS([sack synthetic system file negative])
2899 AT_DATA([sys-file.sack], [dnl
2901 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2902 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2904 dnl Numeric variable, no label or missing values.
2905 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2907 dnl Display parameters record.
2908 7; 11; 4; 2; 1; >>-1<<;
2910 dnl Character encoding record.
2911 7; 20; 1; 12; "windows-1252";
2913 dnl End of dictionary.
2916 for variant in be le; do
2917 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2918 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2920 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2921 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
2926 AT_SETUP([bad variable name in variable/value pair])
2927 AT_KEYWORDS([sack synthetic system file negative])
2928 AT_DATA([sys-file.sack], [dnl
2930 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2931 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2933 dnl Numeric variables.
2934 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2936 dnl Long variable names.
2937 7; 13; 1; COUNT (>>"xyzzy"<<);
2939 dnl Character encoding record.
2940 7; 20; 1; 12; "windows-1252";
2942 dnl Dictionary termination record.
2945 for variant in be le; do
2946 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2947 AT_DATA([sys-file.sps], [dnl
2948 GET FILE='sys-file.sav'.
2950 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2951 warning: `sys-file.sav' near offset 0xde: Dictionary record refers to unknown variable xyzzy.
2956 AT_SETUP([duplicate long variable name])
2957 AT_KEYWORDS([sack synthetic system file negative])
2958 AT_DATA([sys-file.sack], [dnl
2960 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2961 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2963 dnl Numeric variables.
2964 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2965 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
2966 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
2967 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
2969 dnl Long variable names.
2971 "LONGVARI=_Invalid"; i8 9;
2972 "LONGVARI=$Invalid"; i8 9;
2973 "LONGVARI=#Invalid"; i8 9;
2974 "LONGVA_A=LongVariableName"; i8 9;
2975 "LONGVA_B=LONGVARIABLENAME"; i8 9;
2978 dnl Character encoding record.
2979 7; 20; 1; 12; "windows-1252";
2981 dnl Dictionary termination record.
2984 for variant in be le; do
2985 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2986 AT_DATA([sys-file.sps], [dnl
2987 GET FILE='sys-file.sav'.
2989 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2990 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
2992 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `$Invalid'.
2994 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `#Invalid'.
2996 warning: `sys-file.sav' near offset 0x138: Duplicate long variable name `LONGVARIABLENAME'.
3001 AT_SETUP([bad very long string length])
3002 AT_KEYWORDS([sack synthetic system file negative])
3003 AT_DATA([sys-file.sack], [dnl
3005 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3006 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3008 dnl Numeric variable.
3009 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3011 dnl Very long string map.
3013 "NUM1=00000"; i8 0; i8 9;
3014 "NUM1=00255"; i8 0; i8 9;
3015 "NUM1=00256"; i8 0; i8 9;
3018 dnl Character encoding record.
3019 7; 20; 1; 12; "windows-1252";
3021 dnl Dictionary termination record.
3024 for variant in be le; do
3025 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3026 AT_DATA([sys-file.sps], [dnl
3027 GET FILE='sys-file.sav'.
3029 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3030 warning: `sys-file.sav' near offset 0xd8: NUM1 listed as string of invalid length 00000 in very long string record.
3032 "warning: `sys-file.sav' near offset 0xd8: NUM1 listed in very long string record with width 00255, which requires only one segment."
3034 error: `sys-file.sav' near offset 0xd8: Very long string NUM1 overflows dictionary.
3039 AT_SETUP([bad very long string segment width])
3040 AT_KEYWORDS([sack synthetic system file negative])
3041 AT_DATA([sys-file.sack], [dnl
3043 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3044 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3047 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
3048 (2; -1; 0; 0; 0; 0; s8 "") * 31;
3049 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
3050 >>2; -1; 0; 0; 0; 0; s8 "";<<
3052 dnl Very long string map.
3054 "STR1=00256"; i8 0; i8 9;
3057 dnl Character encoding record.
3058 7; 20; 1; 12; "windows-1252";
3060 dnl Dictionary termination record.
3063 for variant in be le; do
3064 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3065 AT_DATA([sys-file.sps], [dnl
3066 GET FILE='sys-file.sav'.
3068 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3069 error: `sys-file.sav' near offset 0x4f8: Very long string with width 256 has segment 1 of width 9 (expected 4).
3074 AT_SETUP([too many value labels])
3075 AT_KEYWORDS([sack synthetic system file negative])
3076 AT_DATA([sys-file.sack], [dnl
3078 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3079 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3081 dnl Numeric variable.
3082 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3085 for variant in be le; do
3086 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3087 AT_DATA([sys-file.sps], [dnl
3088 GET FILE='sys-file.sav'.
3090 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3091 error: `sys-file.sav' near offset 0xd4: Invalid number of labels 2147483647.
3096 AT_SETUP([missing type 4 record])
3097 AT_KEYWORDS([sack synthetic system file negative])
3098 AT_DATA([sys-file.sack], [dnl
3100 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3101 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3103 dnl Numeric variable.
3104 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3106 dnl Value label with missing type 4 record.
3107 3; 1; 1.0; i8 3; s7 "one";
3109 dnl Character encoding record.
3110 7; 20; 1; 12; "windows-1252";
3112 dnl End of dictionary.
3115 for variant in be le; do
3116 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3117 AT_DATA([sys-file.sps], [dnl
3118 GET FILE='sys-file.sav'.
3120 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3121 error: `sys-file.sav' near offset 0xe8: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
3126 AT_SETUP([value label with no associated variables])
3127 AT_KEYWORDS([sack synthetic system file negative])
3128 AT_DATA([sys-file.sack], [dnl
3130 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3131 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3133 dnl Numeric variable.
3134 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3136 dnl Value label with no variables.
3137 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
3139 for variant in be le; do
3140 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3141 AT_DATA([sys-file.sps], [dnl
3142 GET FILE='sys-file.sav'.
3144 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3145 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).
3150 AT_SETUP([type 4 record names long string variable])
3151 AT_KEYWORDS([sack synthetic system file negative])
3152 AT_DATA([sys-file.sack], [dnl
3154 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3155 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3157 dnl Long string variable.
3158 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3159 2; -1; 0; 0; 0; 0; s8 "";
3161 dnl Value label that names long string variable.
3162 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
3164 dnl Character encoding record.
3165 7; 20; 1; 12; "windows-1252";
3167 dnl End of dictionary.
3170 for variant in be le; do
3171 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3172 AT_DATA([sys-file.sps], [dnl
3173 GET FILE='sys-file.sav'.
3175 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
3176 warning: `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.
3181 AT_SETUP([value label variable indexes must be in correct range])
3182 AT_KEYWORDS([sack synthetic system file negative])
3183 AT_DATA([sys-file.sack], [dnl
3185 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3186 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3189 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3190 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3192 dnl Value labels with bad variable indexes.
3193 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>3; 4;<<
3194 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>5; 6;<<
3195 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>7; 8;<<
3197 dnl Character encoding record.
3198 7; 20; 1; 12; "windows-1252";
3200 dnl End of dictionary.
3203 for variant in be le; do
3204 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3205 AT_DATA([sys-file.sps], [dnl
3206 GET FILE='sys-file.sav'.
3208 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
3209 warning: `sys-file.sav' near offset 0xf4: Value label variable index 3 not in valid range 1...2.
3211 warning: `sys-file.sav' near offset 0xf4: Value label variable index 4 not in valid range 1...2.
3213 warning: `sys-file.sav' near offset 0x11c: Value label variable index 5 not in valid range 1...2.
3215 warning: `sys-file.sav' near offset 0x11c: Value label variable index 6 not in valid range 1...2.
3217 warning: `sys-file.sav' near offset 0x144: Value label variable index 7 not in valid range 1...2.
3219 warning: `sys-file.sav': Suppressed 1 additional warnings for value labels.
3224 AT_SETUP([value label variable indexes must not be long string continuation])
3225 AT_KEYWORDS([sack synthetic system file negative])
3226 AT_DATA([sys-file.sack], [dnl
3228 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3229 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3231 dnl Long string variable.
3232 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3233 (2; -1; 0; 0; 0; 0; s8 "");
3235 dnl Value label with long string indexes.
3236 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>2;<<
3238 dnl Character encoding record.
3239 7; 20; 1; 12; "windows-1252";
3241 dnl End of dictionary.
3244 for variant in be le; do
3245 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3246 AT_DATA([sys-file.sps], [dnl
3247 GET FILE='sys-file.sav'.
3249 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
3250 warning: `sys-file.sav' near offset 0xf4: Value label variable index 2 refers to long string continuation.
3255 AT_SETUP([variables for value label must all be same type])
3256 AT_KEYWORDS([sack synthetic system file negative])
3257 AT_DATA([sys-file.sack], [dnl
3259 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3260 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3263 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3264 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3266 dnl Value label that names numeric and string variables.
3267 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
3269 dnl Character encoding record.
3270 7; 20; 1; 12; "windows-1252";
3272 dnl End of dictionary.
3275 for variant in be le; do
3276 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3277 AT_DATA([sys-file.sps], [dnl
3278 GET FILE='sys-file.sav'.
3280 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
3281 "warning: `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."
3286 AT_SETUP([duplicate value labels type])
3287 AT_KEYWORDS([sack synthetic system file negative])
3288 AT_DATA([sys-file.sack], [dnl
3290 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3291 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3294 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3295 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3297 dnl Duplicate value labels.
3298 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
3299 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
3301 dnl Character encoding record.
3302 7; 20; 1; 12; "windows-1252";
3304 dnl End of dictionary.
3307 for variant in be le; do
3308 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3309 AT_DATA([sys-file.sps], [dnl
3310 GET FILE='sys-file.sav'.
3312 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3313 warning: `sys-file.sav' near offset 0xf4: Duplicate value label for `xyzzy ' on STR1.
3315 warning: `sys-file.sav' near offset 0x11c: Duplicate value label for 1 on NUM1.
3320 AT_SETUP([missing attribute value])
3321 AT_KEYWORDS([sack synthetic system file negative])
3322 AT_DATA([sys-file.sack], [dnl
3324 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3325 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3328 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3330 dnl Data file attributes record.
3335 dnl Variable attributes record.
3341 dnl Character encoding record.
3342 7; 20; 1; 12; "windows-1252";
3344 dnl Dictionary termination record.
3347 for variant in be le; do
3348 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3349 AT_DATA([sys-file.sps], [dnl
3350 GET FILE='sys-file.sav'.
3352 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3353 warning: `sys-file.sav' near offset 0xde: Error parsing attribute value Attr1[[1]].
3355 warning: `sys-file.sav' near offset 0x101: Error parsing attribute value fred[[2]].
3360 AT_SETUP([unquoted attribute value])
3361 AT_KEYWORDS([sack synthetic system file negative])
3362 AT_DATA([sys-file.sack], [dnl
3364 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3365 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3368 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3370 dnl Data file attributes record.
3372 "Attr1(value"; i8 10;
3376 dnl Variable attributes record.
3379 "fred(23"; i8 10; ")"
3382 dnl Character encoding record.
3383 7; 20; 1; 12; "windows-1252";
3385 dnl Dictionary termination record.
3388 for variant in be le; do
3389 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3390 AT_DATA([sys-file.sps], [dnl
3391 GET FILE='sys-file.sav'.
3393 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3394 warning: `sys-file.sav' near offset 0xe4: Attribute value Attr1[[1]] is not quoted: value.
3396 warning: `sys-file.sav' near offset 0x106: Attribute value fred[[1]] is not quoted: 23.
3401 AT_SETUP([duplicate attribute name])
3402 AT_KEYWORDS([sack synthetic system file negative])
3403 AT_DATA([sys-file.sack], [dnl
3405 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3406 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3409 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3411 dnl Data file attributes record.
3413 "Attr1('value'"; i8 10; ")";
3414 "Attr1('value'"; i8 10; ")";
3417 dnl Variable attributes record.
3420 "fred('23'"; i8 10; ")";
3421 "fred('23'"; i8 10; ")";
3424 dnl Character encoding record.
3425 7; 20; 1; 12; "windows-1252";
3427 dnl Dictionary termination record.
3430 for variant in be le; do
3431 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3432 AT_DATA([sys-file.sps], [dnl
3433 GET FILE='sys-file.sav'.
3435 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3436 warning: `sys-file.sav' near offset 0xf6: Duplicate attribute Attr1.
3438 warning: `sys-file.sav' near offset 0x125: Duplicate attribute fred.
3443 AT_SETUP([bad variable name in long string value label])
3444 AT_KEYWORDS([sack synthetic system file negative])
3445 AT_DATA([sys-file.sack], [dnl
3447 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3448 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3451 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3452 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3453 2; -1; 0; 0; 0; 0; s8 "";
3456 dnl No variable named STR9.
3457 COUNT(>>"STR9"<<); 9;
3458 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3460 dnl NUM1 is numeric.
3461 COUNT(>>"NUM1"<<); 0;
3462 1; COUNT("xyz"); COUNT("value label for 1.0");
3464 dnl Wrong width for STR14.
3465 COUNT("STR14"); >>9<<;
3466 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3468 dnl Wrong width for value.
3470 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3472 dnl Duplicate value label.
3473 COUNT("STR14"); 14; 2;
3474 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3475 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3478 dnl Character encoding record.
3479 7; 20; 1; 12; "windows-1252";
3481 dnl Dictionary termination record.
3484 for variant in be le; do
3485 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3486 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3488 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3489 warning: `sys-file.sav' near offset 0x128: Ignoring long string value label record for unknown variable STR9.
3491 warning: `sys-file.sav' near offset 0x164: Ignoring long string value label record for numeric variable NUM1.
3493 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).
3495 "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."
3497 warning: `sys-file.sav' near offset 0x259: Duplicate value label for `abcdefghijklmn' on str14.
3502 AT_SETUP([fewer data records than indicated by file header])
3503 AT_KEYWORDS([sack synthetic system file negative])
3504 AT_DATA([sys-file.sack], [dnl
3506 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3507 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3509 dnl Numeric variables.
3510 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3511 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3513 dnl Character encoding record.
3514 7; 20; 1; 12; "windows-1252";
3522 dnl Missing record here.
3524 for variant in be le; do
3525 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3526 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3529 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3530 [error: Error reading case from file `sys-file.sav'.
3542 AT_SETUP([partial data record between variables])
3543 AT_KEYWORDS([sack synthetic system file negative])
3544 AT_DATA([sys-file.sack], [dnl
3546 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3547 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3549 dnl Numeric variables.
3550 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3551 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3553 dnl Character encoding record.
3554 7; 20; 1; 12; "windows-1252";
3561 for variant in be le; do
3562 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3563 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3566 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3567 [error: `sys-file.sav' near offset 0x12c: File ends in partial case.
3576 AT_SETUP([partial data record within long string])
3577 AT_KEYWORDS([sack synthetic system file negative])
3578 AT_DATA([sys-file.sack], [dnl
3580 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3581 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3583 dnl Numeric variables.
3584 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3585 2; -1; 0; 0; 0; 0; s8 "";
3587 dnl Character encoding record.
3588 7; 20; 1; 12; "windows-1252";
3592 s14 "one data item";
3595 for variant in be le; do
3596 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3597 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3600 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3601 [error: `sys-file.sav' near offset 0x12a: Unexpected end of file.
3610 AT_SETUP([partial compressed data record])
3611 AT_KEYWORDS([sack synthetic system file positive])
3612 AT_DATA([sys-file.sack], [dnl
3614 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3616 6; dnl Nominal case size
3619 -1; dnl Unspecified number of cases.
3621 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3624 dnl Numeric variables.
3625 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3626 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3628 dnl String variable.
3629 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3630 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3631 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3632 2; -1; 0; 0; 0; 0; s8 "";
3634 dnl Character encoding record.
3635 7; 20; 1; 12; "windows-1252";
3637 dnl Dictionary termination record.
3640 dnl Compressed data.
3641 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3643 for variant in be le; do
3644 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3645 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3648 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3649 [error: `sys-file.sav' near offset 0x1ac: File ends in partial case.
3652 num1,num2,str4,str8,str15
3653 -99,0,,abcdefgh,0123
3658 AT_SETUP([zcompressed data - bad zheader_ofs])
3659 AT_KEYWORDS([sack synthetic system file negative zlib])
3660 zcompressed_sack | sed 's/.*zheader_ofs.*/>>i64 0<<;/' > sys-file.sack
3661 for variant in be le; do
3662 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3663 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3665 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).
3670 AT_SETUP([zcompressed data - bad ztrailer_ofs])
3671 AT_KEYWORDS([sack synthetic system file negative zlib])
3672 zcompressed_sack | sed 's/.*ztrailer_ofs.*/>>i64 0<<;/' > sys-file.sack
3673 for variant in be le; do
3674 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3675 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3677 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Impossible ZLIB trailer offset 0x0.
3682 # ztrailer_len must be a multiple of 24 and at least 48,
3683 # so a value of 12 is impossible.
3684 AT_SETUP([zcompressed data - invalid ztrailer_len])
3685 AT_KEYWORDS([sack synthetic system file negative zlib])
3686 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 12<<;/' > sys-file.sack
3687 for variant in be le; do
3688 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3689 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3691 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Invalid ZLIB trailer length 12.
3696 # ztrailer_ofs + ztrailer_len must be the file size.
3697 AT_SETUP([zcompressed data - wrong ztrailer_len])
3698 AT_KEYWORDS([sack synthetic system file negative zlib])
3699 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 72<<;/' > sys-file.sack
3700 for variant in be le; do
3701 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3702 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3704 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).
3705 error: `sys-file.sav' near offset 0x21d: 72-byte ZLIB trailer specifies 1 data blocks (expected 2).
3710 AT_SETUP([zcompressed data - wrong ztrailer_bias])
3711 AT_KEYWORDS([sack synthetic system file negative zlib])
3712 zcompressed_sack | sed 's/.*ztrailer_bias.*/>>i64 0<<;/' > sys-file.sack
3713 for variant in be le; do
3714 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3715 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3717 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).
3722 AT_SETUP([zcompressed data - wrong ztrailer_zero])
3723 AT_KEYWORDS([sack synthetic system file negative zlib])
3724 zcompressed_sack | sed 's/.*ztrailer_zero.*/>>i64 100<<;/' > sys-file.sack
3725 for variant in be le; do
3726 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3727 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3729 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x215: ZLIB trailer "zero" field has nonzero value 100.
3734 AT_SETUP([zcompressed data - wrong block_size])
3735 AT_KEYWORDS([sack synthetic system file negative zlib])
3736 zcompressed_sack | sed 's/.*block_size.*/>>0x1000<<;/' > sys-file.sack
3737 for variant in be le; do
3738 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3739 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3741 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.
3746 AT_SETUP([zcompressed data - wrong n_blocks])
3747 AT_KEYWORDS([sack synthetic system file negative zlib])
3748 zcompressed_sack | sed 's/.*n_blocks.*/>>2<<;/' > sys-file.sack
3749 for variant in be le; do
3750 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3751 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3753 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).
3758 AT_SETUP([zcompressed data - wrong uncompressed_ofs])
3759 AT_KEYWORDS([sack synthetic system file negative zlib])
3760 zcompressed_sack | sed 's/.*uncompressed_ofs.*/i64 >>0x177<<;/' > sys-file.sack
3761 for variant in be le; do
3762 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3763 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3765 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.
3770 AT_SETUP([zcompressed data - wrong compressed_ofs])
3771 AT_KEYWORDS([sack synthetic system file negative zlib])
3772 zcompressed_sack | sed 's/.*@%:@ compressed_ofs.*/i64 >>0x191<<;/' > sys-file.sack
3773 for variant in be le; do
3774 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3775 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3777 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.
3782 AT_SETUP([zcompressed data - compressed sizes don't add up])
3783 AT_KEYWORDS([sack synthetic system file negative zlib])
3784 AT_DATA([sys-file.sack], [dnl
3786 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3788 6; dnl Nominal case size
3789 2; dnl zlib compressed
3791 -1; dnl Unspecified number of cases.
3793 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3796 dnl Numeric variables.
3797 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3798 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3800 dnl String variable.
3801 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3802 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3803 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3804 2; -1; 0; 0; 0; 0; s8 "";
3806 dnl Character encoding record.
3807 7; 20; 1; 12; "windows-1252";
3809 dnl Dictionary termination record.
3812 dnl ZLIB data header.
3813 i64 0x194; # zheader_ofs
3814 i64 0x1ac; # ztrailer_ofs
3815 i64 72; # ztrailer_len
3817 dnl This is where the ZLIB data blocks would go, but we don't need any to
3818 dnl provoke this message so we omit them.
3820 dnl ZLIB data trailer fixed header:
3821 i64 -100; # ztrailer_bias
3822 i64 0; # ztrailer_zero
3823 0x3ff000; # block_size
3826 dnl ZLIB block descriptor 1:
3827 i64 0x194; # uncompressed_ofs
3828 i64 0x1ac; # compressed_ofs
3829 0x100000; # uncompressed_size
3830 0x12345; # compressed_size
3832 dnl ZLIB block descriptor 2:
3833 i64 0x100194; # uncompressed_ofs
3834 i64 0x12421; # compressed_ofs
3835 0x100000; # uncompressed_size
3836 0x12345; # compressed_size
3838 for variant in be le; do
3839 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3840 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3842 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.
3843 error: `sys-file.sav' near offset 0x1dc: ZLIB block descriptor 1 reported compressed data offset 0x12421, when 0x124f1 was expected.
3848 AT_SETUP([zcompressed data - uncompressed_size > block_size])
3849 AT_KEYWORDS([sack synthetic system file negative zlib])
3850 zcompressed_sack | sed 's/.*uncompressed_size.*/>>0x400000<<;/' > sys-file.sack
3851 for variant in be le; do
3852 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3853 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3855 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.
3860 AT_SETUP([zcompressed data - compression expands data too much])
3861 AT_KEYWORDS([sack synthetic system file negative zlib])
3862 zcompressed_sack | sed 's/.*uncompressed_size.*/>>50<<;/
3863 s/.*@%:@ compressed_size.*/>>100<<;/' > sys-file.sack
3864 for variant in be le; do
3865 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3866 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3868 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.
3873 AT_SETUP([zcompressed data - compressed sizes don't add up])
3874 AT_KEYWORDS([sack synthetic system file negative zlib])
3875 zcompressed_sack | sed 's/.*@%:@ compressed_size.*/>>88<<;/' > sys-file.sack
3876 for variant in be le; do
3877 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3878 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3880 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x235: ZLIB trailer is at offset 0x205 but 0x204 would be expected from block descriptors.
3886 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467004.
3887 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
3888 # See also https://security-tracker.debian.org/tracker/CVE-2017-10791.
3889 # Found by team OWL337, using the collAFL fuzzer.
3890 AT_SETUP([integer overflows in long string missing values])
3891 AT_KEYWORDS([system file negative])
3892 cp $top_srcdir/tests/data/CVE-2017-10791.sav .
3893 AT_CHECK([pspp-convert -O csv -e ASCII CVE-2017-10791.sav -], [0], [], [dnl
3894 `CVE-2017-10791.sav' near offset 0x217: Extension record subtype 21 ends unexpectedly.
3899 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467005.
3900 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
3901 # See also https://security-tracker.debian.org/tracker/CVE-2017-10792.
3902 # Reported by team OWL337, with fuzzer collAFL.
3903 AT_SETUP([null dereference skipping bad extension record 18])
3904 AT_KEYWORDS([system file negative])
3905 cp $top_srcdir/tests/data/CVE-2017-10792.sav .
3906 AT_CHECK([pspp-convert -O csv -e ASCII CVE-2017-10792.sav -], [0], [], [dnl
3907 `CVE-2017-10792.sav' near offset 0x1c0: Record type 7, subtype 18 has bad size 4 (expected 1).