1 AT_BANNER([system file reader - positive])
3 AT_SETUP([variable labels and missing values])
4 AT_KEYWORDS([sack synthetic system file positive])
5 AT_DATA([sys-file.sack], [dnl
7 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
9 28; dnl Nominal case size
14 "01 Jan 11"; "20:53:52";
15 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
18 dnl Numeric variable, no label or missing values.
19 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
21 dnl Numeric variable, variable label.
22 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
23 32; "Numeric variable 2's label ("; i8 249; i8 250; i8 251; ")";
25 dnl Numeric variable, one missing value.
26 2; 0; 0; 1; 0x050800 *2; s8 "NUM3";
29 dnl Numeric variable, variable label and missing value.
30 2; 0; 1; 1; 0x050800 *2; s8 "NUM4";
31 30; "Another numeric variable label"; i8 0 * 2;
34 dnl Numeric variable, two missing values.
35 2; 0; 0; 2; 0x050800 *2; s8 "NUM5"; 1.0; 2.0;
37 dnl Numeric variable, three missing values.
38 2; 0; 0; 3; 0x050800 *2; s8 "NUM6"; 1.0; 2.0; 3.0;
40 dnl Numeric variable, range of missing values.
41 2; 0; 0; -2; 0x050800 *2; s8 "NUM7"; 1.0; 3.0;
43 dnl Numeric variables, range of missing values plus discrete value.
44 2; 0; 0; -3; 0x050800 *2; s8 "NUM8"; 1.0; 3.0; 5.0;
45 2; 0; 0; -3; 0x050800 *2; s8 "NUM9"; 1.0; HIGHEST; -5.0;
46 2; 0; 0; -3; 0x050800 *2; "NUM"; i8 192; i8 200; i8 204; i8 209; i8 210;
49 dnl String variable, no label or missing values.
50 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
52 dnl String variable, variable label.
53 2; 4; 1; 0; 0x010400 *2; s8 "STR2";
54 25; "String variable 2's label"; i8 0 * 3;
56 dnl String variable, one missing value.
57 2; 4; 0; 1; 0x010400 *2; s8 "STR3"; s8 "MISS";
59 dnl String variable, variable label and missing value.
60 2; 4; 1; 1; 0x010400 *2; s8 "STR4";
61 29; "Another string variable label"; i8 0 * 3;
64 dnl String variable, two missing values.
65 2; 4; 0; 2; 0x010400 *2; s8 "STR5"; s8 "MISS"; s8 "OTHR";
67 dnl String variable, three missing values.
68 2; 4; 0; 3; 0x010400 *2; s8 "STR6"; s8 "MISS"; s8 "OTHR"; s8 "MORE";
70 dnl Long string variable, one missing value.
71 dnl (This is not how SPSS represents missing values for long strings--it
72 dnl uses a separate record as shown later below--but old versions of PSPP
73 dnl did use this representation so we continue supporting it for backward
75 2; 11; 0; 1; 0x010b00 *2; s8 "STR7"; "first8by";
76 2; -1; 0; 0; 0; 0; s8 "";
78 dnl Long string variables that will have missing values added with a
80 2; 9; 0; 0; 0x010900 *2; s8 "STR8";
81 2; -1; 0; 0; 0; 0; s8 "";
82 2; 10; 0; 0; 0x010a00 *2; s8 "STR9";
83 2; -1; 0; 0; 0; 0; s8 "";
84 2; 11; 0; 0; 0x010b00 *2; s8 "STR10";
85 2; -1; 0; 0; 0; 0; s8 "";
87 dnl Long string variable, value label.
88 2; 25; 1; 0; 0x011900 *2; s8 "STR11"; 14; "25-byte string"; i8 0 * 2;
89 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
90 dnl Variable label fields on continuation records have been spotted in system
91 dnl files created by "SPSS Power Macintosh Release 6.1".
92 2; -1; 1; 0; 0; 0; s8 ""; 20; "dummy variable label";
94 dnl Machine integer info record.
95 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
97 dnl Machine floating-point info record.
98 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
100 dnl Long string variable missing values record.
102 dnl One missing value for STR8.
103 COUNT("STR8"); i8 1; 8; "abcdefgh";
105 dnl Two missing values for STR9.
106 COUNT("STR9"); i8 2; 8; "abcdefgh"; 8; "01234567";
108 dnl Three missing values for STR9.
109 COUNT("STR10"); i8 3; 8; "abcdefgh"; 8; "01234567"; 8; "0 ";
112 dnl Character encoding record.
113 7; 20; 1; 12; "windows-1252";
115 dnl Dictionary termination record.
119 1.0; 2.0; 3.0; 4.0; 5.0; 6.0; 7.0; 8.0; 9.0; 10.0;
120 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
121 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
122 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
124 for variant in be le; do
125 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
126 AT_DATA([sys-file.sps], [dnl
127 GET FILE='sys-file.sav'.
132 AT_CHECK([pspp -o pspp.csv sys-file.sps])
133 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
134 File label: PSPP synthetic test file: ôõöø
136 Variable,Description,,Position
138 num2,Label: Numeric variable 2's label (ùúû),,2
142 num4,Label: Another numeric variable label,,4
146 ,Missing Values: 1; 2,,
148 ,Missing Values: 1; 2; 3,,
150 ,Missing Values: 1 THRU 3,,
152 ,Missing Values: 1 THRU 3; 5,,
154 ,Missing Values: 1 THRU HIGHEST; -5,,
155 numàèìñò,Format: F8.0,,10
156 ,Missing Values: LOWEST THRU 1; 5,,
158 str2,Label: String variable 2's label,,12
161 ,"Missing Values: ""MISS""",,
162 str4,Label: Another string variable label,,14
164 ,"Missing Values: ""OTHR""",,
166 ,"Missing Values: ""MISS""; ""OTHR""",,
168 ,"Missing Values: ""MISS""; ""OTHR""; ""MORE""",,
170 ,"Missing Values: ""first8by""",,
172 ,"Missing Values: ""abcdefgh""",,
174 ,"Missing Values: ""abcdefgh""; ""01234567""",,
175 str10,Format: A11,,20
176 ,"Missing Values: ""abcdefgh""; ""01234567""; ""0 """,,
177 str11,Label: 25-byte string,,21
181 num1,num2,num3,num4,num5,num6,num7,num8,num9,numàèìñò,str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11
182 1,2,3,4,5,6,7,8,9,10,abcd,efgh,ijkl,mnop,qrst,uvwx,yzABCDEFGHI,JKLMNOPQR,STUVWXYZ01,23456789abc,defghijklmnopqstuvwxyzABC
187 AT_SETUP([unspecified number of variable positions])
188 AT_KEYWORDS([sack synthetic system file positive])
189 AT_DATA([sys-file.sack], [dnl
191 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
193 -1; dnl Nominal case size (unspecified)
194 0; dnl Not compressed
198 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
201 dnl Numeric variable, no label or missing values.
202 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
204 dnl Numeric variable, variable label.
205 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
206 26; "Numeric variable 2's label"; i8 0 *2;
208 dnl Character encoding record.
209 7; 20; 1; 12; "windows-1252";
211 dnl Dictionary termination record.
217 for variant in be le; do
218 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
219 AT_DATA([sys-file.sps], [dnl
220 GET FILE='sys-file.sav'.
224 AT_CHECK([pspp -o pspp.csv sys-file.sps])
225 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
226 Variable,Description,,Position
228 num2,Label: Numeric variable 2's label,,2
238 AT_SETUP([wrong number of variable positions but version 13])
239 AT_KEYWORDS([sack synthetic system file positive])
240 AT_DATA([sys-file.sack], [dnl
242 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
244 -1; dnl Nominal case size (unspecified)
245 0; dnl Not compressed
249 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
252 dnl Numeric variable, no label or missing values.
253 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
255 dnl Numeric variable, variable label.
256 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
257 26; "Numeric variable 2's label"; i8 0 *2;
259 dnl Machine integer info record (SPSS 13).
260 7; 3; 4; 8; 13; 2; 3; -1; 1; 1; ENDIAN; 1252;
262 dnl Character encoding record.
263 7; 20; 1; 12; "windows-1252";
265 dnl Dictionary termination record.
271 for variant in be le; do
272 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
273 AT_DATA([sys-file.sps], [dnl
274 GET FILE='sys-file.sav'.
278 AT_CHECK([pspp -o pspp.csv sys-file.sps])
279 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
280 Variable,Description,,Position
282 num2,Label: Numeric variable 2's label,,2
292 AT_SETUP([value labels])
293 AT_KEYWORDS([sack synthetic system file positive])
294 AT_DATA([sys-file.sack], [dnl
296 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
298 22; dnl Nominal case size
299 0; dnl Not compressed
303 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
306 dnl Numeric variables.
307 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
308 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
309 2; 0; 0; 0; 0x050800 *2; s8 "NUM3";
310 2; 0; 0; 0; 0x050800 *2; s8 "NUM4";
311 2; 0; 0; 0; 0x050800 *2; s8 "NUM5";
313 dnl String variables.
314 2; 1; 0; 0; 0x010100 *2; s8 "STR1"; dnl index 6
315 2; 2; 0; 0; 0x010200 *2; s8 "STR2"; dnl index 7
316 2; 3; 0; 0; 0x010300 *2; s8 "STR3"; dnl index 8
317 2; 4; 0; 0; 0x010400 *2; s8 "STR4"; dnl index 9
318 2; 4; 0; 0; 0x010400 *2; s8 "STR5"; dnl index 10
319 2; 6; 0; 0; 0x010600 *2; s8 "STR6"; dnl index 11
320 2; 7; 0; 0; 0x010700 *2; s8 "STR7"; dnl index 12
321 2; 8; 0; 0; 0x010800 *2; s8 "STR8"; dnl index 13
322 2; 9; 0; 0; 0x010900 *2; "STR9"; i8 230; s3 ""; dnl index 14
323 2; -1; 0; 0; 0; 0; s8 "";
324 2; 12; 0; 0; 0x010c00 *2; s8 "STR12"; dnl index 16
325 2; -1; 0; 0; 0; 0; s8 "";
326 2; 16; 0; 0; 0x011000 *2; s8 "STR16"; dnl index 18
327 2; -1; 0; 0; 0; 0; s8 "";
328 2; 17; 0; 0; 0x011100 *2; s8 "STR17"; dnl index 20
329 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
331 dnl One value label for NUM1.
332 3; 1; 1.0; i8 17; i8 238; i8 228; i8 232; i8 237; s19 " (in Russian)"; 4; 1; 1;
334 dnl Two value labels for NUM2, as a single pair of type 3 and type 4 records.
335 3; 2; 1.0; i8 3; s7 "one"; 2.0; i8 3; s7 "two"; 4; 1; 2;
337 dnl Two value labels for NUM3, as two pairs of type 3 and type 4 records.
338 3; 1; 3.0; i8 5; s7 "three"; 4; 1; 3;
339 3; 1; 4.0; i8 4; s7 "four"; 4; 1; 3;
341 dnl Two common value labels for NUM4 and NUM5, plus two different ones for each.
342 3; 1; 5.0; i8 4; s7 "five"; 4; 1; 4;
343 3; 1; 6.0; i8 3; s7 "six"; 4; 1; 5;
344 3; 2; 7.0; i8 5; s7 "seven"; 8.0; i8 5; s7 "eight"; 4; 2; 4; 5;
345 3; 1; 9.0; i8 4; s7 "nine"; 4; 1; 4;
346 3; 1; 10.0; i8 3; s7 "ten"; 4; 1; 5;
348 dnl One value label for STR1.
349 3; 1; s8 "a"; i8 19; s23 "value label for `a'"; 4; 1; 6;
351 dnl Two value labels for STR2, as a single pair of type 3 and type 4 records.
353 s8 "bc"; i8 20; s23 "value label for `bc'";
354 s8 "de"; i8 20; s23 "value label for `de'";
357 dnl Two value labels for STR3, as two pairs of type 3 and type 4 records.
358 3; 1; s8 "fgh"; i8 21; s23 "value label for `fgh'"; 4; 1; 8;
359 3; 1; s8 "ijk"; i8 21; s23 "value label for `ijk'"; 4; 1; 8;
361 dnl Two common value labels for STR4 and STR5, plus two different ones for each.
362 3; 1; s8 "lmno"; i8 22; s23 "value label for `lmno'"; 4; 1; 9;
363 3; 1; s8 "pqrs"; i8 22; s23 "value label for `pqrs'"; 4; 1; 10;
365 s8 "tuvw"; i8 22; s23 "value label for `tuvw'";
366 s8 "xyzA"; i8 22; s23 "value label for `xyzA'";
368 3; 1; s8 "BCDE"; i8 22; s23 "value label for `BCDE'"; 4; 1; 9;
369 3; 1; s8 "FGHI"; i8 22; s23 "value label for `FGHI'"; 4; 1; 10;
371 dnl One value label for STR6, STR7, STR8.
372 3; 1; s8 "JKLMNO"; i8 24; s31 "value label for `JKLMNO'"; 4; 1; 11;
373 3; 1; s8 "JKLMNOP"; i8 25; s31 "value label for `JKLMNOP'"; 4; 1; 12;
374 3; 1; s8 "JKLMNOPQ"; i8 26; s31 "value label for `JKLMNOPQ'"; 4; 1; 13;
376 dnl Machine integer info record.
377 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1251;
379 dnl Character encoding record.
380 7; 20; 1; 12; "windows-1251";
383 dnl One value label for STR9ж,
384 COUNT("STR9"; i8 230); 9; 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
386 dnl Two value labels for STR12.
387 COUNT("STR12"); 12; 2;
388 COUNT("0123456789ab"); COUNT("value label for `0123456789ab'");
389 COUNT("cdefghijklmn"); COUNT("value label for `cdefghijklmn'");
391 dnl Three value labels for STR16.
392 COUNT("STR16"); 16; 3;
393 COUNT("opqrstuvwxyzABCD"); COUNT("value label for `opqrstuvwxyzABCD'");
394 COUNT("EFGHIJKLMNOPQRST"); COUNT("value label for `EFGHIJKLMNOPQRST'");
395 COUNT("UVWXYZ0123456789"); COUNT("value label for `UVWXYZ0123456789' with Cyrillic letters: `"; i8 244; i8 245; i8 246; "'");
397 dnl One value label for STR17.
398 COUNT("STR17"); 17; 1;
399 COUNT("abcdefghijklmnopq"); COUNT("value label for `abcdefghijklmnopq'");
402 dnl Dictionary termination record.
405 for variant in be le; do
406 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
407 AT_DATA([sys-file.sps], [dnl
408 GET FILE='sys-file.sav'.
411 AT_CHECK([pspp -o pspp.csv sys-file.sps])
412 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
413 Variable,Description,,Position
415 ,1,один (in Russian),
433 ,a,value label for `a',
435 ,bc,value label for `bc',
436 ,de,value label for `de',
438 ,fgh,value label for `fgh',
439 ,ijk,value label for `ijk',
441 ,BCDE,value label for `BCDE',
442 ,lmno,value label for `lmno',
443 ,tuvw,value label for `tuvw',
444 ,xyzA,value label for `xyzA',
446 ,FGHI,value label for `FGHI',
447 ,pqrs,value label for `pqrs',
448 ,tuvw,value label for `tuvw',
449 ,xyzA,value label for `xyzA',
451 ,JKLMNO,value label for `JKLMNO',
453 ,JKLMNOP,value label for `JKLMNOP',
455 ,JKLMNOPQ,value label for `JKLMNOPQ',
457 ,RSTUVWXYZ,value label for `RSTUVWXYZ',
458 str12,Format: A12,,15
459 ,0123456789ab,value label for `0123456789ab',
460 ,cdefghijklmn,value label for `cdefghijklmn',
461 str16,Format: A16,,16
462 ,EFGHIJKLMNOPQRST,value label for `EFGHIJKLMNOPQRST',
463 ,UVWXYZ0123456789,value label for `UVWXYZ0123456789' with Cyrillic letters: `фхц',
464 ,opqrstuvwxyzABCD,value label for `opqrstuvwxyzABCD',
465 str17,Format: A17,,17
466 ,abcdefghijklmnopq,value label for `abcdefghijklmnopq',
471 AT_SETUP([documents])
472 AT_KEYWORDS([sack synthetic system file positive])
473 AT_DATA([sys-file.sack], [dnl
475 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
477 1; dnl Nominal case size
478 0; dnl Not compressed
482 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
485 dnl Numeric variable, no label or missing values.
486 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
488 dnl Machine integer info record.
489 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
493 s80 "First line of documents";
494 s80 "Second line of documents";
495 "abb"; i8 233; " appliqu"; i8 233; " attach"; i8 233; " blas"; i8 233; " caf"; i8 233; " canap"; i8 233; " clich"; i8 233; " consomm"; i8 233;
498 s80 "Last line of documents";
500 dnl Character encoding record.
501 7; 20; 1; 12; "windows-1252";
503 dnl Dictionary termination record.
509 for variant in be le; do
510 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
511 AT_DATA([sys-file.sps], [dnl
512 GET FILE='sys-file.sav'.
516 AT_CHECK([pspp -o pspp.csv sys-file.sps])
517 AT_CHECK([cat pspp.csv], [0], [dnl
518 Documents in the active dataset:
520 First line of documents
522 Second line of documents
524 abbé appliqué attaché blasé café canapé cliché consommé
528 Last line of documents
537 AT_SETUP([multiple response sets])
538 AT_KEYWORDS([sack synthetic system file positive])
539 AT_DATA([sys-file.sack], [dnl
541 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
543 16; dnl Nominal case size
544 0; dnl Not compressed
548 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
552 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
553 2; 0; 0; 0; 0x050800 *2; s8 "B";
554 2; 0; 0; 0; 0x050800 *2; s8 "C";
557 2; 0; 0; 0; 0x050800 *2; s8 "D";
558 2; 0; 0; 0; 0x050800 *2; s8 "E";
559 2; 0; 0; 0; 0x050800 *2; s8 "F";
560 2; 0; 0; 0; 0x050800 *2; s8 "G";
563 2; 4; 0; 0; 0x010400 *2; s8 "H";
564 2; 4; 0; 0; 0x010400 *2; s8 "I";
565 2; 4; 0; 0; 0x010400 *2; s8 "J";
568 2; 0; 0; 0; 0x050800 *2; s8 "K";
569 2; 0; 0; 0; 0x050800 *2; s8 "L";
570 2; 0; 0; 0; 0x050800 *2; s8 "M";
573 2; 6; 0; 0; 0x010600 *2; s8 "N";
574 2; 6; 0; 0; 0x010600 *2; s8 "O";
575 2; 6; 0; 0; 0x010600 *2; s8 "P";
577 dnl Machine integer info record.
578 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
582 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
583 "$b=D2 55 0 g e f d"; i8 10; i8 10;
584 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
589 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
590 "$e=E 11 6 choice 0 n o p"; i8 10; i8 10; i8 10; i8 10);
592 dnl Character encoding record.
593 7; 20; 1; 9; "shift_jis";
595 dnl Dictionary termination record.
598 for variant in be le; do
599 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
600 AT_DATA([sys-file.sps], [dnl
601 GET FILE='sys-file.sav'.
602 MRSETS /DISPLAY NAME=ALL.
604 AT_CHECK([pspp -o pspp.csv sys-file.sps])
605 AT_CHECK([cat pspp.csv], [0], [dnl
606 Table: Multiple Response Sets
607 Name,Variables,Details
611 ","Multiple category set
618 ","Multiple dichotomy set
620 Category label source: Variable labels
625 ","Multiple dichotomy set
627 Label source: Provided by user
629 Category label source: Variable labels
634 ","Multiple dichotomy set
636 Label source: Provided by user
638 Category label source: Value labels of counted value
643 ","Multiple dichotomy set
644 Label source: First variable label among variables
645 Counted value: `choice'
646 Category label source: Value labels of counted value
652 dnl Also checks for handling of CR-only line ends in file label and
653 dnl extra product info.
654 AT_SETUP([extra product info])
655 AT_KEYWORDS([sack synthetic system file positive])
656 AT_DATA([sys-file.sack], [dnl
658 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
660 4; dnl Nominal case size
661 0; dnl Not compressed
665 "01 Jan 11"; "20:53:52"; "PSPP synthetic"; i8 13; s49 "test file";
668 dnl Numeric variables.
669 2; 0; 0; 0; 0x050800 *2; s8 "A";
670 2; 0; 0; 0; 0x050800 *2; s8 "B";
671 2; 0; 0; 0; 0x050800 *2; s8 "C";
672 2; 0; 0; 0; 0x050800 *2; s8 "D";
674 dnl Extra product info.
675 7; 10; 1; COUNT ("Extra product info"; i8 13; "another line"; i8 13; "blah");
677 dnl Character encoding record.
678 7; 20; 1; 12; "windows-1252";
680 dnl Dictionary termination record.
683 for variant in be le; do
684 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
685 AT_DATA([sys-file.sps], [dnl
686 SYSFILE INFO FILE='sys-file.sav'.
688 AT_CHECK([pspp -o pspp.csv sys-file.sps])
689 AT_CHECK([sed 7q pspp.csv], [0], [dnl
691 Label:,"PSPP synthetic
693 Created:,01 Jan 11 20:53:52 by $(@%:@) SPSS DATA FILE PSPP synthetic test file
694 Product:,"Extra product info
701 AT_SETUP([variable display parameters, without width])
702 AT_KEYWORDS([sack synthetic system file positive])
703 AT_DATA([sys-file.sack], [dnl
705 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
707 19; dnl Nominal case size
708 0; dnl Not compressed
712 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
715 dnl Numeric variables.
716 2; 0; 0; 0; 0x050800 *2; s8 "A";
717 2; 0; 0; 0; 0x050800 *2; s8 "B";
718 2; 0; 0; 0; 0x050800 *2; s8 "C";
719 2; 0; 0; 0; 0x050800 *2; s8 "D";
721 dnl Short string variables.
722 2; 3; 0; 0; 0x010300 *2; s8 "H";
723 2; 3; 0; 0; 0x010300 *2; s8 "I";
724 2; 3; 0; 0; 0x010300 *2; s8 "J";
725 2; 3; 0; 0; 0x010300 *2; s8 "K";
727 dnl Long string variables.
728 2; 9; 0; 0; 0x010900 *2; s8 "L";
729 2; -1; 0; 0; 0; 0; s8 "";
730 2; 10; 0; 0; 0x010a00 *2; s8 "M";
731 2; -1; 0; 0; 0; 0; s8 "";
732 2; 17; 0; 0; 0x011100 *2; s8 "N";
733 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
734 2; 25; 0; 0; 0x011900 *2; s8 "O";
735 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
737 dnl Variable display parameters
752 dnl Character encoding record.
753 7; 20; 1; 12; "windows-1252";
755 dnl Dictionary termination record.
758 for variant in be le; do
759 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
760 AT_DATA([sys-file.sps], [dnl
761 GET FILE='sys-file.sav'.
764 AT_CHECK([pspp -o pspp.csv sys-file.sps])
765 AT_CHECK([cat pspp.csv], [0], [dnl
766 Variable,Description,,Position
769 ,Display Alignment: Left,,
773 ,Display Alignment: Left,,
777 ,Display Alignment: Left,,
781 ,Display Alignment: Right,,
785 ,Display Alignment: Right,,
789 ,Display Alignment: Right,,
793 ,Display Alignment: Center,,
797 ,Display Alignment: Center,,
801 ,Display Alignment: Center,,
805 ,Display Alignment: Left,,
809 ,Display Alignment: Right,,
813 ,Display Alignment: Center,,
819 AT_SETUP([variable display parameters, with width])
820 AT_KEYWORDS([sack synthetic system file positive])
821 AT_DATA([sys-file.sack], [dnl
823 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
825 19; dnl Nominal case size
826 0; dnl Not compressed
830 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
833 dnl Numeric variables.
834 2; 0; 0; 0; 0x050800 *2; s8 "A";
835 2; 0; 0; 0; 0x050800 *2; s8 "B";
836 2; 0; 0; 0; 0x050800 *2; s8 "C";
837 2; 0; 0; 0; 0x050800 *2; s8 "D";
839 dnl Short string variables.
840 2; 3; 0; 0; 0x010300 *2; s8 "H";
841 2; 3; 0; 0; 0x010300 *2; s8 "I";
842 2; 3; 0; 0; 0x010300 *2; s8 "J";
843 2; 3; 0; 0; 0x010300 *2; s8 "K";
845 dnl Long string variables.
846 2; 9; 0; 0; 0x010900 *2; s8 "L";
847 2; -1; 0; 0; 0; 0; s8 "";
848 2; 10; 0; 0; 0x010a00 *2; s8 "M";
849 2; -1; 0; 0; 0; 0; s8 "";
850 2; 17; 0; 0; 0x011100 *2; s8 "N";
851 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
852 2; 25; 0; 0; 0x011900 *2; s8 "O";
853 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
855 dnl Variable display parameters
870 dnl Character encoding record.
871 7; 20; 1; 12; "windows-1252";
873 dnl Dictionary termination record.
876 for variant in be le; do
877 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
878 AT_DATA([sys-file.sps], [dnl
879 GET FILE='sys-file.sav'.
882 AT_CHECK([pspp -o pspp.csv sys-file.sps])
883 AT_CHECK([cat pspp.csv], [0], [dnl
884 Variable,Description,,Position
887 ,Display Alignment: Left,,
891 ,Display Alignment: Left,,
895 ,Display Alignment: Left,,
899 ,Display Alignment: Right,,
903 ,Display Alignment: Right,,
907 ,Display Alignment: Right,,
911 ,Display Alignment: Center,,
915 ,Display Alignment: Center,,
919 ,Display Alignment: Center,,
923 ,Display Alignment: Left,,
927 ,Display Alignment: Right,,
931 ,Display Alignment: Center,,
937 AT_SETUP([long variable names])
938 AT_KEYWORDS([sack synthetic system file positive])
939 AT_DATA([sys-file.sack], [dnl
941 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
943 7; dnl Nominal case size
944 0; dnl Not compressed
948 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
951 dnl Numeric variables.
952 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
953 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
954 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
955 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
956 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDINA";
957 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_A";
958 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_B";
960 dnl Machine integer info record.
961 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
963 dnl Machine floating-point info record.
964 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
966 dnl Long variable names.
968 "LONGVARI=LongVariableName1"; i8 9;
969 "LONGVA_A=LongVariableName2"; i8 9;
970 "LONGVA_B=LongVariableName3"; i8 9;
971 "LONGVA_C=LongVariableName4"; i8 9;
972 "CO"; i8 214; "RDINA=Co"; i8 246; "rdinate_X"; i8 9;
973 "CO"; i8 214; "RDI_A=Co"; i8 246; "rdinate_Y"; i8 9;
974 "CO"; i8 214; "RDI_B=Co"; i8 246; "rdinate_Z";
977 dnl Character encoding record.
978 7; 20; 1; 12; "windows-1252";
980 dnl Dictionary termination record.
983 for variant in be le; do
984 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
985 AT_DATA([sys-file.sps], [dnl
986 GET FILE='sys-file.sav'.
989 AT_CHECK([pspp -o pspp.csv sys-file.sps])
990 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
991 Variable,Description,,Position
992 LongVariableName1,Format: F8.0,,1
993 LongVariableName2,Format: F8.0,,2
994 LongVariableName3,Format: F8.0,,3
995 LongVariableName4,Format: F8.0,,4
996 Coördinate_X,Format: F8.0,,5
997 Coördinate_Y,Format: F8.0,,6
998 Coördinate_Z,Format: F8.0,,7
1003 AT_SETUP([very long strings])
1004 AT_KEYWORDS([sack synthetic system file positive])
1005 AT_DATA([sys-file.sack], [dnl
1007 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1009 109; dnl Nominal case size
1010 0; dnl Not compressed
1014 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1017 dnl 256-byte string.
1018 2; 255; 0; 0; 0x01FF00 *2; "S"; i8 201; s6 "Q256";
1019 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1020 2; 4; 0; 0; 0x010400 *2; "S"; i8 201; "Q256_1";
1022 dnl 600-byte string.
1023 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600";
1024 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1025 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600_1";
1026 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1027 2; 96; 0; 0; 0x016000 *2; s8 "STR600_2";
1028 (2; -1; 0; 0; 0; 0; s8 "") * 11;
1030 dnl Machine integer info record.
1031 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1033 dnl Very long string record.
1035 "S"; i8 201; "Q256=00256"; i8 0; i8 9;
1036 "STR600=00600"; i8 0; i8 9;
1039 dnl Character encoding record.
1040 7; 20; 1; 12; "windows-1252";
1042 dnl Dictionary termination record.
1046 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 4;
1048 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 9;
1049 "abcdefghijklmnopqrstuvwxyzABCDEF";
1051 for variant in be le; do
1052 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1053 AT_DATA([sys-file.sps], [dnl
1054 GET FILE='sys-file.sav'.
1058 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1059 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1060 Variable,Description,,Position
1061 séq256,Format: A256,,1
1062 str600,Format: A600,,2
1066 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@a,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyz
1071 AT_SETUP([data file and variable attributes])
1072 AT_KEYWORDS([sack synthetic system file positive])
1073 AT_DATA([sys-file.sack], [dnl
1075 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1077 2; dnl Nominal case size
1078 0; dnl Not compressed
1082 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1086 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
1087 2; 0; 0; 0; 0x050800 *2; s8 "SECONDVA";
1089 dnl Machine integer info record.
1090 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1092 dnl Long variable names.
1094 "FIRSTVAR=FirstVariable"; i8 9;
1095 "SECONDVA=S"; i8 233; "condVariable"; i8 9;
1098 dnl Data file attributes record.
1100 "Attr1('Value1'"; i8 10; "''d"; i8 233; "claration''"; i8 10; ")";
1101 "S"; i8 233; "condAttr('123'"; i8 10; "'456'"; i8 10; ")";
1104 dnl Variable attributes record.
1107 "ad"; i8 232; "le('23'"; i8 10; "'34'"; i8 10; ")";
1108 "bert('123'"; i8 10; ")";
1109 "$@Role('1'"; i8 10; ")";
1110 "/S"; i8 233; "condVariable:";
1111 "xyzzy('quux'"; i8 10; ")";
1115 dnl Character encoding record.
1116 7; 20; 1; 12; "windows-1252";
1118 dnl Dictionary termination record.
1121 for variant in be le; do
1122 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1123 AT_DATA([sys-file.sps], [dnl
1124 GET FILE='sys-file.sav'.
1125 DISPLAY @ATTRIBUTES.
1127 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1128 AT_CHECK([cat pspp.csv], [0],
1129 [[Variable,Description,
1130 FirstVariable,Custom attributes:,
1135 SécondVariable,Custom attributes:,
1138 Table: Custom data file attributes.
1141 Attr1[2],'déclaration'
1145 AT_DATA([sys-file.sps], [dnl
1146 GET FILE='sys-file.sav'.
1149 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1150 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0],
1151 [[Variable,Description,,Position
1152 FirstVariable,Format: F8.0,,1
1154 ,Custom attributes:,,
1158 SécondVariable,Format: F8.0,,2
1159 ,Custom attributes:,,
1162 Table: Custom data file attributes.
1165 Attr1[2],'déclaration'
1172 AT_SETUP([variable roles])
1173 AT_KEYWORDS([sack synthetic system file positive])
1174 AT_DATA([sys-file.sack], [dnl
1176 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1178 7; dnl Nominal case size
1179 0; dnl Not compressed
1183 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1187 2; 0; 0; 0; 0x050800 *2; s8 "I";
1188 2; 0; 0; 0; 0x050800 *2; s8 "O";
1189 2; 0; 0; 0; 0x050800 *2; s8 "B";
1190 2; 0; 0; 0; 0x050800 *2; s8 "N";
1191 2; 0; 0; 0; 0x050800 *2; s8 "P";
1192 2; 0; 0; 0; 0x050800 *2; s8 "S";
1193 2; 0; 0; 0; 0x050800 *2; s8 "X";
1195 dnl Machine integer info record.
1196 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1198 dnl Variable attributes record.
1200 "I:$@Role('0'"; i8 10; ")";
1201 "/O:$@Role('1'"; i8 10; ")";
1202 "/B:$@Role('2'"; i8 10; ")";
1203 "/N:$@Role('3'"; i8 10; ")";
1204 "/P:$@Role('4'"; i8 10; ")";
1205 "/S:$@Role('5'"; i8 10; ")";
1206 "/X:$@Role('6'"; i8 10; ")";
1209 dnl Character encoding record.
1210 7; 20; 1; 12; "windows-1252";
1212 dnl Dictionary termination record.
1215 for variant in be le; do
1216 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1217 AT_DATA([sys-file.sps], [dnl
1218 GET FILE='sys-file.sav'.
1221 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [dnl
1222 warning: `sys-file.sav': Invalid role for variable x.
1224 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1225 warning: `sys-file.sav': Invalid role for variable x.
1227 Variable,Description,,Position
1244 AT_SETUP([compressed data])
1245 AT_KEYWORDS([sack synthetic system file positive])
1246 AT_DATA([sys-file.sack], [dnl
1248 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1250 6; dnl Nominal case size
1251 1; dnl Simple compression
1253 -1; dnl Unspecified number of cases.
1255 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1258 dnl Numeric variables.
1259 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1260 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1262 dnl String variable.
1263 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1264 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1265 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1266 2; -1; 0; 0; 0; 0; s8 "";
1268 dnl Character encoding record.
1269 7; 20; 1; 12; "windows-1252";
1271 dnl Dictionary termination record.
1274 dnl Compressed data.
1275 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1276 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1277 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1278 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1281 for variant in be le; do
1282 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1283 AT_DATA([sys-file.sps], [dnl
1284 GET FILE='sys-file.sav'.
1288 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1289 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1290 Variable,Description,,Position
1291 num1,Format: F8.0,,1
1292 num2,Format: F8.0,,2
1295 str15,Format: A15,,5
1298 num1,num2,str4,str8,str15
1299 -99,0,,abcdefgh,0123 @&t@
1300 .,151,jklm,nopqrstu,vwxyzABC @&t@
1301 1,2,DEFG,HIJKLMNO,PQRSTUV
1306 AT_SETUP([compressed data, zero bias])
1307 AT_KEYWORDS([sack synthetic system file positive])
1308 AT_DATA([sys-file.sack], [dnl
1310 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1312 6; dnl Nominal case size
1313 1; dnl Simple compression.
1315 -1; dnl Unspecified number of cases.
1317 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1320 dnl Numeric variables.
1321 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1322 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1324 dnl String variable.
1325 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1326 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1327 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1328 2; -1; 0; 0; 0; 0; s8 "";
1330 dnl Character encoding record.
1331 7; 20; 1; 12; "windows-1252";
1333 dnl Dictionary termination record.
1336 dnl Compressed data.
1337 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1338 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1339 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1340 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1343 for variant in be le; do
1344 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1345 AT_DATA([sys-file.sps], [dnl
1346 GET FILE='sys-file.sav'.
1350 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1351 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1352 Variable,Description,,Position
1353 num1,Format: F8.0,,1
1354 num2,Format: F8.0,,2
1357 str15,Format: A15,,5
1360 num1,num2,str4,str8,str15
1361 1,100,,abcdefgh,0123 @&t@
1362 .,251,jklm,nopqrstu,vwxyzABC @&t@
1363 101,102,DEFG,HIJKLMNO,PQRSTUV
1368 AT_SETUP([compressed data, other bias])
1369 AT_KEYWORDS([sack synthetic system file positive])
1370 AT_DATA([sys-file.sack], [dnl
1372 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1374 6; dnl Nominal case size
1375 1; dnl Simple compression.
1377 -1; dnl Unspecified number of cases.
1379 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1382 dnl Numeric variables.
1383 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1384 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1386 dnl String variable.
1387 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1388 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1389 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1390 2; -1; 0; 0; 0; 0; s8 "";
1392 dnl Character encoding record.
1393 7; 20; 1; 12; "windows-1252";
1395 dnl Dictionary termination record.
1398 dnl Compressed data.
1399 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1400 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1401 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1402 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1405 for variant in be le; do
1406 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1407 AT_DATA([sys-file.sps], [dnl
1408 GET FILE='sys-file.sav'.
1412 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0],
1413 [warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1415 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1416 "warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1418 Variable,Description,,Position
1419 num1,Format: F8.0,,1
1420 num2,Format: F8.0,,2
1423 str15,Format: A15,,5
1426 num1,num2,str4,str8,str15
1427 -49,50,,abcdefgh,0123 @&t@
1428 .,201,jklm,nopqrstu,vwxyzABC @&t@
1429 51,52,DEFG,HIJKLMNO,PQRSTUV
1434 m4_divert_push([PREPARE_TESTS])
1435 zcompressed_sack () {
1438 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1440 6; dnl Nominal case size
1441 2; dnl zlib compressed
1443 -1; dnl Unspecified number of cases.
1445 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1448 dnl Numeric variables.
1449 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1450 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1452 dnl String variable.
1453 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1454 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1455 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1456 2; -1; 0; 0; 0; 0; s8 "";
1458 dnl Character encoding record.
1459 7; 20; 1; 12; "windows-1252";
1461 dnl Dictionary termination record.
1464 dnl ZLIB data header.
1465 i64 0x194; # zheader_ofs
1466 i64 0x205; # ztrailer_ofs
1467 i64 48; # ztrailer_len
1469 dnl ZLIB data block.
1471 dnl This is the compressed form of:
1473 dnl 01 64 fe fd fe fd ff fb 61 62 63 64 65 66 67 68 |.d......abcdefgh|
1474 dnl 30 31 32 33 20 20 20 20 fd fd fd fe 65 66 fd fd |0123 ....ef..|
1475 dnl 6a 6b 6c 6d 20 20 20 20 6e 6f 70 71 72 73 74 75 |jklm nopqrstu|
1476 dnl 76 77 78 79 7a 41 42 43 44 45 46 47 20 20 20 20 |vwxyzABCDEFG |
1477 dnl 48 49 4a 4b 4c 4d 4e 4f fe fd fc 00 00 00 00 00 |HIJKLMNO........|
1478 dnl 50 51 52 53 54 55 56 57 |PQRSTUVW|
1480 dnl which is the data from the "compressed data" test.
1481 hex "78 01 63 4c f9 f7 f7 df df ff bf 13 93 92 53 52";
1482 hex "d3 d2 33 0c 0c 8d 8c 15 80 e0 ef df bf ff 52 d3";
1483 hex "fe fe cd ca ce c9 05 f1 f3 f2 0b 0a 8b 8a 4b 4a";
1484 hex "cb ca 2b 2a ab 1c 9d 9c 5d 5c dd dc 41 e2 1e 9e";
1485 hex "5e de 3e be 7e fe ff fe fe 61 00 81 80 c0 a0 e0";
1486 hex "90 d0 b0 70 00 0f 3f 23 d7";
1488 dnl ZLIB data trailer fixed header:
1489 i64 -100; # ztrailer_bias
1490 i64 0; # ztrailer_zero
1491 0x3ff000; # block_size
1494 dnl ZLIB block descriptor:
1495 i64 0x194; # uncompressed_ofs
1496 i64 0x1ac; # compressed_ofs
1497 88; # uncompressed_size
1498 89; # compressed_size
1501 m4_divert_pop([PREPARE_TESTS])
1503 AT_SETUP([zcompressed data])
1504 AT_KEYWORDS([sack synthetic system file positive zlib])
1505 zcompressed_sack > sys-file.sack
1506 for variant in be le; do
1507 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1508 AT_DATA([sys-file.sps], [dnl
1509 GET FILE='sys-file.sav'.
1513 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1514 AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1515 Variable,Description,,Position
1516 num1,Format: F8.0,,1
1517 num2,Format: F8.0,,2
1520 str15,Format: A15,,5
1523 num1,num2,str4,str8,str15
1524 -99,0,,abcdefgh,0123 @&t@
1525 .,151,jklm,nopqrstu,vwxyzABC @&t@
1526 1,2,DEFG,HIJKLMNO,PQRSTUV
1531 AT_BANNER([system file reader - negative])
1533 AT_SETUP([misplaced type 4 record])
1534 AT_KEYWORDS([sack synthetic system file negative])
1535 AT_DATA([sys-file.sack], [dnl
1537 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1538 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1540 dnl Numeric variable.
1541 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1546 for variant in be le; do
1547 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1548 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1550 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1551 [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1556 AT_SETUP([bad record type])
1557 AT_KEYWORDS([sack synthetic system file negative])
1558 AT_DATA([sys-file.sack], [dnl
1560 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1561 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1563 dnl Numeric variable.
1564 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1566 dnl Type 8 record (not a valid type).
1569 for variant in be le; do
1570 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1571 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1573 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1574 [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1579 AT_SETUP([wrong number of variable positions])
1580 AT_KEYWORDS([sack synthetic system file negative])
1581 AT_DATA([sys-file.sack], [dnl
1583 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1584 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1586 dnl Numeric variable.
1587 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1589 dnl Character encoding record.
1590 7; 20; 1; 12; "windows-1252";
1592 dnl End of dictionary.
1595 for variant in be le; do
1596 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1597 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1599 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1600 [warning: `sys-file.sav': File header claims 2 variable positions but 1 were read from file.
1605 AT_SETUP([variable name may not begin with `#'])
1606 AT_KEYWORDS([sack synthetic system file negative])
1607 AT_DATA([sys-file.sack], [dnl
1609 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1610 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1612 dnl Numeric variable.
1613 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1615 dnl Character encoding record.
1616 7; 20; 1; 12; "windows-1252";
1618 dnl End of dictionary.
1621 for variant in be le; do
1622 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1623 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1625 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1626 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `$UM1'.
1631 AT_SETUP([variable name may not be reserved word])
1632 AT_KEYWORDS([sack synthetic system file negative])
1633 AT_DATA([sys-file.sack], [dnl
1635 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1636 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1638 dnl Numeric variable.
1639 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1641 dnl Character encoding record.
1642 7; 20; 1; 12; "windows-1252";
1644 dnl End of dictionary.
1647 for variant in be le; do
1648 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1649 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1651 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1652 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `TO'.
1657 AT_SETUP([variable width must be between 0 and 255])
1658 AT_KEYWORDS([sack synthetic system file negative])
1659 AT_DATA([sys-file.sack], [dnl
1661 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1662 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1664 dnl String variable with invalid width 256.
1665 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1667 dnl Character encoding record.
1668 7; 20; 1; 12; "windows-1252";
1670 dnl End of dictionary.
1673 for variant in be le; do
1674 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1675 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1677 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1678 [error: `sys-file.sav' near offset 0xb4: Bad width 256 for variable VAR1.
1683 dnl SPSS-generated system file can contain duplicate variable names
1684 dnl (see bug #41475).
1685 AT_SETUP([duplicate variable name])
1686 AT_KEYWORDS([sack synthetic system file negative])
1687 AT_DATA([sys-file.sack], [dnl
1689 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1690 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1692 dnl Numeric variables.
1693 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1694 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1696 dnl Character encoding record.
1697 7; 20; 1; 12; "windows-1252";
1699 dnl End of dictionary.
1702 for variant in be le; do
1703 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1704 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1707 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1708 [warning: `sys-file.sav' near offset 0xd4: Renaming variable with duplicate name `VAR1' to `VAR001'.
1710 Variable,Description,,Position
1711 var1,Format: F8.0,,1
1713 ,Display Alignment: Right,,
1715 var001,Format: F8.0,,2
1717 ,Display Alignment: Right,,
1723 AT_SETUP([variable label indicator not 0 or 1])
1724 AT_KEYWORDS([sack synthetic system file negative])
1725 AT_DATA([sys-file.sack], [dnl
1727 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1728 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1730 dnl Numeric variable.
1731 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1733 dnl Character encoding record.
1734 7; 20; 1; 12; "windows-1252";
1736 dnl End of dictionary.
1739 for variant in be le; do
1740 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1741 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1743 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1744 [error: `sys-file.sav' near offset 0xb4: Variable label indicator field is not 0 or 1.
1749 AT_SETUP([invalid numeric missing value indicator])
1750 AT_KEYWORDS([sack synthetic system file negative])
1751 AT_DATA([sys-file.sack], [dnl
1753 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1754 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1756 dnl Numeric variable.
1757 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1759 dnl Character encoding record.
1760 7; 20; 1; 12; "windows-1252";
1762 dnl End of dictionary.
1765 for variant in be le; do
1766 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1767 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1769 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1770 ["error: `sys-file.sav' near offset 0xb4: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1775 AT_SETUP([invalid string missing value indicator])
1776 AT_KEYWORDS([sack synthetic system file negative])
1777 AT_DATA([sys-file.sack], [dnl
1779 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1780 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1782 dnl String variable.
1783 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1785 dnl Character encoding record.
1786 7; 20; 1; 12; "windows-1252";
1788 dnl End of dictionary.
1791 for variant in be le; do
1792 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1793 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1795 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1796 ["error: `sys-file.sav' near offset 0xb4: String missing value indicator field is not 0, 1, 2, or 3."
1801 AT_SETUP([missing string continuation record])
1802 AT_KEYWORDS([sack synthetic system file negative])
1803 AT_DATA([sys-file.sack], [dnl
1805 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1806 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1808 dnl String variable.
1809 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1810 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
1812 dnl Character encoding record.
1813 7; 20; 1; 12; "windows-1252";
1815 dnl End of dictionary.
1818 for variant in be le; do
1819 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1820 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1822 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1823 [error: `sys-file.sav' near offset 0xb4: Missing string continuation record.
1828 AT_SETUP([invalid variable format])
1829 AT_KEYWORDS([sack synthetic system file negative])
1830 AT_DATA([sys-file.sack], [dnl
1832 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1833 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1835 dnl Numeric variable, invalid format types.
1836 dnl No warning is issued for type 0 because it has been observed in real
1838 2; 0; 0; 0; >>0xff0800; 0<<; s8 "NUM1";
1840 dnl Numeric variable, string formats.
1841 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
1843 dnl String variable, numeric formats.
1844 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
1846 dnl String variable, wrong width formats.
1847 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
1849 dnl Character encoding record.
1850 7; 20; 1; 12; "windows-1252";
1852 dnl End of dictionary.
1855 for variant in be le; do
1856 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1857 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1859 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1860 warning: `sys-file.sav' near offset 0xc0: Variable NUM1 with width 0 has invalid print format 0xff0800.
1862 warning: `sys-file.sav' near offset 0xe0: Variable VAR1 with width 0 has invalid print format 0x10800.
1864 warning: `sys-file.sav' near offset 0xe4: Variable VAR1 with width 0 has invalid write format 0x21000.
1866 warning: `sys-file.sav' near offset 0x100: Variable STR1 with width 4 has invalid print format 0x50800.
1868 warning: `sys-file.sav' near offset 0x104: Variable STR1 with width 4 has invalid write format 0x110a01.
1870 warning: `sys-file.sav' near offset 0x120: Variable STR2 with width 4 has invalid print format 0x10800.
1872 warning: `sys-file.sav' near offset 0x124: Variable STR2 with width 4 has invalid write format 0x20400.
1877 AT_SETUP([invalid long string missing values])
1878 AT_KEYWORDS([sack synthetic system file negative])
1879 AT_DATA([sys-file.sack], [dnl
1881 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1883 7; dnl Nominal case size
1884 0; dnl Not compressed
1888 "01 Jan 11"; "20:53:52";
1889 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1892 dnl One numeric variable.
1893 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1895 dnl Long string variables that will have missing values added with a
1897 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
1898 2; -1; 0; 0; 0; 0; s8 "";
1899 2; 10; 0; 0; 0x010a00 *2; s8 "STR2";
1900 2; -1; 0; 0; 0; 0; s8 "";
1901 2; 11; 0; 0; 0x010b00 *2; s8 "STR3";
1902 2; -1; 0; 0; 0; 0; s8 "";
1904 dnl Machine integer info record.
1905 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1907 dnl Machine floating-point info record.
1908 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
1910 dnl Long string variable missing values record.
1912 dnl Zero missing values (not allowed) for STR1 .
1913 COUNT("STR1"); i8 >>0<<;
1915 dnl Four missing values (not allowed) for STR2.
1916 COUNT("STR2"); i8 4;
1917 8; "abcdefgh"; 8; "ijklmnop"; 8; "qrstuvwx"; 8; "yz012345";
1919 dnl Missing values for unknown variable
1920 COUNT(>>"Nonexistent"<<); i8 1; 8; "abcdefgh";
1922 dnl Missing values for numeric variable
1923 COUNT(>>"NUM1"<<); i8 1; 8; "abcdefgh";
1925 dnl Too long missing value
1926 COUNT("STR3"); i8 1; >>COUNT("abcdefghijkl")<<;
1929 dnl Character encoding record.
1930 7; 20; 1; 12; "windows-1252";
1932 dnl Dictionary termination record.
1934 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
1935 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
1936 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
1939 for variant in be le; do
1940 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1941 AT_DATA([sys-file.sps], [dnl
1942 GET FILE='sys-file.sav'.
1945 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1946 ["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."
1948 "warning: `sys-file.sav' near offset 0x201: Long string missing values record says variable STR2 has 4 missing values, but only 1 to 3 missing values are allowed."
1950 warning: `sys-file.sav' near offset 0x242: Ignoring long string missing value record for unknown variable Nonexistent.
1952 warning: `sys-file.sav' near offset 0x257: Ignoring long string missing value record for numeric variable NUM1.
1954 "warning: `sys-file.sav' near offset 0x270: Ignoring long string missing value 0 for variable str3, with width 11, that has bad value width 12."
1956 Variable,Description,,Position
1957 num1,Format: F8.0,,1
1959 ,Display Alignment: Right,,
1963 ,Display Alignment: Left,,
1967 ,Display Alignment: Left,,
1968 ,Display Width: 10,,
1969 ,"Missing Values: ""abcdefgh""; ""ijklmnop""; ""qrstuvwx""",,
1972 ,Display Alignment: Left,,
1973 ,Display Width: 11,,
1978 AT_SETUP([weighting variable must be numeric])
1979 AT_KEYWORDS([sack synthetic system file negative])
1980 AT_DATA([sys-file.sack], [dnl
1982 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1983 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1985 dnl Numeric variable.
1986 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1988 dnl String variable.
1989 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
1991 dnl Character encoding record.
1992 7; 20; 1; 12; "windows-1252";
1994 dnl End of dictionary.
1997 for variant in be le; do
1998 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1999 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2002 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2003 [warning: `sys-file.sav': Ignoring string variable `STR1' set as weighting variable.
2005 Variable,Description,,Position
2006 num1,Format: F8.0,,1
2008 ,Display Alignment: Right,,
2012 ,Display Alignment: Left,,
2018 AT_SETUP([bad weighting variable index])
2019 AT_KEYWORDS([sack synthetic system file negative])
2020 AT_DATA([sys-file.sack], [dnl
2022 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2023 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2025 dnl Numeric variable.
2026 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2028 dnl String variable.
2029 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2031 dnl Character encoding record.
2032 7; 20; 1; 12; "windows-1252";
2034 dnl End of dictionary.
2037 for variant in be le; do
2038 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2039 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2041 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2042 [error: `sys-file.sav' near offset 0x4c: Variable index 3 not in valid range 1...2.
2047 AT_SETUP([variable index is long string contination])
2048 AT_KEYWORDS([sack synthetic system file negative])
2049 AT_DATA([sys-file.sack], [dnl
2051 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2052 2; 3; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2054 dnl Numeric variable.
2055 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2057 dnl Long string variable.
2058 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2059 (2; -1; 0; 0; 0; 0; s8 "");
2061 dnl Character encoding record.
2062 7; 20; 1; 12; "windows-1252";
2064 dnl End of dictionary.
2067 for variant in be le; do
2068 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2069 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2071 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2072 [error: `sys-file.sav' near offset 0x4c: Variable index 3 refers to long string continuation.
2077 AT_SETUP([multiple documents records])
2078 AT_KEYWORDS([sack synthetic system file negative])
2079 AT_DATA([sys-file.sack], [dnl
2081 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2082 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2084 dnl Numeric variable, no label or missing values.
2085 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2087 dnl Two document records.
2088 (6; 1; s80 "One line of documents") >>* 2<<;
2090 dnl Dictionary termination record.
2093 dnl Character encoding record.
2094 7; 20; 1; 12; "windows-1252";
2099 for variant in be le; do
2100 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2101 AT_DATA([sys-file.sps], [dnl
2102 GET FILE='sys-file.sav'.
2104 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2105 error: `sys-file.sav' near offset 0x12c: Duplicate type 6 (document) record.
2111 AT_SETUP([empty document record])
2112 AT_KEYWORDS([sack synthetic system file negative])
2113 AT_DATA([sys-file.sack], [dnl
2115 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2116 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2118 dnl Numeric variable, no label or missing values.
2119 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2121 dnl Empty document record.
2124 dnl Dictionary termination record.
2130 for variant in be le; do
2131 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2132 AT_DATA([sys-file.sps], [dnl
2133 GET FILE='sys-file.sav'.
2135 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2136 error: `sys-file.sav' near offset 0xd4: Number of document lines (0) must be greater than 0 and less than 26843545.
2141 AT_SETUP([extension record too large])
2142 AT_KEYWORDS([sack synthetic system file negative])
2143 AT_DATA([sys-file.sack], [dnl
2145 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2146 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2148 dnl Numeric variable, no label or missing values.
2149 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2151 dnl Too-large extension record.
2152 7; 3; >>0xfffff000 * 2<<;
2154 for variant in be le; do
2155 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2156 AT_DATA([sys-file.sps], [dnl
2157 GET FILE='sys-file.sav'.
2159 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2160 error: `sys-file.sav' near offset 0xd8: Record type 7 subtype 3 too large.
2165 AT_SETUP([unknown extension record])
2166 AT_KEYWORDS([sack synthetic system file negative])
2167 AT_DATA([sys-file.sack], [dnl
2169 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2170 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2172 dnl Numeric variable, no label or missing values.
2173 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2175 dnl Unknown extension record type.
2178 dnl Character encoding record.
2179 7; 20; 1; 12; "windows-1252";
2181 dnl End of dictionary.
2184 for variant in be le; do
2185 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2186 AT_DATA([sys-file.sps], [dnl
2187 GET FILE='sys-file.sav'.
2189 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2190 "warning: `sys-file.sav' near offset 0xd8: Unrecognized record type 7, subtype 30. Please send a copy of this file, and the syntax which created it to bug-gnu-pspp@gnu.org."
2195 AT_SETUP([bad machine integer info size])
2196 AT_KEYWORDS([sack synthetic system file negative])
2197 AT_DATA([sys-file.sack], [dnl
2199 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2200 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2202 dnl Numeric variable, no label or missing values.
2203 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2205 dnl Machine integer info record.
2206 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252; >>1234<<;
2208 dnl Character encoding record.
2209 7; 20; 1; 12; "windows-1252";
2211 dnl End of dictionary.
2214 for variant in be le; do
2215 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2216 AT_DATA([sys-file.sps], [dnl
2217 GET FILE='sys-file.sav'.
2219 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2220 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 3 has bad count 9 (expected 8)."
2225 AT_SETUP([bad machine integer info float format])
2226 AT_KEYWORDS([sack synthetic system file negative])
2227 AT_DATA([sys-file.sack], [dnl
2229 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2230 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2232 dnl Numeric variable, no label or missing values.
2233 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2235 dnl Machine integer info record.
2236 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
2238 dnl Character encoding record.
2239 7; 20; 1; 12; "windows-1252";
2241 dnl End of dictionary.
2244 for variant in be le; do
2245 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2246 AT_DATA([sys-file.sps], [dnl
2247 GET FILE='sys-file.sav'.
2249 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2250 error: `sys-file.sav' near offset 0xd8: Floating-point representation indicated by system file (2) differs from expected (1).
2255 AT_SETUP([bad machine integer info endianness])
2256 AT_KEYWORDS([sack synthetic system file negative])
2257 AT_DATA([sys-file.sack], [dnl
2259 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2260 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2262 dnl Numeric variable, no label or missing values.
2263 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2265 dnl Machine integer info record.
2266 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
2268 dnl Character encoding record.
2269 7; 20; 1; 12; "windows-1252";
2271 dnl End of dictionary.
2274 for variant in "be 1" "le 2"; do
2276 AT_CHECK([sack --$[1] sys-file.sack > sys-file.sav])
2277 AT_DATA([sys-file.sps], [dnl
2278 GET FILE='sys-file.sav'.
2281 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2282 warning: \`sys-file.sav' near offset 0xd8: Integer format indicated by system file (3) differs from expected ($[2]).
2284 Variable,Description,,Position
2285 num1,Format: F8.0,,1
2287 ,Display Alignment: Right,,
2294 AT_SETUP([bad machine floating-point info size])
2295 AT_KEYWORDS([sack synthetic system file negative])
2296 AT_DATA([sys-file.sack], [dnl
2298 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2299 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2301 dnl Numeric variable, no label or missing values.
2302 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2304 dnl Machine floating-point info record.
2305 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2307 dnl Character encoding record.
2308 7; 20; 1; 12; "windows-1252";
2310 dnl End of dictionary.
2313 for variant in be le; do
2314 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2315 AT_DATA([sys-file.sps], [dnl
2316 GET FILE='sys-file.sav'.
2318 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2319 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 4 has bad count 4 (expected 3)."
2324 AT_SETUP([wrong special floating point values])
2325 AT_KEYWORDS([sack synthetic system file negative])
2326 AT_DATA([sys-file.sack], [dnl
2328 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2329 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2331 dnl Numeric variable, no label or missing values.
2332 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2334 dnl Machine floating-point info record.
2335 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2337 dnl Character encoding record.
2338 7; 20; 1; 12; "windows-1252";
2340 dnl End of dictionary.
2343 for variant in be le; do
2344 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2345 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2347 AT_CHECK([pspp -O format=csv sys-file.sps | sed 's/ [(].*/.../'], [0], [dnl
2348 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 0...
2350 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 1...
2352 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 2...
2357 AT_SETUP([bad mrsets name])
2358 AT_KEYWORDS([sack synthetic system file negative multiple response])
2359 AT_DATA([sys-file.sack], [dnl
2361 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2363 16; dnl Nominal case size
2364 0; dnl Not compressed
2368 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2372 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2373 2; 0; 0; 0; 0x050800 *2; s8 "B";
2374 2; 0; 0; 0; 0x050800 *2; s8 "C";
2377 2; 0; 0; 0; 0x050800 *2; s8 "D";
2378 2; 0; 0; 0; 0x050800 *2; s8 "E";
2379 2; 0; 0; 0; 0x050800 *2; s8 "F";
2380 2; 0; 0; 0; 0x050800 *2; s8 "G";
2383 2; 4; 0; 0; 0x010400 *2; s8 "H";
2384 2; 4; 0; 0; 0x010400 *2; s8 "I";
2385 2; 4; 0; 0; 0x010400 *2; s8 "J";
2388 2; 0; 0; 0; 0x050800 *2; s8 "K";
2389 2; 0; 0; 0; 0x050800 *2; s8 "L";
2390 2; 0; 0; 0; 0x050800 *2; s8 "M";
2393 2; 6; 0; 0; 0x010600 *2; s8 "N";
2394 2; 6; 0; 0; 0x010600 *2; s8 "O";
2395 2; 6; 0; 0; 0x010600 *2; s8 "P";
2397 dnl Machine integer info record.
2398 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2402 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
2403 "b=D2 55 0 g e f d"; i8 10;
2404 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
2408 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
2409 "e=E 11 6 choice 0 n o p"; i8 10);
2411 dnl Character encoding record.
2412 7; 20; 1; 9; "shift_jis";
2414 dnl Dictionary termination record.
2417 for variant in be le; do
2418 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2419 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2420 MRSETS /DISPLAY NAME=ALL.
2422 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2423 warning: `sys-file.sav': Multiple response set name `b' does not begin with `$'.
2425 warning: `sys-file.sav': Multiple response set name `e' does not begin with `$'.
2427 Table: Multiple Response Sets
2428 Name,Variables,Details
2432 ","Multiple category set
2438 ","Multiple dichotomy set
2440 Label source: Provided by user
2442 Category label source: Variable labels
2447 ","Multiple dichotomy set
2448 Label: third mdgroup
2449 Label source: Provided by user
2451 Category label source: Value labels of counted value
2457 AT_SETUP([missing space after C in mrsets])
2458 AT_KEYWORDS([sack synthetic system file negative multiple response])
2459 AT_DATA([sys-file.sack], [dnl
2461 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2462 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2464 dnl Numeric variable, no label or missing values.
2465 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2467 dnl Multiple response sets.
2468 7; 7; 1; COUNT("$a=Cx");
2470 dnl Character encoding record.
2471 7; 20; 1; 12; "windows-1252";
2475 for variant in be le; do
2476 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2477 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2479 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2480 warning: `sys-file.sav' near offset 0xd8: Missing space following `C' at offset 4 in MRSETS record.
2485 AT_SETUP([missing space after E in mrsets])
2486 AT_KEYWORDS([sack synthetic system file negative multiple response])
2487 AT_DATA([sys-file.sack], [dnl
2489 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2490 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2492 dnl Numeric variable, no label or missing values.
2493 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2495 dnl Multiple response sets.
2496 7; 7; 1; COUNT("$a=Ex");
2498 dnl Character encoding record.
2499 7; 20; 1; 12; "windows-1252";
2503 for variant in be le; do
2504 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2505 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2507 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2508 warning: `sys-file.sav' near offset 0xd8: Missing space following `E' at offset 4 in MRSETS record.
2513 AT_SETUP([unexpected label source in mrsets])
2514 AT_KEYWORDS([sack synthetic system file negative multiple response])
2515 AT_DATA([sys-file.sack], [dnl
2517 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2518 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2520 dnl Numeric variable, no label or missing values.
2521 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2523 dnl Multiple response sets.
2524 7; 7; 1; COUNT("$a=E 2");
2526 dnl Character encoding record.
2527 7; 20; 1; 12; "windows-1252";
2531 for variant in be le; do
2532 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2533 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2535 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2536 warning: `sys-file.sav' near offset 0xd8: Unexpected label source value following `E' at offset 7 in MRSETS record.
2538 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 7 in MRSETS record.
2543 AT_SETUP([bad type character in mrsets])
2544 AT_KEYWORDS([sack synthetic system file negative multiple response])
2545 AT_DATA([sys-file.sack], [dnl
2547 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2548 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2550 dnl Numeric variable, no label or missing values.
2551 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2553 dnl Multiple response sets.
2554 7; 7; 1; COUNT("$a=");
2556 dnl Character encoding record.
2557 7; 20; 1; 12; "windows-1252";
2561 for variant in be le; do
2562 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2563 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2565 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2566 "warning: `sys-file.sav' near offset 0xd8: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2571 AT_SETUP([bad counted string length in mrsets])
2572 AT_KEYWORDS([sack synthetic system file negative multiple response])
2573 AT_DATA([sys-file.sack], [dnl
2575 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2576 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2578 dnl Numeric variable, no label or missing values.
2579 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2581 dnl Multiple response sets.
2582 7; 7; 1; COUNT("$a=Dx");
2584 dnl Character encoding record.
2585 7; 20; 1; 12; "windows-1252";
2589 for variant in be le; do
2590 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2591 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2593 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2594 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 4 in MRSETS record.
2599 AT_SETUP([missing space in counted string in mrsets])
2600 AT_KEYWORDS([sack synthetic system file negative multiple response])
2601 AT_DATA([sys-file.sack], [dnl
2603 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2604 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2606 dnl Numeric variable, no label or missing values.
2607 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2609 dnl Multiple response sets.
2610 7; 7; 1; COUNT("$a=D1x");
2612 dnl Character encoding record.
2613 7; 20; 1; 12; "windows-1252";
2617 for variant in be le; do
2618 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2619 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2621 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2622 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 5 in MRSETS record.
2627 AT_SETUP([counted string too long in mrsets])
2628 AT_KEYWORDS([sack synthetic system file negative multiple response])
2629 AT_DATA([sys-file.sack], [dnl
2631 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2632 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2634 dnl Numeric variable, no label or missing values.
2635 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2637 dnl Multiple response sets.
2638 7; 7; 1; COUNT("$a=D4 abc");
2640 dnl Character encoding record.
2641 7; 20; 1; 12; "windows-1252";
2645 for variant in be le; do
2646 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2647 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2649 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2650 warning: `sys-file.sav' near offset 0xd8: 4-byte string starting at offset 6 exceeds record length 9.
2655 AT_SETUP([missing space after counted string in mrsets])
2656 AT_KEYWORDS([sack synthetic system file negative multiple response])
2657 AT_DATA([sys-file.sack], [dnl
2659 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2660 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2662 dnl Numeric variable, no label or missing values.
2663 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2665 dnl Multiple response sets.
2666 7; 7; 1; COUNT("$a=D3 abcx");
2668 dnl Character encoding record.
2669 7; 20; 1; 12; "windows-1252";
2673 for variant in be le; do
2674 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2675 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2677 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2678 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 9 following 3-byte string.
2683 AT_SETUP([missing newline after variable name in mrsets])
2684 AT_KEYWORDS([sack synthetic system file negative multiple response])
2685 AT_DATA([sys-file.sack], [dnl
2687 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2688 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2690 dnl Numeric variable, no label or missing values.
2691 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2693 dnl Multiple response sets.
2694 7; 7; 1; COUNT("$a=C 0 NUM1");
2696 dnl Character encoding record.
2697 7; 20; 1; 12; "windows-1252";
2701 for variant in be le; do
2702 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2703 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2705 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2706 warning: `sys-file.sav' near offset 0xd8: Missing new-line parsing variable names at offset 13 in MRSETS record.
2708 warning: `sys-file.sav': MRSET $a has only one variable.
2713 AT_SETUP([duplicate variable name in mrsets])
2714 AT_KEYWORDS([sack synthetic system file negative multiple response])
2715 AT_DATA([sys-file.sack], [dnl
2717 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2718 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2720 dnl Numeric variable, no label or missing values.
2721 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2723 dnl Multiple response sets.
2724 7; 7; 1; COUNT("$a=C 0 NUM1 NUM1"; i8 10);
2726 dnl Character encoding record.
2727 7; 20; 1; 12; "windows-1252";
2731 for variant in be le; do
2732 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2733 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2735 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2736 warning: `sys-file.sav': MRSET $a contains duplicate variable name NUM1.
2738 warning: `sys-file.sav': MRSET $a has only one variable.
2743 AT_SETUP([mixed variable types in mrsets])
2744 AT_KEYWORDS([sack synthetic system file negative multiple response])
2745 AT_DATA([sys-file.sack], [dnl
2747 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2748 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2751 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2752 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2754 dnl Multiple response sets.
2755 7; 7; 1; COUNT("$a=C 0 NUM1 STR1"; i8 10);
2757 dnl Character encoding record.
2758 7; 20; 1; 12; "windows-1252";
2762 for variant in be le; do
2763 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2764 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2766 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2767 warning: `sys-file.sav': MRSET $a contains both string and numeric variables.
2769 warning: `sys-file.sav': MRSET $a has only one variable.
2774 AT_SETUP([missing newline after variable name in mrsets])
2775 AT_KEYWORDS([sack synthetic system file negative multiple response])
2776 AT_DATA([sys-file.sack], [dnl
2778 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2779 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2781 dnl Numeric variable, no label or missing values.
2782 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2784 dnl Multiple response sets.
2785 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10);
2787 dnl Character encoding record.
2788 7; 20; 1; 12; "windows-1252";
2792 for variant in be le; do
2793 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2794 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2796 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2797 warning: `sys-file.sav': MRSET $a has only one variable.
2802 AT_SETUP([zero or one variable in mrset])
2803 AT_KEYWORDS([sack synthetic system file negative multiple response])
2804 AT_DATA([sys-file.sack], [dnl
2806 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2807 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2809 dnl Numeric variable, no label or missing values.
2810 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2812 dnl Multiple response sets.
2813 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10; "$b=C 0 "; i8 10);
2815 dnl Character encoding record.
2816 7; 20; 1; 12; "windows-1252";
2820 for variant in be le; do
2821 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2822 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2824 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2825 warning: `sys-file.sav': MRSET $a has only one variable.
2827 warning: `sys-file.sav': MRSET $b has no variables.
2832 AT_SETUP([wrong display parameter size])
2833 AT_KEYWORDS([sack synthetic system file negative])
2834 AT_DATA([sys-file.sack], [dnl
2836 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2837 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2839 dnl Numeric variable, no label or missing values.
2840 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2842 dnl Display parameters record.
2843 7; 11; >>8<<; 2; 1.0; 1.0;
2845 dnl Character encoding record.
2846 7; 20; 1; 12; "windows-1252";
2848 dnl End of dictionary.
2851 for variant in be le; do
2852 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2853 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2855 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2856 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 11 has bad size 8 (expected 4)."
2861 AT_SETUP([wrong display parameter count])
2862 AT_KEYWORDS([sack synthetic system file negative])
2863 AT_DATA([sys-file.sack], [dnl
2865 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2866 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2868 dnl Numeric variable, no label or missing values.
2869 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2871 dnl Display parameters record.
2872 7; 11; 4; >>4<<; 1; 1; 2; 2;
2874 dnl Character encoding record.
2875 7; 20; 1; 12; "windows-1252";
2877 dnl End of dictionary.
2880 for variant in be le; do
2881 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2882 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2884 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2885 warning: `sys-file.sav' near offset 0xd8: Extension 11 has bad count 4 (for 1 variables).
2890 AT_SETUP([wrong display measurement level])
2891 AT_KEYWORDS([sack synthetic system file negative])
2892 AT_DATA([sys-file.sack], [dnl
2894 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2895 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2897 dnl Numeric variable, no label or missing values.
2898 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2900 dnl Display parameters record.
2901 7; 11; 4; 2; >>4<<; 0;
2903 dnl Character encoding record.
2904 7; 20; 1; 12; "windows-1252";
2906 dnl End of dictionary.
2909 for variant in be le; do
2910 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2911 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2913 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2914 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
2919 AT_SETUP([wrong display alignment])
2920 AT_KEYWORDS([sack synthetic system file negative])
2921 AT_DATA([sys-file.sack], [dnl
2923 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2924 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2926 dnl Numeric variable, no label or missing values.
2927 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2929 dnl Display parameters record.
2930 7; 11; 4; 2; 1; >>-1<<;
2932 dnl Character encoding record.
2933 7; 20; 1; 12; "windows-1252";
2935 dnl End of dictionary.
2938 for variant in be le; do
2939 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2940 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2942 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2943 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
2948 AT_SETUP([bad variable name in variable/value pair])
2949 AT_KEYWORDS([sack synthetic system file negative])
2950 AT_DATA([sys-file.sack], [dnl
2952 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2953 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2955 dnl Numeric variables.
2956 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2958 dnl Long variable names.
2959 7; 13; 1; COUNT (>>"xyzzy"<<);
2961 dnl Character encoding record.
2962 7; 20; 1; 12; "windows-1252";
2964 dnl Dictionary termination record.
2967 for variant in be le; do
2968 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2969 AT_DATA([sys-file.sps], [dnl
2970 GET FILE='sys-file.sav'.
2972 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2973 warning: `sys-file.sav' near offset 0xde: Dictionary record refers to unknown variable xyzzy.
2978 AT_SETUP([duplicate long variable name])
2979 AT_KEYWORDS([sack synthetic system file negative])
2980 AT_DATA([sys-file.sack], [dnl
2982 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2983 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2985 dnl Numeric variables.
2986 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2987 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
2988 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
2989 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
2991 dnl Long variable names.
2993 "LONGVARI=_Invalid"; i8 9;
2994 "LONGVA_A=LongVariableName"; i8 9;
2995 "LONGVA_B=LONGVARIABLENAME"; i8 9;
2998 dnl Character encoding record.
2999 7; 20; 1; 12; "windows-1252";
3001 dnl Dictionary termination record.
3004 for variant in be le; do
3005 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3006 AT_DATA([sys-file.sps], [dnl
3007 GET FILE='sys-file.sav'.
3009 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3010 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
3012 warning: `sys-file.sav' near offset 0x138: Duplicate long variable name `LONGVARIABLENAME'.
3017 AT_SETUP([bad very long string length])
3018 AT_KEYWORDS([sack synthetic system file negative])
3019 AT_DATA([sys-file.sack], [dnl
3021 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3022 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3024 dnl Numeric variable.
3025 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3027 dnl Very long string map.
3029 "NUM1=00000"; i8 0; i8 9;
3030 "NUM1=00255"; i8 0; i8 9;
3031 "NUM1=00256"; i8 0; i8 9;
3034 dnl Character encoding record.
3035 7; 20; 1; 12; "windows-1252";
3037 dnl Dictionary termination record.
3040 for variant in be le; do
3041 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3042 AT_DATA([sys-file.sps], [dnl
3043 GET FILE='sys-file.sav'.
3045 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3046 warning: `sys-file.sav' near offset 0xd8: NUM1 listed as string of invalid length 00000 in very long string record.
3048 "warning: `sys-file.sav' near offset 0xd8: NUM1 listed in very long string record with width 00255, which requires only one segment."
3050 error: `sys-file.sav' near offset 0xd8: Very long string NUM1 overflows dictionary.
3055 AT_SETUP([bad very long string segment width])
3056 AT_KEYWORDS([sack synthetic system file negative])
3057 AT_DATA([sys-file.sack], [dnl
3059 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3060 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3063 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
3064 (2; -1; 0; 0; 0; 0; s8 "") * 31;
3065 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
3066 >>2; -1; 0; 0; 0; 0; s8 "";<<
3068 dnl Very long string map.
3070 "STR1=00256"; i8 0; i8 9;
3073 dnl Character encoding record.
3074 7; 20; 1; 12; "windows-1252";
3076 dnl Dictionary termination record.
3079 for variant in be le; do
3080 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3081 AT_DATA([sys-file.sps], [dnl
3082 GET FILE='sys-file.sav'.
3084 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3085 error: `sys-file.sav' near offset 0x4f8: Very long string with width 256 has segment 1 of width 9 (expected 4).
3090 AT_SETUP([too many value labels])
3091 dnl Skip the test if multiplying a small number by INT32_MAX would not
3092 dnl cause an overflow in size_t.
3093 AT_SKIP_IF([test $SIZEOF_SIZE_T -gt 4])
3094 AT_KEYWORDS([sack synthetic system file negative])
3095 AT_DATA([sys-file.sack], [dnl
3097 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3098 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3100 dnl Numeric variable.
3101 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3104 for variant in be le; do
3105 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3106 AT_DATA([sys-file.sps], [dnl
3107 GET FILE='sys-file.sav'.
3109 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3110 error: `sys-file.sav' near offset 0xd4: Invalid number of labels 2147483647.
3115 AT_SETUP([missing type 4 record])
3116 AT_KEYWORDS([sack synthetic system file negative])
3117 AT_DATA([sys-file.sack], [dnl
3119 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3120 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3122 dnl Numeric variable.
3123 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3125 dnl Value label with missing type 4 record.
3126 3; 1; 1.0; i8 3; s7 "one";
3128 dnl Character encoding record.
3129 7; 20; 1; 12; "windows-1252";
3131 dnl End of dictionary.
3134 for variant in be le; do
3135 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3136 AT_DATA([sys-file.sps], [dnl
3137 GET FILE='sys-file.sav'.
3139 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3140 error: `sys-file.sav' near offset 0xe8: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
3145 AT_SETUP([value label with no associated variables])
3146 AT_KEYWORDS([sack synthetic system file negative])
3147 AT_DATA([sys-file.sack], [dnl
3149 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3150 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3152 dnl Numeric variable.
3153 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3155 dnl Value label with no variables.
3156 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
3158 for variant in be le; do
3159 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3160 AT_DATA([sys-file.sps], [dnl
3161 GET FILE='sys-file.sav'.
3163 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3164 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).
3169 AT_SETUP([type 4 record names long string variable])
3170 AT_KEYWORDS([sack synthetic system file negative])
3171 AT_DATA([sys-file.sack], [dnl
3173 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3174 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3176 dnl Long string variable.
3177 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3178 2; -1; 0; 0; 0; 0; s8 "";
3180 dnl Value label that names long string variable.
3181 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
3183 dnl Character encoding record.
3184 7; 20; 1; 12; "windows-1252";
3186 dnl End of dictionary.
3189 for variant in be le; do
3190 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3191 AT_DATA([sys-file.sps], [dnl
3192 GET FILE='sys-file.sav'.
3194 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3195 error: `sys-file.sav' near offset 0xf4: Value labels may not be added to long string variables (e.g. STR1) using records types 3 and 4.
3200 AT_SETUP([variables for value label must all be same type])
3201 AT_KEYWORDS([sack synthetic system file negative])
3202 AT_DATA([sys-file.sack], [dnl
3204 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3205 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3208 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3209 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3211 dnl Value label that names numeric and string variables.
3212 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
3214 dnl Character encoding record.
3215 7; 20; 1; 12; "windows-1252";
3217 dnl End of dictionary.
3220 for variant in be le; do
3221 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3222 AT_DATA([sys-file.sps], [dnl
3223 GET FILE='sys-file.sav'.
3225 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3226 "error: `sys-file.sav' near offset 0xf4: Variables associated with value label are not all of identical type. Variable STR1 is string, but variable NUM1 is numeric."
3231 AT_SETUP([duplicate value labels type])
3232 AT_KEYWORDS([sack synthetic system file negative])
3233 AT_DATA([sys-file.sack], [dnl
3235 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3236 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3239 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3240 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3242 dnl Duplicate value labels.
3243 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
3244 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
3246 dnl Character encoding record.
3247 7; 20; 1; 12; "windows-1252";
3249 dnl End of dictionary.
3252 for variant in be le; do
3253 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3254 AT_DATA([sys-file.sps], [dnl
3255 GET FILE='sys-file.sav'.
3257 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3258 warning: `sys-file.sav' near offset 0xf4: Duplicate value label for `xyzzy ' on STR1.
3260 warning: `sys-file.sav' near offset 0x11c: Duplicate value label for 1 on NUM1.
3265 AT_SETUP([missing attribute value])
3266 AT_KEYWORDS([sack synthetic system file negative])
3267 AT_DATA([sys-file.sack], [dnl
3269 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3270 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3273 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3275 dnl Data file attributes record.
3280 dnl Variable attributes record.
3286 dnl Character encoding record.
3287 7; 20; 1; 12; "windows-1252";
3289 dnl Dictionary termination record.
3292 for variant in be le; do
3293 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3294 AT_DATA([sys-file.sps], [dnl
3295 GET FILE='sys-file.sav'.
3297 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3298 warning: `sys-file.sav' near offset 0xde: Error parsing attribute value Attr1[[1]].
3300 warning: `sys-file.sav' near offset 0x101: Error parsing attribute value fred[[2]].
3305 AT_SETUP([unquoted attribute value])
3306 AT_KEYWORDS([sack synthetic system file negative])
3307 AT_DATA([sys-file.sack], [dnl
3309 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3310 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3313 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3315 dnl Data file attributes record.
3317 "Attr1(value"; i8 10;
3321 dnl Variable attributes record.
3324 "fred(23"; i8 10; ")"
3327 dnl Character encoding record.
3328 7; 20; 1; 12; "windows-1252";
3330 dnl Dictionary termination record.
3333 for variant in be le; do
3334 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3335 AT_DATA([sys-file.sps], [dnl
3336 GET FILE='sys-file.sav'.
3338 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3339 warning: `sys-file.sav' near offset 0xe4: Attribute value Attr1[[1]] is not quoted: value.
3341 warning: `sys-file.sav' near offset 0x106: Attribute value fred[[1]] is not quoted: 23.
3346 AT_SETUP([bad variable name in long string value label])
3347 AT_KEYWORDS([sack synthetic system file negative])
3348 AT_DATA([sys-file.sack], [dnl
3350 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3351 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3354 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3355 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3356 2; -1; 0; 0; 0; 0; s8 "";
3359 dnl No variable named STR9.
3360 COUNT(>>"STR9"<<); 9;
3361 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3363 dnl NUM1 is numeric.
3364 COUNT(>>"NUM1"<<); 0;
3365 1; COUNT("xyz"); COUNT("value label for 1.0");
3367 dnl Wrong width for STR14.
3368 COUNT("STR14"); >>9<<;
3369 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3371 dnl Wrong width for value.
3373 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3375 dnl Duplicate value label.
3376 COUNT("STR14"); 14; 2;
3377 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3378 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3381 dnl Character encoding record.
3382 7; 20; 1; 12; "windows-1252";
3384 dnl Dictionary termination record.
3387 for variant in be le; do
3388 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3389 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3391 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3392 warning: `sys-file.sav' near offset 0x128: Ignoring long string value label record for unknown variable STR9.
3394 warning: `sys-file.sav' near offset 0x164: Ignoring long string value label record for numeric variable NUM1.
3396 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).
3398 "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."
3400 warning: `sys-file.sav' near offset 0x259: Duplicate value label for `abcdefghijklmn' on str14.
3405 AT_SETUP([fewer data records than indicated by file header])
3406 AT_KEYWORDS([sack synthetic system file negative])
3407 AT_DATA([sys-file.sack], [dnl
3409 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3410 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3412 dnl Numeric variables.
3413 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3414 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3416 dnl Character encoding record.
3417 7; 20; 1; 12; "windows-1252";
3425 dnl Missing record here.
3427 for variant in be le; do
3428 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3429 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3432 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3433 [error: Error reading case from file `sys-file.sav'.
3445 AT_SETUP([partial data record between variables])
3446 AT_KEYWORDS([sack synthetic system file negative])
3447 AT_DATA([sys-file.sack], [dnl
3449 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3450 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3452 dnl Numeric variables.
3453 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3454 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3456 dnl Character encoding record.
3457 7; 20; 1; 12; "windows-1252";
3464 for variant in be le; do
3465 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3466 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3469 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3470 [error: `sys-file.sav' near offset 0x12c: File ends in partial case.
3479 AT_SETUP([partial data record within long string])
3480 AT_KEYWORDS([sack synthetic system file negative])
3481 AT_DATA([sys-file.sack], [dnl
3483 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3484 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3486 dnl Numeric variables.
3487 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3488 2; -1; 0; 0; 0; 0; s8 "";
3490 dnl Character encoding record.
3491 7; 20; 1; 12; "windows-1252";
3495 s14 "one data item";
3498 for variant in be le; do
3499 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3500 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3503 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3504 [error: `sys-file.sav' near offset 0x12a: Unexpected end of file.
3513 AT_SETUP([partial compressed data record])
3514 AT_KEYWORDS([sack synthetic system file positive])
3515 AT_DATA([sys-file.sack], [dnl
3517 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3519 6; dnl Nominal case size
3522 -1; dnl Unspecified number of cases.
3524 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3527 dnl Numeric variables.
3528 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3529 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3531 dnl String variable.
3532 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3533 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3534 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3535 2; -1; 0; 0; 0; 0; s8 "";
3537 dnl Character encoding record.
3538 7; 20; 1; 12; "windows-1252";
3540 dnl Dictionary termination record.
3543 dnl Compressed data.
3544 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3546 for variant in be le; do
3547 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3548 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3551 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3552 [error: `sys-file.sav' near offset 0x1ac: File ends in partial case.
3555 num1,num2,str4,str8,str15
3556 -99,0,,abcdefgh,0123 @&t@
3561 AT_SETUP([zcompressed data - bad zheader_ofs])
3562 AT_KEYWORDS([sack synthetic system file negative zlib])
3563 zcompressed_sack | sed 's/.*zheader_ofs.*/>>i64 0<<;/' > sys-file.sack
3564 for variant in be le; do
3565 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3566 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3568 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).
3573 AT_SETUP([zcompressed data - bad ztrailer_ofs])
3574 AT_KEYWORDS([sack synthetic system file negative zlib])
3575 zcompressed_sack | sed 's/.*ztrailer_ofs.*/>>i64 0<<;/' > sys-file.sack
3576 for variant in be le; do
3577 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3578 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3580 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Impossible ZLIB trailer offset 0x0.
3585 # ztrailer_len must be a multiple of 24 and at least 48,
3586 # so a value of 12 is impossible.
3587 AT_SETUP([zcompressed data - invalid ztrailer_len])
3588 AT_KEYWORDS([sack synthetic system file negative zlib])
3589 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 12<<;/' > sys-file.sack
3590 for variant in be le; do
3591 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3592 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3594 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Invalid ZLIB trailer length 12.
3599 # ztrailer_ofs + ztrailer_len must be the file size.
3600 AT_SETUP([zcompressed data - wrong ztrailer_len])
3601 AT_KEYWORDS([sack synthetic system file negative zlib])
3602 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 72<<;/' > sys-file.sack
3603 for variant in be le; do
3604 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3605 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3607 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).
3608 error: `sys-file.sav' near offset 0x21d: 72-byte ZLIB trailer specifies 1 data blocks (expected 2).
3613 AT_SETUP([zcompressed data - wrong ztrailer_bias])
3614 AT_KEYWORDS([sack synthetic system file negative zlib])
3615 zcompressed_sack | sed 's/.*ztrailer_bias.*/>>i64 0<<;/' > sys-file.sack
3616 for variant in be le; do
3617 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3618 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3620 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).
3625 AT_SETUP([zcompressed data - wrong ztrailer_zero])
3626 AT_KEYWORDS([sack synthetic system file negative zlib])
3627 zcompressed_sack | sed 's/.*ztrailer_zero.*/>>i64 100<<;/' > sys-file.sack
3628 for variant in be le; do
3629 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3630 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3632 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x215: ZLIB trailer "zero" field has nonzero value 100.
3637 AT_SETUP([zcompressed data - wrong block_size])
3638 AT_KEYWORDS([sack synthetic system file negative zlib])
3639 zcompressed_sack | sed 's/.*block_size.*/>>0x1000<<;/' > sys-file.sack
3640 for variant in be le; do
3641 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3642 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3644 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x219: ZLIB trailer specifies unexpected 4096-byte block size.
3649 AT_SETUP([zcompressed data - wrong n_blocks])
3650 AT_KEYWORDS([sack synthetic system file negative zlib])
3651 zcompressed_sack | sed 's/.*n_blocks.*/>>2<<;/' > sys-file.sack
3652 for variant in be le; do
3653 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3654 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3656 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).
3661 AT_SETUP([zcompressed data - wrong uncompressed_ofs])
3662 AT_KEYWORDS([sack synthetic system file negative zlib])
3663 zcompressed_sack | sed 's/.*uncompressed_ofs.*/i64 >>0x177<<;/' > sys-file.sack
3664 for variant in be le; do
3665 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3666 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3668 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.
3673 AT_SETUP([zcompressed data - wrong compressed_ofs])
3674 AT_KEYWORDS([sack synthetic system file negative zlib])
3675 zcompressed_sack | sed 's/.*@%:@ compressed_ofs.*/i64 >>0x191<<;/' > sys-file.sack
3676 for variant in be le; do
3677 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3678 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3680 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.
3685 AT_SETUP([zcompressed data - compressed sizes don't add up])
3686 AT_KEYWORDS([sack synthetic system file negative zlib])
3687 AT_DATA([sys-file.sack], [dnl
3689 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3691 6; dnl Nominal case size
3692 2; dnl zlib compressed
3694 -1; dnl Unspecified number of cases.
3696 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3699 dnl Numeric variables.
3700 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3701 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3703 dnl String variable.
3704 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3705 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3706 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3707 2; -1; 0; 0; 0; 0; s8 "";
3709 dnl Character encoding record.
3710 7; 20; 1; 12; "windows-1252";
3712 dnl Dictionary termination record.
3715 dnl ZLIB data header.
3716 i64 0x194; # zheader_ofs
3717 i64 0x1ac; # ztrailer_ofs
3718 i64 72; # ztrailer_len
3720 dnl This is where the ZLIB data blocks would go, but we don't need any to
3721 dnl provoke this message so we omit them.
3723 dnl ZLIB data trailer fixed header:
3724 i64 -100; # ztrailer_bias
3725 i64 0; # ztrailer_zero
3726 0x3ff000; # block_size
3729 dnl ZLIB block descriptor 1:
3730 i64 0x194; # uncompressed_ofs
3731 i64 0x1ac; # compressed_ofs
3732 0x100000; # uncompressed_size
3733 0x12345; # compressed_size
3735 dnl ZLIB block descriptor 2:
3736 i64 0x100194; # uncompressed_ofs
3737 i64 0x12421; # compressed_ofs
3738 0x100000; # uncompressed_size
3739 0x12345; # compressed_size
3741 for variant in be le; do
3742 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3743 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3745 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.
3746 error: `sys-file.sav' near offset 0x1dc: ZLIB block descriptor 1 reported compressed data offset 0x12421, when 0x124f1 was expected.
3751 AT_SETUP([zcompressed data - uncompressed_size > block_size])
3752 AT_KEYWORDS([sack synthetic system file negative zlib])
3753 zcompressed_sack | sed 's/.*uncompressed_size.*/>>0x400000<<;/' > sys-file.sack
3754 for variant in be le; do
3755 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3756 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3758 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.
3763 AT_SETUP([zcompressed data - compression expands data too much])
3764 AT_KEYWORDS([sack synthetic system file negative zlib])
3765 zcompressed_sack | sed 's/.*uncompressed_size.*/>>50<<;/
3766 s/.*@%:@ compressed_size.*/>>100<<;/' > sys-file.sack
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'.
3771 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.
3776 AT_SETUP([zcompressed data - compressed sizes don't add up])
3777 AT_KEYWORDS([sack synthetic system file negative zlib])
3778 zcompressed_sack | sed 's/.*@%:@ compressed_size.*/>>88<<;/' > sys-file.sack
3779 for variant in be le; do
3780 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3781 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3783 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.