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"; "01234567";
124 dnl Three missing values for STR9.
125 COUNT("STR10"); i8 3; 8; "abcdefgh"; "01234567"; "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,,Unknown,Input,8,Right,F8.0,F8.0,
156 num2,2,Numeric variable 2's label (ùúû),Unknown,Input,8,Right,F8.0,F8.0,
157 num3,3,,Unknown,Input,8,Right,F8.0,F8.0,1
158 num4,4,Another numeric variable label,Unknown,Input,8,Right,F8.0,F8.0,1
159 num5,5,,Unknown,Input,8,Right,F8.0,F8.0,1; 2
160 num6,6,,Unknown,Input,8,Right,F8.0,F8.0,1; 2; 3
161 num7,7,,Unknown,Input,8,Right,F8.0,F8.0,1 THRU 3
162 num8,8,,Unknown,Input,8,Right,F8.0,F8.0,1 THRU 3; 5
163 num9,9,,Unknown,Input,8,Right,F8.0,F8.0,1 THRU HIGHEST; -5
164 numàèìñò,10,,Unknown,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,,Unknown,Input,8,Right,F8.0,F8.0
226 num2,2,Numeric variable 2's label,Unknown,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,,Unknown,Input,8,Right,F8.0,F8.0
280 num2,2,Numeric variable 2's label,Unknown,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,Unknown,Input,8,Right,F8.0,F8.0
413 num2,2,Unknown,Input,8,Right,F8.0,F8.0
414 num3,3,Unknown,Input,8,Right,F8.0,F8.0
415 num4,4,Unknown,Input,8,Right,F8.0,F8.0
416 num5,5,Unknown,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([variable sets])
581 AT_KEYWORDS([sack synthetic system file positive set])
582 AT_DATA([sys-file.sack], [dnl
584 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
586 10; 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";
610 dnl Machine integer info record.
611 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
615 "Variable Set 1= "; i8 0x82; i8 0xa0; " b c"; i8 10;
616 "vs2=d e f g"; i8 10;
617 "c=h i j"; i8 13; i8 10;
618 "d= e g i b f"; i8 10;
619 "Empty Variable Set= "; i8 10);
621 dnl Character encoding record.
622 7; 20; 1; 9; "shift_jis";
624 dnl Dictionary termination record.
627 AT_DATA([expout], [dnl
629 ╭────┬────────┬────────────┬────────────╮
630 │Name│Position│Print Format│Write Format│
631 ├────┼────────┼────────────┼────────────┤
642 ╰────┴────────┴────────────┴────────────╯
645 ╭──────────────────────────┬────────╮
646 │Variable Set and Position │Variable│
647 ├──────────────────────────┼────────┤
648 │Variable Set 1 1 │あ │
651 ├──────────────────────────┼────────┤
656 ├──────────────────────────┼────────┤
660 ├──────────────────────────┼────────┤
666 ├──────────────────────────┼────────┤
667 │Empty Variable Set n/a │(empty) │
668 ╰──────────────────────────┴────────╯
670 AT_DATA([sys-file-1.sps], [dnl
671 GET FILE='sys-file.sav'.
673 DISPLAY VARIABLE SETS.
674 SAVE OUTFILE='sys-file-2.sav'.
676 AT_DATA([sys-file-2.sps], [dnl
677 GET FILE='sys-file-2.sav'.
679 DISPLAY VARIABLE SETS.
681 for variant in be le; do
682 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
683 AT_CHECK([rm -f sys-file-2.sav])
684 AT_CHECK([pspp --testing-mode -O box=unicode sys-file-1.sps], [0], [expout])
685 AT_CHECK([pspp --testing-mode -O box=unicode sys-file-2.sps], [0], [expout])
689 AT_SETUP([multiple response sets])
690 AT_KEYWORDS([sack synthetic system file positive])
691 AT_DATA([sys-file.sack], [dnl
693 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
695 16; dnl Nominal case size
696 0; dnl Not compressed
700 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
704 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
705 2; 0; 0; 0; 0x050800 *2; s8 "B";
706 2; 0; 0; 0; 0x050800 *2; s8 "C";
709 2; 0; 0; 0; 0x050800 *2; s8 "D";
710 2; 0; 0; 0; 0x050800 *2; s8 "E";
711 2; 0; 0; 0; 0x050800 *2; s8 "F";
712 2; 0; 0; 0; 0x050800 *2; s8 "G";
715 2; 4; 0; 0; 0x010400 *2; s8 "H";
716 2; 4; 0; 0; 0x010400 *2; s8 "I";
717 2; 4; 0; 0; 0x010400 *2; s8 "J";
720 2; 0; 0; 0; 0x050800 *2; s8 "K";
721 2; 0; 0; 0; 0x050800 *2; s8 "L";
722 2; 0; 0; 0; 0x050800 *2; s8 "M";
725 2; 6; 0; 0; 0x010600 *2; s8 "N";
726 2; 6; 0; 0; 0x010600 *2; s8 "O";
727 2; 6; 0; 0; 0x010600 *2; s8 "P";
729 dnl Machine integer info record.
730 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
734 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
735 "$b=D2 55 0 g e f d"; i8 10; i8 10;
736 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
741 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
742 "$e=E 11 6 choice 0 n o p"; i8 10; i8 10; i8 10; i8 10);
744 dnl Character encoding record.
745 7; 20; 1; 9; "shift_jis";
747 dnl Dictionary termination record.
750 for variant in be le; do
751 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
752 AT_DATA([sys-file.sps], [dnl
753 GET FILE='sys-file.sav'.
754 MRSETS /DISPLAY NAME=ALL.
756 AT_CHECK([pspp -o pspp.csv sys-file.sps])
757 AT_CHECK([cat pspp.csv], [0], [dnl
758 Table: Multiple Response Sets
759 Name,Label,Encoding,Counted Value,Member Variables
760 $a,my mcgroup,Categories,,"あ
763 $b,,Dichotomies,55,"g
767 $c,mdgroup #2,Dichotomies,はい,"h
770 $d,third mdgroup,Dichotomies,34,"k
773 $e,,Dichotomies,choice,"n
780 dnl Also checks for handling of CR-only line ends in file label and
781 dnl extra product info.
782 AT_SETUP([extra product info])
783 AT_KEYWORDS([sack synthetic system file positive])
784 AT_DATA([sys-file.sack], [dnl
786 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
788 4; dnl Nominal case size
789 0; dnl Not compressed
793 "01 Jan 11"; "20:53:52"; "PSPP synthetic"; i8 13; s49 "test file";
796 dnl Numeric variables.
797 2; 0; 0; 0; 0x050800 *2; s8 "A";
798 2; 0; 0; 0; 0x050800 *2; s8 "B";
799 2; 0; 0; 0; 0x050800 *2; s8 "C";
800 2; 0; 0; 0; 0x050800 *2; s8 "D";
802 dnl Extra product info.
803 7; 10; 1; COUNT ("Extra product info"; i8 13; "another line"; i8 13; "blah");
805 dnl Character encoding record.
806 7; 20; 1; 12; "windows-1252";
808 dnl Dictionary termination record.
811 for variant in be; do
812 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
813 AT_DATA([sys-file.sps], [dnl
814 SYSFILE INFO FILE='sys-file.sav'.
816 AT_CHECK([pspp -o pspp.csv sys-file.sps])
817 AT_CHECK([sed 8q pspp.csv], [0], [dnl
818 Table: File Information
820 Label,"PSPP synthetic
822 Created,01 Jan 11 20:53:52 by $(@%:@) SPSS DATA FILE PSPP synthetic test file
823 Product,"Extra product info
830 AT_SETUP([variable display parameters, without width])
831 AT_KEYWORDS([sack synthetic system file positive])
832 AT_DATA([sys-file.sack], [dnl
834 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
836 19; dnl Nominal case size
837 0; dnl Not compressed
841 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
844 dnl Numeric variables.
845 2; 0; 0; 0; 0x050800 *2; s8 "A";
846 2; 0; 0; 0; 0x050800 *2; s8 "B";
847 2; 0; 0; 0; 0x050800 *2; s8 "C";
848 2; 0; 0; 0; 0x050800 *2; s8 "D";
850 dnl Short string variables.
851 2; 3; 0; 0; 0x010300 *2; s8 "H";
852 2; 3; 0; 0; 0x010300 *2; s8 "I";
853 2; 3; 0; 0; 0x010300 *2; s8 "J";
854 2; 3; 0; 0; 0x010300 *2; s8 "K";
856 dnl Long string variables.
857 2; 9; 0; 0; 0x010900 *2; s8 "L";
858 2; -1; 0; 0; 0; 0; s8 "";
859 2; 10; 0; 0; 0x010a00 *2; s8 "M";
860 2; -1; 0; 0; 0; 0; s8 "";
861 2; 17; 0; 0; 0x011100 *2; s8 "N";
862 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
863 2; 25; 0; 0; 0x011900 *2; s8 "O";
864 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
866 dnl Variable display parameters
881 dnl Character encoding record.
882 7; 20; 1; 12; "windows-1252";
884 dnl Dictionary termination record.
887 for variant in be le; do
888 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
889 AT_DATA([sys-file.sps], [dnl
890 GET FILE='sys-file.sav'.
893 AT_CHECK([pspp -o pspp.csv sys-file.sps])
894 AT_CHECK([cat pspp.csv], [0], [dnl
896 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
897 a,1,Nominal,Input,8,Left,F8.0,F8.0
898 b,2,Ordinal,Input,8,Left,F8.0,F8.0
899 c,3,Scale,Input,8,Left,F8.0,F8.0
900 d,4,Nominal,Input,8,Right,F8.0,F8.0
901 h,5,Ordinal,Input,3,Right,A3,A3
902 i,6,Scale,Input,3,Right,A3,A3
903 j,7,Nominal,Input,3,Center,A3,A3
904 k,8,Ordinal,Input,3,Center,A3,A3
905 l,9,Scale,Input,9,Center,A9,A9
906 m,10,Nominal,Input,10,Left,A10,A10
907 n,11,Nominal,Input,17,Right,A17,A17
908 o,12,Nominal,Input,25,Center,A25,A25
913 AT_SETUP([variable display parameters, with width])
914 AT_KEYWORDS([sack synthetic system file positive])
915 AT_DATA([sys-file.sack], [dnl
917 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
919 19; dnl Nominal case size
920 0; dnl Not compressed
924 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
927 dnl Numeric variables.
928 2; 0; 0; 0; 0x050800 *2; s8 "A";
929 2; 0; 0; 0; 0x050800 *2; s8 "B";
930 2; 0; 0; 0; 0x050800 *2; s8 "C";
931 2; 0; 0; 0; 0x050800 *2; s8 "D";
933 dnl Short string variables.
934 2; 3; 0; 0; 0x010300 *2; s8 "H";
935 2; 3; 0; 0; 0x010300 *2; s8 "I";
936 2; 3; 0; 0; 0x010300 *2; s8 "J";
937 2; 3; 0; 0; 0x010300 *2; s8 "K";
939 dnl Long string variables.
940 2; 9; 0; 0; 0x010900 *2; s8 "L";
941 2; -1; 0; 0; 0; 0; s8 "";
942 2; 10; 0; 0; 0x010a00 *2; s8 "M";
943 2; -1; 0; 0; 0; 0; s8 "";
944 2; 17; 0; 0; 0x011100 *2; s8 "N";
945 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
946 2; 25; 0; 0; 0x011900 *2; s8 "O";
947 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
949 dnl Variable display parameters
964 dnl Character encoding record.
965 7; 20; 1; 12; "windows-1252";
967 dnl Dictionary termination record.
970 for variant in be le; do
971 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
972 AT_DATA([sys-file.sps], [dnl
973 GET FILE='sys-file.sav'.
976 AT_CHECK([pspp -o pspp.csv sys-file.sps])
977 AT_CHECK([cat pspp.csv], [0], [dnl
979 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
980 a,1,Nominal,Input,1,Left,F8.0,F8.0
981 b,2,Ordinal,Input,2,Left,F8.0,F8.0
982 c,3,Scale,Input,3,Left,F8.0,F8.0
983 d,4,Nominal,Input,4,Right,F8.0,F8.0
984 h,5,Ordinal,Input,5,Right,A3,A3
985 i,6,Scale,Input,6,Right,A3,A3
986 j,7,Nominal,Input,7,Center,A3,A3
987 k,8,Ordinal,Input,8,Center,A3,A3
988 l,9,Scale,Input,9,Center,A9,A9
989 m,10,Nominal,Input,10,Left,A10,A10
990 n,11,Nominal,Input,11,Right,A17,A17
991 o,12,Nominal,Input,12,Center,A25,A25
996 AT_SETUP([long variable names])
997 AT_KEYWORDS([sack synthetic system file positive])
998 AT_DATA([sys-file.sack], [dnl
1000 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1002 7; dnl Nominal case size
1003 0; dnl Not compressed
1007 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1010 dnl Numeric variables.
1011 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
1012 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
1013 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
1014 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
1015 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDINA";
1016 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_A";
1017 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_B";
1019 dnl Machine integer info record.
1020 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1022 dnl Machine floating-point info record.
1023 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
1025 dnl Long variable names.
1027 "LONGVARI=LongVariableName1"; i8 9;
1028 "LONGVA_A=LongVariableName2"; i8 9;
1029 "LONGVA_B=LongVariableName3"; i8 9;
1030 "LONGVA_C=LongVariableName4"; i8 9;
1031 "CO"; i8 214; "RDINA=Co"; i8 246; "rdinate_X"; i8 9;
1032 "CO"; i8 214; "RDI_A=Co"; i8 246; "rdinate_Y"; i8 9;
1033 "CO"; i8 214; "RDI_B=Co"; i8 246; "rdinate_Z";
1036 dnl Character encoding record.
1037 7; 20; 1; 12; "windows-1252";
1039 dnl Dictionary termination record.
1042 for variant in be le; do
1043 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1044 AT_DATA([sys-file.sps], [dnl
1045 GET FILE='sys-file.sav'.
1048 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1049 AT_CHECK([cat pspp.csv], [0], [dnl
1051 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1052 LongVariableName1,1,Unknown,Input,8,Right,F8.0,F8.0
1053 LongVariableName2,2,Unknown,Input,8,Right,F8.0,F8.0
1054 LongVariableName3,3,Unknown,Input,8,Right,F8.0,F8.0
1055 LongVariableName4,4,Unknown,Input,8,Right,F8.0,F8.0
1056 Coördinate_X,5,Unknown,Input,8,Right,F8.0,F8.0
1057 Coördinate_Y,6,Unknown,Input,8,Right,F8.0,F8.0
1058 Coördinate_Z,7,Unknown,Input,8,Right,F8.0,F8.0
1063 AT_SETUP([very long strings])
1064 AT_KEYWORDS([sack synthetic system file positive])
1065 AT_DATA([sys-file.sack], [dnl
1067 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1069 109; dnl Nominal case size
1070 0; dnl Not compressed
1074 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1077 dnl 256-byte string.
1078 2; 255; 0; 0; 0x01FF00 *2; "S"; i8 201; s6 "Q256";
1079 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1080 2; 4; 0; 0; 0x010400 *2; "S"; i8 201; "Q256_1";
1082 dnl 600-byte string.
1083 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600";
1084 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1085 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600_1";
1086 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1087 2; 96; 0; 0; 0x016000 *2; s8 "STR600_2";
1088 (2; -1; 0; 0; 0; 0; s8 "") * 11;
1090 dnl Machine integer info record.
1091 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1093 dnl Very long string record.
1095 "S"; i8 201; "Q256=00256"; i8 0; i8 9;
1096 "STR600=00600"; i8 0; i8 9;
1099 dnl Character encoding record.
1100 7; 20; 1; 12; "windows-1252";
1102 dnl Dictionary termination record.
1106 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 4;
1108 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 9;
1109 "abcdefghijklmnopqrstuvwxyzABCDEF";
1111 for variant in be le; do
1112 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1113 AT_DATA([sys-file.sps], [dnl
1114 GET FILE='sys-file.sav'.
1118 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1119 AT_CHECK([cat pspp.csv], [0], [dnl
1121 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1122 séq256,1,Nominal,Input,32,Left,A256,A256
1123 str600,2,Nominal,Input,32,Left,A600,A600
1127 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@a,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyz
1132 AT_SETUP([data file and variable attributes])
1133 AT_KEYWORDS([sack synthetic system file positive])
1134 AT_DATA([sys-file.sack], [dnl
1136 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1138 3; dnl Nominal case size
1139 0; dnl Not compressed
1143 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1147 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
1148 2; 0; 0; 0; 0x050800 *2; s8 "SECONDVA";
1149 2; 0; 0; 0; 0x050800 *2; s8 "THIRDVAR";
1151 dnl Machine integer info record.
1152 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1154 dnl Long variable names.
1156 "FIRSTVAR=FirstVariable"; i8 9;
1157 "SECONDVA=S"; i8 233; "condVariable"; i8 9;
1158 "THIRDVAR=ThirdVariable"; i8 9
1161 dnl Data file attributes record.
1163 "Attr1('Value1'"; i8 10; "''d"; i8 233; "claration''"; i8 10; ")";
1164 "S"; i8 233; "condAttr('123'"; i8 10; "'456'"; i8 10; ")";
1167 dnl Variable attributes record.
1170 "ad"; i8 232; "le('23'"; i8 10; "'34'"; i8 10; ")";
1171 "bert('123'"; i8 10; ")";
1172 "$@Role('1'"; i8 10; ")";
1173 "/S"; i8 233; "condVariable:";
1174 "xyzzy('quux'"; i8 10; ")";
1177 dnl Another variable attributes record.
1178 dnl Only system files written by "Stata 14.1/-savespss- 1.77 by S.Radyakin"
1179 dnl include multiple variable attributes records.
1180 7; 18; 1; COUNT ("ThirdVariable:fizz('buzz'"; i8 10; ")";);
1182 dnl Character encoding record.
1183 7; 20; 1; 12; "windows-1252";
1185 dnl Dictionary termination record.
1188 for variant in be le; do
1189 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1190 AT_DATA([sys-file.sps], [dnl
1191 GET FILE='sys-file.sav'.
1192 DISPLAY @ATTRIBUTES.
1194 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1195 AT_CHECK([cat pspp.csv], [0],
1196 [[Table: Variable and Dataset Attributes
1197 Variable and Name,,Value
1198 (dataset),Attr1[1],Value1
1199 ,Attr1[2],'déclaration'
1202 FirstVariable,$@Role,1
1206 SécondVariable,xyzzy,quux
1207 ThirdVariable,fizz,buzz
1209 AT_DATA([sys-file.sps], [dnl
1210 GET FILE='sys-file.sav'.
1213 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1214 AT_CHECK([cat pspp.csv], [0],
1216 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1217 FirstVariable,1,Unknown,Output,8,Right,F8.0,F8.0
1218 SécondVariable,2,Unknown,Input,8,Right,F8.0,F8.0
1219 ThirdVariable,3,Unknown,Input,8,Right,F8.0,F8.0
1224 AT_SETUP([variable roles])
1225 AT_KEYWORDS([sack synthetic system file positive])
1226 AT_DATA([sys-file.sack], [dnl
1228 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1230 7; dnl Nominal case size
1231 0; dnl Not compressed
1235 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1239 2; 0; 0; 0; 0x050800 *2; s8 "I";
1240 2; 0; 0; 0; 0x050800 *2; s8 "O";
1241 2; 0; 0; 0; 0x050800 *2; s8 "B";
1242 2; 0; 0; 0; 0x050800 *2; s8 "N";
1243 2; 0; 0; 0; 0x050800 *2; s8 "P";
1244 2; 0; 0; 0; 0x050800 *2; s8 "S";
1245 2; 0; 0; 0; 0x050800 *2; s8 "X";
1247 dnl Machine integer info record.
1248 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1250 dnl Variable attributes record.
1252 "I:$@Role('0'"; i8 10; ")";
1253 "/O:$@Role('1'"; i8 10; ")";
1254 "/B:$@Role('2'"; i8 10; ")";
1255 "/N:$@Role('3'"; i8 10; ")";
1256 "/P:$@Role('4'"; i8 10; ")";
1257 "/S:$@Role('5'"; i8 10; ")";
1258 "/X:$@Role('6'"; i8 10; ")";
1261 dnl Character encoding record.
1262 7; 20; 1; 12; "windows-1252";
1264 dnl Dictionary termination record.
1267 for variant in be le; do
1268 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1269 AT_DATA([sys-file.sps], [dnl
1270 GET FILE='sys-file.sav'.
1273 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [dnl
1274 warning: `sys-file.sav': Invalid role for variable x.
1276 AT_CHECK([cat pspp.csv], [0], [dnl
1277 warning: `sys-file.sav': Invalid role for variable x.
1280 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1281 i,1,Unknown,Input,8,Right,F8.0,F8.0
1282 o,2,Unknown,Output,8,Right,F8.0,F8.0
1283 b,3,Unknown,Both,8,Right,F8.0,F8.0
1284 n,4,Unknown,None,8,Right,F8.0,F8.0
1285 p,5,Unknown,Partition,8,Right,F8.0,F8.0
1286 s,6,Unknown,Split,8,Right,F8.0,F8.0
1287 x,7,Unknown,Input,8,Right,F8.0,F8.0
1292 AT_SETUP([compressed data])
1293 AT_KEYWORDS([sack synthetic system file positive])
1294 AT_DATA([sys-file.sack], [dnl
1296 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1298 6; dnl Nominal case size
1299 1; dnl Simple compression
1301 -1; dnl Unspecified number of cases.
1303 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1306 dnl Numeric variables.
1307 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1308 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1310 dnl String variable.
1311 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1312 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1313 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1314 2; -1; 0; 0; 0; 0; s8 "";
1316 dnl Character encoding record.
1317 7; 20; 1; 12; "windows-1252";
1319 dnl Dictionary termination record.
1322 dnl Compressed data.
1323 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1324 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1325 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1326 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1329 for variant in be le; do
1330 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1331 AT_DATA([sys-file.sps], [dnl
1332 GET FILE='sys-file.sav'.
1336 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1337 AT_CHECK([cat pspp.csv], [0], [dnl
1339 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1340 num1,1,Unknown,Input,8,Right,F8.0,F8.0
1341 num2,2,Unknown,Input,8,Right,F8.0,F8.0
1342 str4,3,Nominal,Input,4,Left,A4,A4
1343 str8,4,Nominal,Input,8,Left,A8,A8
1344 str15,5,Nominal,Input,15,Left,A15,A15
1347 num1,num2,str4,str8,str15
1348 -99,0,,abcdefgh,0123
1349 .,151,jklm,nopqrstu,vwxyzABC
1350 1,2,DEFG,HIJKLMNO,PQRSTUV
1355 AT_SETUP([compressed data, zero bias])
1356 AT_KEYWORDS([sack synthetic system file positive])
1357 AT_DATA([sys-file.sack], [dnl
1359 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1361 6; dnl Nominal case size
1362 1; dnl Simple compression.
1364 -1; dnl Unspecified number of cases.
1366 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1369 dnl Numeric variables.
1370 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1371 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1373 dnl String variable.
1374 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1375 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1376 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1377 2; -1; 0; 0; 0; 0; s8 "";
1379 dnl Character encoding record.
1380 7; 20; 1; 12; "windows-1252";
1382 dnl Dictionary termination record.
1385 dnl Compressed data.
1386 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1387 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1388 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1389 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1392 for variant in be le; do
1393 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1394 AT_DATA([sys-file.sps], [dnl
1395 GET FILE='sys-file.sav'.
1399 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1400 AT_CHECK([cat pspp.csv], [0], [dnl
1402 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1403 num1,1,Unknown,Input,8,Right,F8.0,F8.0
1404 num2,2,Unknown,Input,8,Right,F8.0,F8.0
1405 str4,3,Nominal,Input,4,Left,A4,A4
1406 str8,4,Nominal,Input,8,Left,A8,A8
1407 str15,5,Nominal,Input,15,Left,A15,A15
1410 num1,num2,str4,str8,str15
1411 1,100,,abcdefgh,0123
1412 .,251,jklm,nopqrstu,vwxyzABC
1413 101,102,DEFG,HIJKLMNO,PQRSTUV
1418 AT_SETUP([compressed data, other bias])
1419 AT_KEYWORDS([sack synthetic system file positive])
1420 AT_DATA([sys-file.sack], [dnl
1422 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1424 6; dnl Nominal case size
1425 1; dnl Simple compression.
1427 -1; dnl Unspecified number of cases.
1429 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1432 dnl Numeric variables.
1433 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1434 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1436 dnl String variable.
1437 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1438 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1439 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1440 2; -1; 0; 0; 0; 0; s8 "";
1442 dnl Character encoding record.
1443 7; 20; 1; 12; "windows-1252";
1445 dnl Dictionary termination record.
1448 dnl Compressed data.
1449 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1450 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1451 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1452 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1455 for variant in be le; do
1456 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1457 AT_DATA([sys-file.sps], [dnl
1458 GET FILE='sys-file.sav'.
1462 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0],
1463 [warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1465 AT_CHECK([cat pspp.csv], [0], [dnl
1466 "warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1469 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1470 num1,1,Unknown,Input,8,Right,F8.0,F8.0
1471 num2,2,Unknown,Input,8,Right,F8.0,F8.0
1472 str4,3,Nominal,Input,4,Left,A4,A4
1473 str8,4,Nominal,Input,8,Left,A8,A8
1474 str15,5,Nominal,Input,15,Left,A15,A15
1477 num1,num2,str4,str8,str15
1478 -49,50,,abcdefgh,0123
1479 .,201,jklm,nopqrstu,vwxyzABC
1480 51,52,DEFG,HIJKLMNO,PQRSTUV
1485 m4_divert_push([PREPARE_TESTS])
1486 zcompressed_sack () {
1489 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1491 6; dnl Nominal case size
1492 2; dnl zlib compressed
1494 -1; dnl Unspecified number of cases.
1496 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1499 dnl Numeric variables.
1500 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1501 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1503 dnl String variable.
1504 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1505 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1506 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1507 2; -1; 0; 0; 0; 0; s8 "";
1509 dnl Character encoding record.
1510 7; 20; 1; 12; "windows-1252";
1512 dnl Dictionary termination record.
1515 dnl ZLIB data header.
1516 i64 0x194; # zheader_ofs
1517 i64 0x205; # ztrailer_ofs
1518 i64 48; # ztrailer_len
1520 dnl ZLIB data block.
1522 dnl This is the compressed form of:
1524 dnl 01 64 fe fd fe fd ff fb 61 62 63 64 65 66 67 68 |.d......abcdefgh|
1525 dnl 30 31 32 33 20 20 20 20 fd fd fd fe 65 66 fd fd |0123 ....ef..|
1526 dnl 6a 6b 6c 6d 20 20 20 20 6e 6f 70 71 72 73 74 75 |jklm nopqrstu|
1527 dnl 76 77 78 79 7a 41 42 43 44 45 46 47 20 20 20 20 |vwxyzABCDEFG |
1528 dnl 48 49 4a 4b 4c 4d 4e 4f fe fd fc 00 00 00 00 00 |HIJKLMNO........|
1529 dnl 50 51 52 53 54 55 56 57 |PQRSTUVW|
1531 dnl which is the data from the "compressed data" test.
1532 hex "78 01 63 4c f9 f7 f7 df df ff bf 13 93 92 53 52";
1533 hex "d3 d2 33 0c 0c 8d 8c 15 80 e0 ef df bf ff 52 d3";
1534 hex "fe fe cd ca ce c9 05 f1 f3 f2 0b 0a 8b 8a 4b 4a";
1535 hex "cb ca 2b 2a ab 1c 9d 9c 5d 5c dd dc 41 e2 1e 9e";
1536 hex "5e de 3e be 7e fe ff fe fe 61 00 81 80 c0 a0 e0";
1537 hex "90 d0 b0 70 00 0f 3f 23 d7";
1539 dnl ZLIB data trailer fixed header:
1540 i64 -100; # ztrailer_bias
1541 i64 0; # ztrailer_zero
1542 0x3ff000; # block_size
1545 dnl ZLIB block descriptor:
1546 i64 0x194; # uncompressed_ofs
1547 i64 0x1ac; # compressed_ofs
1548 88; # uncompressed_size
1549 89; # compressed_size
1552 m4_divert_pop([PREPARE_TESTS])
1554 AT_SETUP([zcompressed data])
1555 AT_KEYWORDS([sack synthetic system file positive zlib])
1556 zcompressed_sack > sys-file.sack
1557 for variant in be le; do
1558 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1559 AT_DATA([sys-file.sps], [dnl
1560 GET FILE='sys-file.sav'.
1564 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1565 AT_CHECK([cat pspp.csv], [0], [dnl
1567 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1568 num1,1,Unknown,Input,8,Right,F8.0,F8.0
1569 num2,2,Unknown,Input,8,Right,F8.0,F8.0
1570 str4,3,Nominal,Input,4,Left,A4,A4
1571 str8,4,Nominal,Input,8,Left,A8,A8
1572 str15,5,Nominal,Input,15,Left,A15,A15
1575 num1,num2,str4,str8,str15
1576 -99,0,,abcdefgh,0123
1577 .,151,jklm,nopqrstu,vwxyzABC
1578 1,2,DEFG,HIJKLMNO,PQRSTUV
1583 AT_BANNER([system file reader - negative])
1585 AT_SETUP([no variables])
1586 AT_KEYWORDS([sack synthetic system file negative])
1587 AT_DATA([sys-file.sack], [dnl
1589 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1591 0; dnl Nominal case size (empty)
1592 0; dnl Not compressed
1596 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1599 dnl Character encoding record.
1600 7; 20; 1; 12; "windows-1252";
1602 dnl Dictionary termination record.
1605 for variant in be le; do
1606 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1607 AT_DATA([sys-file.sps], [dnl
1608 GET FILE='sys-file.sav'.
1610 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1611 sys-file.sps:1: error: GET: `sys-file.sav': Data file dictionary has no variables.
1614 dnl At one point pspp-convert would hang forever if there were no variables,
1615 dnl so check against regression.
1616 AT_CHECK([pspp-convert sys-file.sav sys-file.txt])
1617 AT_CHECK([cat sys-file.txt], [0], [
1622 AT_SETUP([unspecified character encoding])
1623 AT_KEYWORDS([sack synthetic system file positive])
1624 AT_DATA([sys-file.sack], [dnl
1626 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1628 4; dnl Nominal case size
1629 0; dnl Not compressed
1633 "01 Jan 11"; "20:53:52";
1634 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1637 dnl Numeric variables.
1638 2; 0; 0; 0; 0x050800 *2; s8 "A";
1639 2; 0; 0; 0; 0x050800 *2; s8 "B";
1640 2; 0; 0; 0; 0x050800 *2; s8 "C";
1641 2; 0; 0; 0; 0x050800 *2; s8 "D";
1643 dnl Dictionary termination record.
1646 for variant in be le; do
1647 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1648 AT_DATA([sys-file.sps], [dnl
1651 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [stdout])
1652 AT_CHECK([sed 's/default encoding.*For/default encoding. For/' stdout], [0], [dnl
1653 "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."
1658 AT_SETUP([misplaced type 4 record])
1659 AT_KEYWORDS([sack synthetic system file negative])
1660 AT_DATA([sys-file.sack], [dnl
1662 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1663 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1665 dnl Numeric variable.
1666 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1671 for variant in be le; do
1672 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1673 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1675 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1676 [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1681 AT_SETUP([bad record type])
1682 AT_KEYWORDS([sack synthetic system file negative])
1683 AT_DATA([sys-file.sack], [dnl
1685 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1686 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1688 dnl Numeric variable.
1689 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1691 dnl Type 8 record (not a valid type).
1694 for variant in be le; do
1695 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1696 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1698 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1699 [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1704 AT_SETUP([wrong number of variable positions])
1705 AT_KEYWORDS([sack synthetic system file negative])
1706 AT_DATA([sys-file.sack], [dnl
1708 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1709 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1711 dnl Numeric variable.
1712 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1714 dnl Character encoding record.
1715 7; 20; 1; 12; "windows-1252";
1717 dnl End of dictionary.
1720 for variant in be le; do
1721 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1722 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1724 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1725 [warning: `sys-file.sav': File header claims 2 variable positions but 1 were read from file.
1730 AT_SETUP([variable name may not begin with `#'])
1731 AT_KEYWORDS([sack synthetic system file negative])
1732 AT_DATA([sys-file.sack], [dnl
1734 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1735 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1737 dnl Numeric variable.
1738 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1740 dnl Character encoding record.
1741 7; 20; 1; 12; "windows-1252";
1743 dnl End of dictionary.
1746 for variant in be le; do
1747 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1748 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1750 AT_CHECK([pspp -O format=csv sys-file.sps], 0,
1751 [warning: `sys-file.sav' near offset 0xb4: Renaming variable with invalid or duplicate name `$UM1' to `UM1'.
1756 AT_SETUP([variable name may not be reserved word])
1757 AT_KEYWORDS([sack synthetic system file negative])
1758 AT_DATA([sys-file.sack], [dnl
1760 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1761 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1763 dnl Numeric variable.
1764 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1766 dnl Character encoding record.
1767 7; 20; 1; 12; "windows-1252";
1769 dnl End of dictionary.
1772 for variant in be le; do
1773 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1774 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1776 AT_CHECK([pspp -O format=csv sys-file.sps], 0,
1777 [warning: `sys-file.sav' near offset 0xb4: Renaming variable with invalid or duplicate name `TO' to `TO_A'.
1782 AT_SETUP([variable width must be between 0 and 255])
1783 AT_KEYWORDS([sack synthetic system file negative])
1784 AT_DATA([sys-file.sack], [dnl
1786 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1787 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1789 dnl String variable with invalid width 256.
1790 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1792 dnl Character encoding record.
1793 7; 20; 1; 12; "windows-1252";
1795 dnl End of dictionary.
1798 for variant in be le; do
1799 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1800 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1802 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1803 [error: `sys-file.sav' near offset 0xb4: Bad width 256 for variable VAR1.
1808 dnl SPSS-generated system file can contain duplicate variable names
1809 dnl (see bug #41475).
1810 AT_SETUP([duplicate variable name])
1811 AT_KEYWORDS([sack synthetic system file negative])
1812 AT_DATA([sys-file.sack], [dnl
1814 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1815 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1817 dnl Numeric variables.
1818 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1819 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1821 dnl Character encoding record.
1822 7; 20; 1; 12; "windows-1252";
1824 dnl End of dictionary.
1827 for variant in be le; do
1828 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1829 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1832 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1833 [warning: `sys-file.sav' near offset 0xd4: Renaming variable with invalid or duplicate name `VAR1' to `VAR1_A'.
1836 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
1837 var1,1,Unknown,Input,8,Right,F8.0,F8.0
1838 var1_a,2,Unknown,Input,8,Right,F8.0,F8.0
1843 AT_SETUP([variable label indicator not 0 or 1])
1844 AT_KEYWORDS([sack synthetic system file negative])
1845 AT_DATA([sys-file.sack], [dnl
1847 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1848 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1850 dnl Numeric variable.
1851 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1853 dnl Character encoding record.
1854 7; 20; 1; 12; "windows-1252";
1856 dnl End of dictionary.
1859 for variant in be le; do
1860 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1861 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1863 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1864 [error: `sys-file.sav' near offset 0xb4: Variable label indicator field is not 0 or 1.
1869 AT_SETUP([invalid numeric missing value indicator])
1870 AT_KEYWORDS([sack synthetic system file negative])
1871 AT_DATA([sys-file.sack], [dnl
1873 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1874 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1876 dnl Numeric variable.
1877 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1879 dnl Character encoding record.
1880 7; 20; 1; 12; "windows-1252";
1882 dnl End of dictionary.
1885 for variant in be le; do
1886 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1887 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1889 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1890 ["error: `sys-file.sav' near offset 0xb4: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1895 AT_SETUP([invalid string missing value indicator])
1896 AT_KEYWORDS([sack synthetic system file negative])
1897 AT_DATA([sys-file.sack], [dnl
1899 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1900 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1902 dnl String variable.
1903 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1905 dnl Character encoding record.
1906 7; 20; 1; 12; "windows-1252";
1908 dnl End of dictionary.
1911 for variant in be le; do
1912 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1913 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1915 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1916 ["error: `sys-file.sav' near offset 0xb4: String missing value indicator field is not 0, 1, 2, or 3."
1921 AT_SETUP([missing string continuation record])
1922 AT_KEYWORDS([sack synthetic system file negative])
1923 AT_DATA([sys-file.sack], [dnl
1925 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1926 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1928 dnl String variable.
1929 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1930 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
1932 dnl Character encoding record.
1933 7; 20; 1; 12; "windows-1252";
1935 dnl End of dictionary.
1938 for variant in be le; do
1939 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1940 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1942 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1943 [error: `sys-file.sav' near offset 0xb4: Missing string continuation record.
1948 AT_SETUP([invalid variable format])
1949 AT_KEYWORDS([sack synthetic system file negative])
1950 AT_DATA([sys-file.sack], [dnl
1952 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1953 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1955 dnl Numeric variable, invalid format types.
1956 dnl No warning is issued for type 0 because it has been observed in real
1958 2; 0; 0; 0; >>0xff0800; 0<<; s8 "NUM1";
1960 dnl Numeric variable, string formats.
1961 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
1963 dnl String variable, numeric formats.
1964 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
1966 dnl String variable, wrong width formats.
1967 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
1969 dnl Character encoding record.
1970 7; 20; 1; 12; "windows-1252";
1972 dnl End of dictionary.
1975 for variant in be le; do
1976 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1977 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1979 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1980 warning: `sys-file.sav' near offset 0xc0: Variable NUM1 with width 0 has invalid print format 0xff0800.
1982 warning: `sys-file.sav' near offset 0xe0: Variable VAR1 with width 0 has invalid print format 0x10800.
1984 warning: `sys-file.sav' near offset 0xe4: Variable VAR1 with width 0 has invalid write format 0x21000.
1986 warning: `sys-file.sav' near offset 0x100: Variable STR1 with width 4 has invalid print format 0x50800.
1988 warning: `sys-file.sav' near offset 0x104: Variable STR1 with width 4 has invalid write format 0x110a01.
1990 warning: `sys-file.sav' near offset 0x120: Variable STR2 with width 4 has invalid print format 0x10800.
1992 warning: `sys-file.sav' near offset 0x124: Variable STR2 with width 4 has invalid write format 0x20400.
1997 AT_SETUP([invalid long string missing values])
1998 AT_KEYWORDS([sack synthetic system file negative])
1999 AT_DATA([sys-file.sack], [dnl
2001 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2003 7; dnl Nominal case size
2004 0; dnl Not compressed
2008 "01 Jan 11"; "20:53:52";
2009 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
2012 dnl One numeric variable.
2013 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2015 dnl Long string variables that will have missing values added with a
2017 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2018 2; -1; 0; 0; 0; 0; s8 "";
2019 2; 10; 0; 0; 0x010a00 *2; s8 "STR2";
2020 2; -1; 0; 0; 0; 0; s8 "";
2021 2; 11; 0; 0; 0x010b00 *2; s8 "STR3";
2022 2; -1; 0; 0; 0; 0; s8 "";
2024 dnl Machine integer info record.
2025 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
2027 dnl Machine floating-point info record.
2028 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
2030 dnl Long string variable missing values record.
2032 dnl Zero missing values (not allowed) for STR1 .
2033 COUNT("STR1"); i8 >>0<<; 8;
2035 dnl Four missing values (not allowed) for STR2.
2036 COUNT("STR2"); i8 4; 8;
2037 "abcdefgh"; "ijklmnop"; "qrstuvwx"; "yz012345";
2039 dnl Missing values for unknown variable
2040 COUNT(>>"Nonexistent"<<); i8 1; 8; "abcdefgh";
2042 dnl Missing values for numeric variable
2043 COUNT(>>"NUM1"<<); i8 1; 8; "abcdefgh";
2045 dnl Too long missing value
2046 COUNT("STR3"); i8 1; >>COUNT("abcdefghijkl")<<;
2048 dnl Buggy way that this was written in old PSPP, with a length
2049 dnl before each missing value instead of just once.
2050 COUNT("STR3"); i8 2; 8; "ABCDEFGH"; >>8<<; "IJKLMNOP";
2053 dnl Character encoding record.
2054 7; 20; 1; 12; "windows-1252";
2056 dnl Dictionary termination record.
2058 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
2059 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
2060 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
2063 for variant in be le; do
2064 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2065 AT_DATA([sys-file.sps], [dnl
2066 GET FILE='sys-file.sav'.
2069 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2070 ["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."
2072 "warning: `sys-file.sav' near offset 0x205: Long string missing values record says variable STR2 has 4 missing values, but only 1 to 3 missing values are allowed."
2074 warning: `sys-file.sav' near offset 0x23a: Ignoring long string missing value record for unknown variable Nonexistent.
2076 warning: `sys-file.sav' near offset 0x24f: Ignoring long string missing value record for numeric variable NUM1.
2078 "warning: `sys-file.sav' near offset 0x268: Ignoring long string missing value 0 for variable str3, with width 11, that has bad value width 12."
2080 "warning: `sys-file.sav' near offset 0x289: This file has corrupted metadata written by a buggy version of PSPP. To fix it, save a new copy of the file."
2083 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
2084 num1,1,Unknown,Input,8,Right,F8.0,F8.0,
2085 str1,2,Nominal,Input,9,Left,A9,A9,
2086 str2,3,Nominal,Input,10,Left,A10,A10,"""abcdefgh""; ""ijklmnop""; ""qrstuvwx"""
2087 str3,4,Nominal,Input,11,Left,A11,A11,"""ABCDEFGH""; ""IJKLMNOP"""
2092 AT_SETUP([weighting variable must be numeric])
2093 AT_KEYWORDS([sack synthetic system file negative])
2094 AT_DATA([sys-file.sack], [dnl
2096 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2097 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2099 dnl Numeric variable.
2100 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2102 dnl String variable.
2103 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2105 dnl Character encoding record.
2106 7; 20; 1; 12; "windows-1252";
2108 dnl End of dictionary.
2111 for variant in be le; do
2112 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2113 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2116 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2117 [warning: `sys-file.sav' near offset 0x4c: Ignoring string variable `STR1' set as weighting variable.
2120 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
2121 num1,1,Unknown,Input,8,Right,F8.0,F8.0
2122 str1,2,Nominal,Input,4,Left,A4,A4
2127 AT_SETUP([bad weighting variable index])
2128 AT_KEYWORDS([sack synthetic system file negative])
2129 AT_DATA([sys-file.sack], [dnl
2131 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2132 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2134 dnl Numeric variable.
2135 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2137 dnl String variable.
2138 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2140 dnl Character encoding record.
2141 7; 20; 1; 12; "windows-1252";
2143 dnl End of dictionary.
2146 for variant in be le; do
2147 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2148 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2150 AT_CHECK([pspp -O format=csv sys-file.sps], 0,
2151 [warning: `sys-file.sav' near offset 0x4c: Weight variable index 3 not in valid range 1...2. Treating file as unweighted.
2156 AT_SETUP([variable index is long string continuation])
2157 AT_KEYWORDS([sack synthetic system file negative])
2158 AT_DATA([sys-file.sack], [dnl
2160 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2161 2; 3; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2163 dnl Numeric variable.
2164 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2166 dnl Long string variable.
2167 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2168 (2; -1; 0; 0; 0; 0; s8 "");
2170 dnl Character encoding record.
2171 7; 20; 1; 12; "windows-1252";
2173 dnl End of dictionary.
2176 for variant in be le; do
2177 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2178 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2180 AT_CHECK([pspp -O format=csv sys-file.sps], 0,
2181 [warning: `sys-file.sav' near offset 0x4c: Weight variable index 3 refers to long string continuation. Treating file as unweighted.
2186 AT_SETUP([multiple documents records])
2187 AT_KEYWORDS([sack synthetic system file negative])
2188 AT_DATA([sys-file.sack], [dnl
2190 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2191 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2193 dnl Numeric variables, no label or missing values.
2194 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2195 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
2197 dnl Two document records.
2198 (6; 1; s80 "One line of documents") >>* 2<<;
2200 dnl Character encoding record.
2201 7; 20; 1; 12; "windows-1252";
2203 dnl Dictionary termination record.
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], 0, [dnl
2215 warning: `sys-file.sav' near offset 0x14c: Duplicate type 6 (document) record.
2221 AT_SETUP([extension record too large])
2222 AT_KEYWORDS([sack synthetic system file negative])
2223 AT_DATA([sys-file.sack], [dnl
2225 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2226 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2228 dnl Numeric variable, no label or missing values.
2229 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2231 dnl Too-large extension record.
2232 7; 3; >>0xfffff000 * 2<<;
2234 for variant in be le; do
2235 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2236 AT_DATA([sys-file.sps], [dnl
2237 GET FILE='sys-file.sav'.
2239 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2240 error: `sys-file.sav' near offset 0xd8: Record type 7 subtype 3 too large.
2245 AT_SETUP([unknown extension record])
2246 AT_KEYWORDS([sack synthetic system file negative])
2247 AT_DATA([sys-file.sack], [dnl
2249 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2250 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2252 dnl Numeric variable, no label or missing values.
2253 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2255 dnl Unknown extension record type.
2258 dnl Character encoding record.
2259 7; 20; 1; 12; "windows-1252";
2261 dnl End of dictionary.
2264 for variant in be le; do
2265 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2266 AT_DATA([sys-file.sps], [dnl
2267 GET FILE='sys-file.sav'.
2269 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2270 "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}."
2275 AT_SETUP([bad machine integer info size])
2276 AT_KEYWORDS([sack synthetic system file negative])
2277 AT_DATA([sys-file.sack], [dnl
2279 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2280 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2282 dnl Numeric variable, no label or missing values.
2283 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2285 dnl Machine integer info record.
2286 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252; >>1234<<;
2288 dnl Character encoding record.
2289 7; 20; 1; 12; "windows-1252";
2291 dnl End of dictionary.
2294 for variant in be le; do
2295 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2296 AT_DATA([sys-file.sps], [dnl
2297 GET FILE='sys-file.sav'.
2299 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2300 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 3 has bad count 9 (expected 8)."
2305 AT_SETUP([bad machine integer info float format])
2306 AT_KEYWORDS([sack synthetic system file negative])
2307 AT_DATA([sys-file.sack], [dnl
2309 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2310 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2312 dnl Numeric variable, no label or missing values.
2313 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2315 dnl Machine integer info record.
2316 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
2318 dnl Character encoding record.
2319 7; 20; 1; 12; "windows-1252";
2321 dnl End of dictionary.
2324 for variant in be le; do
2325 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2326 AT_DATA([sys-file.sps], [dnl
2327 GET FILE='sys-file.sav'.
2329 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2330 error: `sys-file.sav' near offset 0xd8: Floating-point representation indicated by system file (2) differs from expected (1).
2335 AT_SETUP([bad machine integer info endianness])
2336 AT_KEYWORDS([sack synthetic system file negative])
2337 AT_DATA([sys-file.sack], [dnl
2339 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2340 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2342 dnl Numeric variable, no label or missing values.
2343 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2345 dnl Machine integer info record.
2346 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
2348 dnl Character encoding record.
2349 7; 20; 1; 12; "windows-1252";
2351 dnl End of dictionary.
2354 for variant in "be 1" "le 2"; do
2356 AT_CHECK([sack --$[1] sys-file.sack > sys-file.sav])
2357 AT_DATA([sys-file.sps], [dnl
2358 GET FILE='sys-file.sav'.
2361 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2362 warning: \`sys-file.sav' near offset 0xd8: Integer format indicated by system file (3) differs from expected ($[2]).
2365 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
2366 num1,1,Unknown,Input,8,Right,F8.0,F8.0
2372 AT_SETUP([bad machine floating-point info size])
2373 AT_KEYWORDS([sack synthetic system file negative])
2374 AT_DATA([sys-file.sack], [dnl
2376 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2377 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2379 dnl Numeric variable, no label or missing values.
2380 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2382 dnl Machine floating-point info record.
2383 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2385 dnl Character encoding record.
2386 7; 20; 1; 12; "windows-1252";
2388 dnl End of dictionary.
2391 for variant in be le; do
2392 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2393 AT_DATA([sys-file.sps], [dnl
2394 GET FILE='sys-file.sav'.
2396 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2397 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 4 has bad count 4 (expected 3)."
2402 AT_SETUP([wrong special floating point values])
2403 AT_KEYWORDS([sack synthetic system file negative])
2404 AT_DATA([sys-file.sack], [dnl
2406 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2407 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2409 dnl Numeric variable, no label or missing values.
2410 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2412 dnl Machine floating-point info record.
2413 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2415 dnl Character encoding record.
2416 7; 20; 1; 12; "windows-1252";
2418 dnl End of dictionary.
2421 for variant in be le; do
2422 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2423 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2425 AT_CHECK([pspp -O format=csv sys-file.sps | sed 's/ [(].*/.../'], [0], [dnl
2426 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 0...
2428 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 1...
2430 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 2...
2435 AT_SETUP([unknown variables in variable sets])
2436 AT_KEYWORDS([sack synthetic system file negative set])
2437 AT_DATA([sys-file.sack], [dnl
2439 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2441 10; dnl Nominal case size
2442 0; dnl Not compressed
2446 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2450 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2451 2; 0; 0; 0; 0x050800 *2; s8 "B";
2452 2; 0; 0; 0; 0x050800 *2; s8 "C";
2455 2; 0; 0; 0; 0x050800 *2; s8 "D";
2456 2; 0; 0; 0; 0x050800 *2; s8 "E";
2457 2; 0; 0; 0; 0x050800 *2; s8 "F";
2458 2; 0; 0; 0; 0x050800 *2; s8 "G";
2461 2; 4; 0; 0; 0x010400 *2; s8 "H";
2462 2; 4; 0; 0; 0x010400 *2; s8 "I";
2463 2; 4; 0; 0; 0x010400 *2; s8 "J";
2465 dnl Machine integer info record.
2466 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2470 "Variable Set 1= "; i8 0x82; i8 0xa0; " "; >>"xyzzy"<<; " b c"; i8 10;
2471 "vs2=d "; >>"foo"<<; " e f g"; i8 10;);
2473 dnl Character encoding record.
2474 7; 20; 1; 9; "shift_jis";
2476 dnl Dictionary termination record.
2479 for variant in be le; do
2480 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2481 AT_DATA([sys-file.sps], [dnl
2482 GET FILE='sys-file.sav'.
2484 DISPLAY VARIABLE SETS.
2486 AT_CHECK([pspp --testing-mode -O box=unicode sys-file.sps], [0], [dnl
2487 warning: `sys-file.sav' near offset 0x228: Variable set Variable Set 1 contains
2488 unknown variable xyzzy.
2490 warning: `sys-file.sav' near offset 0x228: Variable set vs2 contains unknown
2494 ╭────┬────────┬────────────┬────────────╮
2495 │Name│Position│Print Format│Write Format│
2496 ├────┼────────┼────────────┼────────────┤
2507 ╰────┴────────┴────────────┴────────────╯
2510 ╭──────────────────────────┬────────╮
2511 │Variable Set and Position │Variable│
2512 ├──────────────────────────┼────────┤
2513 │Variable Set 1 1 │あ │
2516 ├──────────────────────────┼────────┤
2521 ╰──────────────────────────┴────────╯
2526 AT_SETUP([bad mrsets name])
2527 AT_KEYWORDS([sack synthetic system file negative multiple response])
2528 AT_DATA([sys-file.sack], [dnl
2530 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2532 16; dnl Nominal case size
2533 0; dnl Not compressed
2537 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2541 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2542 2; 0; 0; 0; 0x050800 *2; s8 "B";
2543 2; 0; 0; 0; 0x050800 *2; s8 "C";
2546 2; 0; 0; 0; 0x050800 *2; s8 "D";
2547 2; 0; 0; 0; 0x050800 *2; s8 "E";
2548 2; 0; 0; 0; 0x050800 *2; s8 "F";
2549 2; 0; 0; 0; 0x050800 *2; s8 "G";
2552 2; 4; 0; 0; 0x010400 *2; s8 "H";
2553 2; 4; 0; 0; 0x010400 *2; s8 "I";
2554 2; 4; 0; 0; 0x010400 *2; s8 "J";
2557 2; 0; 0; 0; 0x050800 *2; s8 "K";
2558 2; 0; 0; 0; 0x050800 *2; s8 "L";
2559 2; 0; 0; 0; 0x050800 *2; s8 "M";
2562 2; 6; 0; 0; 0x010600 *2; s8 "N";
2563 2; 6; 0; 0; 0x010600 *2; s8 "O";
2564 2; 6; 0; 0; 0x010600 *2; s8 "P";
2566 dnl Machine integer info record.
2567 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2571 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
2572 "b=D2 55 0 g e f d"; i8 10;
2573 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
2577 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
2578 "e=E 11 6 choice 0 n o p"; i8 10);
2580 dnl Character encoding record.
2581 7; 20; 1; 9; "shift_jis";
2583 dnl Dictionary termination record.
2586 for variant in be le; do
2587 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2588 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2589 MRSETS /DISPLAY NAME=ALL.
2591 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2592 warning: `sys-file.sav': Invalid multiple response set name `b'.
2594 warning: `sys-file.sav': Invalid multiple response set name `e'.
2596 Table: Multiple Response Sets
2597 Name,Label,Encoding,Counted Value,Member Variables
2598 $a,my mcgroup,Categories,,"あ
2601 $c,mdgroup #2,Dichotomies,はい,"h
2604 $d,third mdgroup,Dichotomies,34,"k
2611 AT_SETUP([missing space after C in mrsets])
2612 AT_KEYWORDS([sack synthetic system file negative multiple response])
2613 AT_DATA([sys-file.sack], [dnl
2615 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2616 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2618 dnl Numeric variable, no label or missing values.
2619 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2621 dnl Multiple response sets.
2622 7; 7; 1; COUNT("$a=Cx");
2624 dnl Character encoding record.
2625 7; 20; 1; 12; "windows-1252";
2629 for variant in be le; do
2630 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2631 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2633 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2634 warning: `sys-file.sav' near offset 0xd8: Missing space following `C' at offset 4 in MRSETS record.
2639 AT_SETUP([missing space after E in mrsets])
2640 AT_KEYWORDS([sack synthetic system file negative multiple response])
2641 AT_DATA([sys-file.sack], [dnl
2643 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2644 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2646 dnl Numeric variable, no label or missing values.
2647 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2649 dnl Multiple response sets.
2650 7; 7; 1; COUNT("$a=Ex");
2652 dnl Character encoding record.
2653 7; 20; 1; 12; "windows-1252";
2657 for variant in be le; do
2658 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2659 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2661 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2662 warning: `sys-file.sav' near offset 0xd8: Missing space following `E' at offset 4 in MRSETS record.
2667 AT_SETUP([missing label source in mrsets])
2668 AT_KEYWORDS([sack synthetic system file negative multiple response])
2669 AT_DATA([sys-file.sack], [dnl
2671 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2672 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2674 dnl Numeric variable, no label or missing values.
2675 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2677 dnl Multiple response sets.
2678 7; 7; 1; COUNT("$a=E ");
2680 dnl Character encoding record.
2681 7; 20; 1; 12; "windows-1252";
2685 for variant in be le; do
2686 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2687 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2689 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2690 warning: `sys-file.sav' near offset 0xd8: Missing label source value following `E' at offset 5 in MRSETS record.
2692 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 5 in MRSETS record.
2697 AT_SETUP([unexpected label source in mrsets])
2698 AT_KEYWORDS([sack synthetic system file negative multiple response])
2699 AT_DATA([sys-file.sack], [dnl
2701 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2702 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2704 dnl Numeric variable, no label or missing values.
2705 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2707 dnl Multiple response sets.
2708 7; 7; 1; COUNT("$a=E 2");
2710 dnl Character encoding record.
2711 7; 20; 1; 12; "windows-1252";
2715 for variant in be le; do
2716 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2717 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2719 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2720 warning: `sys-file.sav' near offset 0xd8: Unexpected label source value following `E' at offset 7 in MRSETS record.
2722 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 7 in MRSETS record.
2727 AT_SETUP([bad type character in mrsets])
2728 AT_KEYWORDS([sack synthetic system file negative multiple response])
2729 AT_DATA([sys-file.sack], [dnl
2731 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2732 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2734 dnl Numeric variable, no label or missing values.
2735 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2737 dnl Multiple response sets.
2738 7; 7; 1; COUNT("$a=");
2740 dnl Character encoding record.
2741 7; 20; 1; 12; "windows-1252";
2745 for variant in be le; do
2746 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2747 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2749 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2750 "warning: `sys-file.sav' near offset 0xd8: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2755 AT_SETUP([bad counted string length in mrsets])
2756 AT_KEYWORDS([sack synthetic system file negative multiple response])
2757 AT_DATA([sys-file.sack], [dnl
2759 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2760 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2762 dnl Numeric variable, no label or missing values.
2763 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2765 dnl Multiple response sets.
2766 7; 7; 1; COUNT("$a=Dx");
2768 dnl Character encoding record.
2769 7; 20; 1; 12; "windows-1252";
2773 for variant in be le; do
2774 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2775 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2777 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2778 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 4 in MRSETS record.
2783 AT_SETUP([missing space in counted string in mrsets])
2784 AT_KEYWORDS([sack synthetic system file negative multiple response])
2785 AT_DATA([sys-file.sack], [dnl
2787 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2788 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2790 dnl Numeric variable, no label or missing values.
2791 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2793 dnl Multiple response sets.
2794 7; 7; 1; COUNT("$a=D1x");
2796 dnl Character encoding record.
2797 7; 20; 1; 12; "windows-1252";
2801 for variant in be le; do
2802 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2803 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2805 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2806 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 5 in MRSETS record.
2811 AT_SETUP([counted string too long in mrsets])
2812 AT_KEYWORDS([sack synthetic system file negative multiple response])
2813 AT_DATA([sys-file.sack], [dnl
2815 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2816 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2818 dnl Numeric variable, no label or missing values.
2819 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2821 dnl Multiple response sets.
2822 7; 7; 1; COUNT("$a=D4 abc");
2824 dnl Character encoding record.
2825 7; 20; 1; 12; "windows-1252";
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: 4-byte string starting at offset 6 exceeds record length 9.
2839 AT_SETUP([missing space after counted string in mrsets])
2840 AT_KEYWORDS([sack synthetic system file negative multiple response])
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 Multiple response sets.
2850 7; 7; 1; COUNT("$a=D3 abcx");
2852 dnl Character encoding record.
2853 7; 20; 1; 12; "windows-1252";
2857 for variant in be le; do
2858 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2859 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2861 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2862 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 9 following 3-byte string.
2867 AT_SETUP([missing newline after variable name in mrsets])
2868 AT_KEYWORDS([sack synthetic system file negative multiple response])
2869 AT_DATA([sys-file.sack], [dnl
2871 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2872 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2874 dnl Numeric variable, no label or missing values.
2875 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2877 dnl Multiple response sets.
2878 7; 7; 1; COUNT("$a=C 0 NUM1");
2880 dnl Character encoding record.
2881 7; 20; 1; 12; "windows-1252";
2885 for variant in be le; do
2886 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2887 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2889 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2890 warning: `sys-file.sav' near offset 0xd8: Missing new-line parsing variable names at offset 13 in MRSETS record.
2892 warning: `sys-file.sav': MRSET $a has only one variable.
2897 AT_SETUP([duplicate variable name in mrsets])
2898 AT_KEYWORDS([sack synthetic system file negative multiple response])
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 Multiple response sets.
2908 7; 7; 1; COUNT("$a=C 0 NUM1 NUM1"; i8 10);
2910 dnl Character encoding record.
2911 7; 20; 1; 12; "windows-1252";
2915 for variant in be le; do
2916 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2917 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2919 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2920 warning: `sys-file.sav': MRSET $a contains duplicate variable name NUM1.
2922 warning: `sys-file.sav': MRSET $a has only one variable.
2927 AT_SETUP([mixed variable types in mrsets])
2928 AT_KEYWORDS([sack synthetic system file negative multiple response])
2929 AT_DATA([sys-file.sack], [dnl
2931 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2932 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2935 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2936 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2938 dnl Multiple response sets.
2939 7; 7; 1; COUNT("$a=C 0 NUM1 STR1"; i8 10);
2941 dnl Character encoding record.
2942 7; 20; 1; 12; "windows-1252";
2946 for variant in be le; do
2947 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2948 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2950 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2951 warning: `sys-file.sav': MRSET $a contains both string and numeric variables.
2953 warning: `sys-file.sav': MRSET $a has only one variable.
2958 AT_SETUP([missing newline after variable name in mrsets])
2959 AT_KEYWORDS([sack synthetic system file negative multiple response])
2960 AT_DATA([sys-file.sack], [dnl
2962 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2963 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2965 dnl Numeric variable, no label or missing values.
2966 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2968 dnl Multiple response sets.
2969 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10);
2971 dnl Character encoding record.
2972 7; 20; 1; 12; "windows-1252";
2976 for variant in be le; do
2977 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2978 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2980 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2981 warning: `sys-file.sav': MRSET $a has only one variable.
2986 AT_SETUP([zero or one variable in mrset])
2987 AT_KEYWORDS([sack synthetic system file negative multiple response])
2988 AT_DATA([sys-file.sack], [dnl
2990 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2991 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2993 dnl Numeric variable, no label or missing values.
2994 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2996 dnl Multiple response sets.
2997 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10; "$b=C 0 "; i8 10);
2999 dnl Character encoding record.
3000 7; 20; 1; 12; "windows-1252";
3004 for variant in be le; do
3005 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3006 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3008 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3009 warning: `sys-file.sav': MRSET $a has only one variable.
3011 warning: `sys-file.sav': MRSET $b has no variables.
3016 AT_SETUP([wrong display parameter size])
3017 AT_KEYWORDS([sack synthetic system file negative])
3018 AT_DATA([sys-file.sack], [dnl
3020 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3021 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3023 dnl Numeric variable, no label or missing values.
3024 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3026 dnl Display parameters record.
3027 7; 11; >>8<<; 2; 1.0; 1.0;
3029 dnl Character encoding record.
3030 7; 20; 1; 12; "windows-1252";
3032 dnl End of dictionary.
3035 for variant in be le; do
3036 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3037 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3039 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3040 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 11 has bad size 8 (expected 4)."
3045 AT_SETUP([wrong display parameter count])
3046 AT_KEYWORDS([sack synthetic system file negative])
3047 AT_DATA([sys-file.sack], [dnl
3049 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3050 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3052 dnl Numeric variable, no label or missing values.
3053 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3055 dnl Display parameters record.
3056 7; 11; 4; >>4<<; 1; 1; 2; 2;
3058 dnl Character encoding record.
3059 7; 20; 1; 12; "windows-1252";
3061 dnl End of dictionary.
3064 for variant in be le; do
3065 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3066 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3068 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3069 warning: `sys-file.sav' near offset 0xd8: Extension 11 has bad count 4 (for 1 variables).
3074 AT_SETUP([wrong display measurement level])
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, no label or missing values.
3082 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3084 dnl Display parameters record.
3085 7; 11; 4; 2; >>4<<; 0;
3087 dnl Character encoding record.
3088 7; 20; 1; 12; "windows-1252";
3090 dnl End of dictionary.
3093 for variant in be le; do
3094 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3095 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3097 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3098 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
3103 AT_SETUP([wrong display alignment])
3104 AT_KEYWORDS([sack synthetic system file negative])
3105 AT_DATA([sys-file.sack], [dnl
3107 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3108 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3110 dnl Numeric variable, no label or missing values.
3111 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3113 dnl Display parameters record.
3114 7; 11; 4; 2; 1; >>-1<<;
3116 dnl Character encoding record.
3117 7; 20; 1; 12; "windows-1252";
3119 dnl End of dictionary.
3122 for variant in be le; do
3123 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3124 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3126 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3127 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
3132 AT_SETUP([bad variable name in variable/value pair])
3133 AT_KEYWORDS([sack synthetic system file negative])
3134 AT_DATA([sys-file.sack], [dnl
3136 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3137 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3139 dnl Numeric variables.
3140 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
3142 dnl Long variable names.
3143 7; 13; 1; COUNT (>>"xyzzy"<<);
3145 dnl Character encoding record.
3146 7; 20; 1; 12; "windows-1252";
3148 dnl Dictionary termination record.
3151 for variant in be le; do
3152 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3153 AT_DATA([sys-file.sps], [dnl
3154 GET FILE='sys-file.sav'.
3156 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3157 warning: `sys-file.sav' near offset 0xde: Dictionary record refers to unknown variable xyzzy.
3162 AT_SETUP([duplicate long variable name])
3163 AT_KEYWORDS([sack synthetic system file negative])
3164 AT_DATA([sys-file.sack], [dnl
3166 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3167 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3169 dnl Numeric variables.
3170 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
3171 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
3172 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
3173 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
3175 dnl Long variable names.
3177 "LONGVARI=_Invalid"; i8 9;
3178 "LONGVARI=$Invalid"; i8 9;
3179 "LONGVARI=#Invalid"; i8 9;
3180 "LONGVA_A=LongVariableName"; i8 9;
3181 "LONGVA_B=LONGVARIABLENAME"; i8 9;
3184 dnl Character encoding record.
3185 7; 20; 1; 12; "windows-1252";
3187 dnl Dictionary termination record.
3190 for variant in be le; do
3191 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3192 AT_DATA([sys-file.sps], [dnl
3193 GET FILE='sys-file.sav'.
3195 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3196 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
3198 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `$Invalid'.
3200 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `#Invalid'.
3202 warning: `sys-file.sav' near offset 0x138: Duplicate long variable name `LONGVARIABLENAME'.
3207 AT_SETUP([bad very long string length])
3208 AT_KEYWORDS([sack synthetic system file negative])
3209 AT_DATA([sys-file.sack], [dnl
3211 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3212 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3214 dnl Numeric variable.
3215 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3217 dnl Very long string map.
3219 "NUM1=00000"; i8 0; i8 9;
3220 "NUM1=00255"; i8 0; i8 9;
3221 "NUM1=00256"; i8 0; i8 9;
3224 dnl Character encoding record.
3225 7; 20; 1; 12; "windows-1252";
3227 dnl Dictionary termination record.
3230 for variant in be le; do
3231 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3232 AT_DATA([sys-file.sps], [dnl
3233 GET FILE='sys-file.sav'.
3235 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3236 warning: `sys-file.sav' near offset 0xd8: NUM1 listed as string of invalid length 00000 in very long string record.
3238 "warning: `sys-file.sav' near offset 0xd8: NUM1 listed in very long string record with width 00255, which requires only one segment."
3240 error: `sys-file.sav' near offset 0xd8: Very long string NUM1 overflows dictionary.
3245 AT_SETUP([bad very long string segment width])
3246 AT_KEYWORDS([sack synthetic system file negative])
3247 AT_DATA([sys-file.sack], [dnl
3249 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3250 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3253 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
3254 (2; -1; 0; 0; 0; 0; s8 "") * 31;
3255 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
3256 >>2; -1; 0; 0; 0; 0; s8 "";<<
3258 dnl Very long string map.
3260 "STR1=00256"; i8 0; i8 9;
3263 dnl Character encoding record.
3264 7; 20; 1; 12; "windows-1252";
3266 dnl Dictionary termination record.
3269 for variant in be le; do
3270 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3271 AT_DATA([sys-file.sps], [dnl
3272 GET FILE='sys-file.sav'.
3274 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3275 error: `sys-file.sav' near offset 0x4f8: Very long string with width 256 has segment 1 of width 9 (expected 4).
3280 AT_SETUP([too many value labels])
3281 AT_KEYWORDS([sack synthetic system file negative])
3282 AT_DATA([sys-file.sack], [dnl
3284 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3285 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3287 dnl Numeric variable.
3288 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3291 for variant in be le; do
3292 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3293 AT_DATA([sys-file.sps], [dnl
3294 GET FILE='sys-file.sav'.
3296 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3297 error: `sys-file.sav' near offset 0xd4: Invalid number of labels 2147483647.
3302 AT_SETUP([missing type 4 record])
3303 AT_KEYWORDS([sack synthetic system file negative])
3304 AT_DATA([sys-file.sack], [dnl
3306 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3307 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3309 dnl Numeric variable.
3310 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3312 dnl Value label with missing type 4 record.
3313 3; 1; 1.0; i8 3; s7 "one";
3315 dnl Character encoding record.
3316 7; 20; 1; 12; "windows-1252";
3318 dnl End of dictionary.
3321 for variant in be le; do
3322 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3323 AT_DATA([sys-file.sps], [dnl
3324 GET FILE='sys-file.sav'.
3326 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3327 error: `sys-file.sav' near offset 0xe8: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
3332 AT_SETUP([value label with no associated variables])
3333 AT_KEYWORDS([sack synthetic system file negative])
3334 AT_DATA([sys-file.sack], [dnl
3336 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3337 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3339 dnl Numeric variable.
3340 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3342 dnl Value label with no variables.
3343 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
3345 for variant in be le; do
3346 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3347 AT_DATA([sys-file.sps], [dnl
3348 GET FILE='sys-file.sav'.
3350 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3351 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).
3356 AT_SETUP([type 4 record names long string variable])
3357 AT_KEYWORDS([sack synthetic system file negative])
3358 AT_DATA([sys-file.sack], [dnl
3360 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3361 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3363 dnl Long string variable.
3364 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3365 2; -1; 0; 0; 0; 0; s8 "";
3367 dnl Value label that names long string variable.
3368 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
3370 dnl Character encoding record.
3371 7; 20; 1; 12; "windows-1252";
3373 dnl End of dictionary.
3376 for variant in be le; do
3377 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3378 AT_DATA([sys-file.sps], [dnl
3379 GET FILE='sys-file.sav'.
3381 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
3382 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.
3387 AT_SETUP([value label variable indexes must be in correct range])
3388 AT_KEYWORDS([sack synthetic system file negative])
3389 AT_DATA([sys-file.sack], [dnl
3391 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3392 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3395 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3396 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3398 dnl Value labels with bad variable indexes.
3399 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>3; 4;<<
3400 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>5; 6;<<
3401 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>7; 8;<<
3403 dnl Character encoding record.
3404 7; 20; 1; 12; "windows-1252";
3406 dnl End of dictionary.
3409 for variant in be le; do
3410 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3411 AT_DATA([sys-file.sps], [dnl
3412 GET FILE='sys-file.sav'.
3414 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
3415 warning: `sys-file.sav' near offset 0xf4: Value label variable index 3 not in valid range 1...2.
3417 warning: `sys-file.sav' near offset 0xf4: Value label variable index 4 not in valid range 1...2.
3419 warning: `sys-file.sav' near offset 0x11c: Value label variable index 5 not in valid range 1...2.
3421 warning: `sys-file.sav' near offset 0x11c: Value label variable index 6 not in valid range 1...2.
3423 warning: `sys-file.sav' near offset 0x144: Value label variable index 7 not in valid range 1...2.
3425 warning: `sys-file.sav': Suppressed 1 additional warnings for value labels.
3430 AT_SETUP([value label variable indexes must not be long string continuation])
3431 AT_KEYWORDS([sack synthetic system file negative])
3432 AT_DATA([sys-file.sack], [dnl
3434 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3435 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3437 dnl Long string variable.
3438 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3439 (2; -1; 0; 0; 0; 0; s8 "");
3441 dnl Value label with long string indexes.
3442 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>2;<<
3444 dnl Character encoding record.
3445 7; 20; 1; 12; "windows-1252";
3447 dnl End of dictionary.
3450 for variant in be le; do
3451 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3452 AT_DATA([sys-file.sps], [dnl
3453 GET FILE='sys-file.sav'.
3455 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
3456 warning: `sys-file.sav' near offset 0xf4: Value label variable index 2 refers to long string continuation.
3461 AT_SETUP([variables for value label must all be same type])
3462 AT_KEYWORDS([sack synthetic system file negative])
3463 AT_DATA([sys-file.sack], [dnl
3465 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3466 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3469 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3470 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3472 dnl Value label that names numeric and string variables.
3473 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
3475 dnl Character encoding record.
3476 7; 20; 1; 12; "windows-1252";
3478 dnl End of dictionary.
3481 for variant in be le; do
3482 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3483 AT_DATA([sys-file.sps], [dnl
3484 GET FILE='sys-file.sav'.
3486 AT_CHECK([pspp -O format=csv sys-file.sps], 0, [dnl
3487 "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."
3492 AT_SETUP([duplicate value labels type])
3493 AT_KEYWORDS([sack synthetic system file negative])
3494 AT_DATA([sys-file.sack], [dnl
3496 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3497 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3500 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3501 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3503 dnl Duplicate value labels.
3504 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
3505 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
3507 dnl Character encoding record.
3508 7; 20; 1; 12; "windows-1252";
3510 dnl End of dictionary.
3513 for variant in be le; do
3514 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3515 AT_DATA([sys-file.sps], [dnl
3516 GET FILE='sys-file.sav'.
3518 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3519 warning: `sys-file.sav' near offset 0xf4: Duplicate value label for `xyzzy ' on STR1.
3521 warning: `sys-file.sav' near offset 0x11c: Duplicate value label for 1 on NUM1.
3526 AT_SETUP([missing attribute value])
3527 AT_KEYWORDS([sack synthetic system file negative])
3528 AT_DATA([sys-file.sack], [dnl
3530 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3531 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3534 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3536 dnl Data file attributes record.
3541 dnl Variable attributes record.
3547 dnl Character encoding record.
3548 7; 20; 1; 12; "windows-1252";
3550 dnl Dictionary termination record.
3553 for variant in be le; do
3554 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3555 AT_DATA([sys-file.sps], [dnl
3556 GET FILE='sys-file.sav'.
3558 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3559 warning: `sys-file.sav' near offset 0xde: Error parsing attribute value Attr1[[1]].
3561 warning: `sys-file.sav' near offset 0x101: Error parsing attribute value fred[[2]].
3566 AT_SETUP([unquoted attribute value])
3567 AT_KEYWORDS([sack synthetic system file negative])
3568 AT_DATA([sys-file.sack], [dnl
3570 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3571 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3574 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3576 dnl Data file attributes record.
3578 "Attr1(value"; i8 10;
3582 dnl Variable attributes record.
3585 "fred(23"; i8 10; ")"
3588 dnl Character encoding record.
3589 7; 20; 1; 12; "windows-1252";
3591 dnl Dictionary termination record.
3594 for variant in be le; do
3595 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3596 AT_DATA([sys-file.sps], [dnl
3597 GET FILE='sys-file.sav'.
3599 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3600 warning: `sys-file.sav' near offset 0xe4: Attribute value Attr1[[1]] is not quoted: value.
3602 warning: `sys-file.sav' near offset 0x106: Attribute value fred[[1]] is not quoted: 23.
3607 AT_SETUP([duplicate attribute name])
3608 AT_KEYWORDS([sack synthetic system file negative])
3609 AT_DATA([sys-file.sack], [dnl
3611 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3612 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3615 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3617 dnl Data file attributes record.
3619 "Attr1('value'"; i8 10; ")";
3620 "Attr1('value'"; i8 10; ")";
3623 dnl Variable attributes record.
3626 "fred('23'"; i8 10; ")";
3627 "fred('23'"; i8 10; ")";
3630 dnl Character encoding record.
3631 7; 20; 1; 12; "windows-1252";
3633 dnl Dictionary termination record.
3636 for variant in be le; do
3637 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3638 AT_DATA([sys-file.sps], [dnl
3639 GET FILE='sys-file.sav'.
3641 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3642 warning: `sys-file.sav' near offset 0xf6: Duplicate attribute Attr1.
3644 warning: `sys-file.sav' near offset 0x125: Duplicate attribute fred.
3649 AT_SETUP([bad variable name in long string value label])
3650 AT_KEYWORDS([sack synthetic system file negative])
3651 AT_DATA([sys-file.sack], [dnl
3653 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3654 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3657 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3658 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3659 2; -1; 0; 0; 0; 0; s8 "";
3662 dnl No variable named STR9.
3663 COUNT(>>"STR9"<<); 9;
3664 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3666 dnl NUM1 is numeric.
3667 COUNT(>>"NUM1"<<); 0;
3668 1; COUNT("xyz"); COUNT("value label for 1.0");
3670 dnl Wrong width for STR14.
3671 COUNT("STR14"); >>9<<;
3672 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3674 dnl Wrong width for value.
3676 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3678 dnl Duplicate value label.
3679 COUNT("STR14"); 14; 2;
3680 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3681 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3684 dnl Character encoding record.
3685 7; 20; 1; 12; "windows-1252";
3687 dnl Dictionary termination record.
3690 for variant in be le; do
3691 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3692 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3694 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3695 warning: `sys-file.sav' near offset 0x128: Ignoring long string value label record for unknown variable STR9.
3697 warning: `sys-file.sav' near offset 0x164: Ignoring long string value label record for numeric variable NUM1.
3699 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).
3701 "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."
3703 warning: `sys-file.sav' near offset 0x259: Duplicate value label for `abcdefghijklmn' on str14.
3708 AT_SETUP([fewer data records than indicated by file header])
3709 AT_KEYWORDS([sack synthetic system file negative])
3710 AT_DATA([sys-file.sack], [dnl
3712 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3713 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3715 dnl Numeric variables.
3716 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3717 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3719 dnl Character encoding record.
3720 7; 20; 1; 12; "windows-1252";
3728 dnl Missing record here.
3730 for variant in be le; do
3731 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3732 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3735 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3736 [error: Error reading case from file `sys-file.sav'.
3748 AT_SETUP([partial data record between variables])
3749 AT_KEYWORDS([sack synthetic system file negative])
3750 AT_DATA([sys-file.sack], [dnl
3752 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3753 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3755 dnl Numeric variables.
3756 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3757 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3759 dnl Character encoding record.
3760 7; 20; 1; 12; "windows-1252";
3767 for variant in be le; do
3768 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3769 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3772 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3773 [error: `sys-file.sav' near offset 0x12c: File ends in partial case.
3782 AT_SETUP([partial data record within long string])
3783 AT_KEYWORDS([sack synthetic system file negative])
3784 AT_DATA([sys-file.sack], [dnl
3786 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3787 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3789 dnl Numeric variables.
3790 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3791 2; -1; 0; 0; 0; 0; s8 "";
3793 dnl Character encoding record.
3794 7; 20; 1; 12; "windows-1252";
3798 s14 "one data item";
3801 for variant in be le; do
3802 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3803 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3806 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3807 [error: `sys-file.sav' near offset 0x12a: Unexpected end of file.
3816 AT_SETUP([partial compressed data record])
3817 AT_KEYWORDS([sack synthetic system file positive])
3818 AT_DATA([sys-file.sack], [dnl
3820 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3822 6; dnl Nominal case size
3825 -1; dnl Unspecified number of cases.
3827 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3830 dnl Numeric variables.
3831 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3832 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3834 dnl String variable.
3835 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3836 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3837 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3838 2; -1; 0; 0; 0; 0; s8 "";
3840 dnl Character encoding record.
3841 7; 20; 1; 12; "windows-1252";
3843 dnl Dictionary termination record.
3846 dnl Compressed data.
3847 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3849 for variant in be le; do
3850 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3851 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3854 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3855 [error: `sys-file.sav' near offset 0x1ac: File ends in partial case.
3858 num1,num2,str4,str8,str15
3859 -99,0,,abcdefgh,0123
3864 AT_SETUP([zcompressed data - bad zheader_ofs])
3865 AT_KEYWORDS([sack synthetic system file negative zlib])
3866 zcompressed_sack | sed 's/.*zheader_ofs.*/>>i64 0<<;/' > sys-file.sack
3867 for variant in be le; do
3868 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3869 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3871 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).
3876 AT_SETUP([zcompressed data - bad ztrailer_ofs])
3877 AT_KEYWORDS([sack synthetic system file negative zlib])
3878 zcompressed_sack | sed 's/.*ztrailer_ofs.*/>>i64 0<<;/' > sys-file.sack
3879 for variant in be le; do
3880 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3881 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3883 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Impossible ZLIB trailer offset 0x0.
3888 # ztrailer_len must be a multiple of 24 and at least 48,
3889 # so a value of 12 is impossible.
3890 AT_SETUP([zcompressed data - invalid ztrailer_len])
3891 AT_KEYWORDS([sack synthetic system file negative zlib])
3892 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 12<<;/' > sys-file.sack
3893 for variant in be le; do
3894 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3895 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3897 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Invalid ZLIB trailer length 12.
3902 # ztrailer_ofs + ztrailer_len must be the file size.
3903 AT_SETUP([zcompressed data - wrong ztrailer_len])
3904 AT_KEYWORDS([sack synthetic system file negative zlib])
3905 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 72<<;/' > sys-file.sack
3906 for variant in be le; do
3907 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3908 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3910 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).
3911 error: `sys-file.sav' near offset 0x21d: 72-byte ZLIB trailer specifies 1 data blocks (expected 2).
3916 AT_SETUP([zcompressed data - wrong ztrailer_bias])
3917 AT_KEYWORDS([sack synthetic system file negative zlib])
3918 zcompressed_sack | sed 's/.*ztrailer_bias.*/>>i64 0<<;/' > sys-file.sack
3919 for variant in be le; do
3920 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3921 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3923 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).
3928 AT_SETUP([zcompressed data - wrong ztrailer_zero])
3929 AT_KEYWORDS([sack synthetic system file negative zlib])
3930 zcompressed_sack | sed 's/.*ztrailer_zero.*/>>i64 100<<;/' > sys-file.sack
3931 for variant in be le; do
3932 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3933 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3935 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.
3940 AT_SETUP([zcompressed data - wrong block_size])
3941 AT_KEYWORDS([sack synthetic system file negative zlib])
3942 zcompressed_sack | sed 's/.*block_size.*/>>0x1000<<;/' > sys-file.sack
3943 for variant in be le; do
3944 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3945 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3947 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.
3952 AT_SETUP([zcompressed data - wrong n_blocks])
3953 AT_KEYWORDS([sack synthetic system file negative zlib])
3954 zcompressed_sack | sed 's/.*n_blocks.*/>>2<<;/' > sys-file.sack
3955 for variant in be le; do
3956 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3957 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3959 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).
3964 AT_SETUP([zcompressed data - wrong uncompressed_ofs])
3965 AT_KEYWORDS([sack synthetic system file negative zlib])
3966 zcompressed_sack | sed 's/.*uncompressed_ofs.*/i64 >>0x177<<;/' > sys-file.sack
3967 for variant in be le; do
3968 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3969 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3971 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.
3976 AT_SETUP([zcompressed data - wrong compressed_ofs])
3977 AT_KEYWORDS([sack synthetic system file negative zlib])
3978 zcompressed_sack | sed 's/.*@%:@ compressed_ofs.*/i64 >>0x191<<;/' > sys-file.sack
3979 for variant in be le; do
3980 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3981 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3983 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.
3988 AT_SETUP([zcompressed data - compressed sizes don't add up])
3989 AT_KEYWORDS([sack synthetic system file negative zlib])
3990 AT_DATA([sys-file.sack], [dnl
3992 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3994 6; dnl Nominal case size
3995 2; dnl zlib compressed
3997 -1; dnl Unspecified number of cases.
3999 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
4002 dnl Numeric variables.
4003 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
4004 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
4006 dnl String variable.
4007 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
4008 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
4009 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
4010 2; -1; 0; 0; 0; 0; s8 "";
4012 dnl Character encoding record.
4013 7; 20; 1; 12; "windows-1252";
4015 dnl Dictionary termination record.
4018 dnl ZLIB data header.
4019 i64 0x194; # zheader_ofs
4020 i64 0x1ac; # ztrailer_ofs
4021 i64 72; # ztrailer_len
4023 dnl This is where the ZLIB data blocks would go, but we don't need any to
4024 dnl provoke this message so we omit them.
4026 dnl ZLIB data trailer fixed header:
4027 i64 -100; # ztrailer_bias
4028 i64 0; # ztrailer_zero
4029 0x3ff000; # block_size
4032 dnl ZLIB block descriptor 1:
4033 i64 0x194; # uncompressed_ofs
4034 i64 0x1ac; # compressed_ofs
4035 0x100000; # uncompressed_size
4036 0x12345; # compressed_size
4038 dnl ZLIB block descriptor 2:
4039 i64 0x100194; # uncompressed_ofs
4040 i64 0x12421; # compressed_ofs
4041 0x100000; # uncompressed_size
4042 0x12345; # compressed_size
4044 for variant in be le; do
4045 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
4046 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
4048 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.
4049 error: `sys-file.sav' near offset 0x1dc: ZLIB block descriptor 1 reported compressed data offset 0x12421, when 0x124f1 was expected.
4054 AT_SETUP([zcompressed data - uncompressed_size > block_size])
4055 AT_KEYWORDS([sack synthetic system file negative zlib])
4056 zcompressed_sack | sed 's/.*uncompressed_size.*/>>0x400000<<;/' > sys-file.sack
4057 for variant in be le; do
4058 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
4059 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
4061 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.
4066 AT_SETUP([zcompressed data - compression expands data too much])
4067 AT_KEYWORDS([sack synthetic system file negative zlib])
4068 zcompressed_sack | sed 's/.*uncompressed_size.*/>>50<<;/
4069 s/.*@%:@ compressed_size.*/>>100<<;/' > sys-file.sack
4070 for variant in be le; do
4071 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
4072 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
4074 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.
4079 AT_SETUP([zcompressed data - compressed sizes don't add up])
4080 AT_KEYWORDS([sack synthetic system file negative zlib])
4081 zcompressed_sack | sed 's/.*@%:@ compressed_size.*/>>88<<;/' > sys-file.sack
4082 for variant in be le; do
4083 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
4084 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
4086 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.
4092 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467004.
4093 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
4094 # See also https://security-tracker.debian.org/tracker/CVE-2017-10791.
4095 # Found by team OWL337, using the collAFL fuzzer.
4096 AT_SETUP([integer overflows in long string missing values])
4097 AT_KEYWORDS([system file negative])
4098 cp $top_srcdir/tests/data/CVE-2017-10791.sav .
4099 AT_CHECK([pspp-convert -O csv -e ASCII CVE-2017-10791.sav -], [0], [], [dnl
4100 `CVE-2017-10791.sav' near offset 0x217: Extension record subtype 21 ends unexpectedly.
4105 # See also https://bugzilla.redhat.com/show_bug.cgi?id=1467005.
4106 # See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866890.
4107 # See also https://security-tracker.debian.org/tracker/CVE-2017-10792.
4108 # Reported by team OWL337, with fuzzer collAFL.
4109 AT_SETUP([null dereference skipping bad extension record 18])
4110 AT_KEYWORDS([system file negative])
4111 cp $top_srcdir/tests/data/CVE-2017-10792.sav .
4112 AT_CHECK([pspp-convert -O csv -e ASCII CVE-2017-10792.sav -], [0], [], [dnl
4113 `CVE-2017-10792.sav' near offset 0x1c0: Record type 7, subtype 18 has bad size 4 (expected 1).