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([cat pspp.csv], [0], [dnl
134 File label: PSPP synthetic test file: ôõöø
136 Variable,Description,Position
138 num2,"Label: Numeric variable 2's label (ùúû)
142 num4,"Label: Another numeric variable label
146 Missing Values: 1; 2",5
148 Missing Values: 1; 2; 3",6
150 Missing Values: 1 THRU 3",7
152 Missing Values: 1 THRU 3; 5",8
154 Missing Values: 1 THRU HIGHEST; -5",9
155 numàèìñò,"Format: F8.0
156 Missing Values: LOWEST THRU 1; 5",10
158 str2,"Label: String variable 2's label
161 Missing Values: ""MISS""",13
162 str4,"Label: Another string variable label
164 Missing Values: ""OTHR""",14
166 Missing Values: ""MISS""; ""OTHR""",15
168 Missing Values: ""MISS""; ""OTHR""; ""MORE""",16
170 Missing Values: ""first8by""",17
172 Missing Values: ""abcdefgh""",18
174 Missing Values: ""abcdefgh""; ""01234567""",19
176 Missing Values: ""abcdefgh""; ""01234567""; ""0 """,20
177 str11,"Label: 25-byte string
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([cat pspp.csv], [0], [dnl
226 Variable,Description,Position
228 num2,"Label: Numeric variable 2's label
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([cat pspp.csv], [0], [dnl
280 Variable,Description,Position
282 num2,"Label: Numeric variable 2's label
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([cat pspp.csv], [0], [dnl
413 Variable,Description,Position
417 1,один (in Russian)",1
445 a,value label for `a'",6
449 bc,value label for `bc'
450 de,value label for `de'",7
454 fgh,value label for `fgh'
455 ijk,value label for `ijk'",8
459 BCDE,value label for `BCDE'
460 lmno,value label for `lmno'
461 tuvw,value label for `tuvw'
462 xyzA,value label for `xyzA'",9
466 FGHI,value label for `FGHI'
467 pqrs,value label for `pqrs'
468 tuvw,value label for `tuvw'
469 xyzA,value label for `xyzA'",10
473 JKLMNO,value label for `JKLMNO'",11
477 JKLMNOP,value label for `JKLMNOP'",12
481 JKLMNOPQ,value label for `JKLMNOPQ'",13
485 RSTUVWXYZ,value label for `RSTUVWXYZ'",14
489 0123456789ab,value label for `0123456789ab'
490 cdefghijklmn,value label for `cdefghijklmn'",15
494 EFGHIJKLMNOPQRST,value label for `EFGHIJKLMNOPQRST'
495 UVWXYZ0123456789,value label for `UVWXYZ0123456789' with Cyrillic letters: `фхц'
496 opqrstuvwxyzABCD,value label for `opqrstuvwxyzABCD'",16
500 abcdefghijklmnopq,value label for `abcdefghijklmnopq'",17
505 AT_SETUP([documents])
506 AT_KEYWORDS([sack synthetic system file positive])
507 AT_DATA([sys-file.sack], [dnl
509 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
511 1; dnl Nominal case size
512 0; dnl Not compressed
516 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
519 dnl Numeric variable, no label or missing values.
520 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
522 dnl Machine integer info record.
523 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
527 s80 "First line of documents";
528 s80 "Second line of documents";
529 "abb"; i8 233; " appliqu"; i8 233; " attach"; i8 233; " blas"; i8 233; " caf"; i8 233; " canap"; i8 233; " clich"; i8 233; " consomm"; i8 233;
532 s80 "Last line of documents";
534 dnl Character encoding record.
535 7; 20; 1; 12; "windows-1252";
537 dnl Dictionary termination record.
543 for variant in be le; do
544 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
545 AT_DATA([sys-file.sps], [dnl
546 GET FILE='sys-file.sav'.
550 AT_CHECK([pspp -o pspp.csv sys-file.sps])
551 AT_CHECK([cat pspp.csv], [0], [dnl
552 Documents in the active dataset:
554 First line of documents
556 Second line of documents
558 abbé appliqué attaché blasé café canapé cliché consommé
562 Last line of documents
571 AT_SETUP([multiple response sets])
572 AT_KEYWORDS([sack synthetic system file positive])
573 AT_DATA([sys-file.sack], [dnl
575 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
577 16; dnl Nominal case size
578 0; dnl Not compressed
582 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
586 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
587 2; 0; 0; 0; 0x050800 *2; s8 "B";
588 2; 0; 0; 0; 0x050800 *2; s8 "C";
591 2; 0; 0; 0; 0x050800 *2; s8 "D";
592 2; 0; 0; 0; 0x050800 *2; s8 "E";
593 2; 0; 0; 0; 0x050800 *2; s8 "F";
594 2; 0; 0; 0; 0x050800 *2; s8 "G";
597 2; 4; 0; 0; 0x010400 *2; s8 "H";
598 2; 4; 0; 0; 0x010400 *2; s8 "I";
599 2; 4; 0; 0; 0x010400 *2; s8 "J";
602 2; 0; 0; 0; 0x050800 *2; s8 "K";
603 2; 0; 0; 0; 0x050800 *2; s8 "L";
604 2; 0; 0; 0; 0x050800 *2; s8 "M";
607 2; 6; 0; 0; 0x010600 *2; s8 "N";
608 2; 6; 0; 0; 0x010600 *2; s8 "O";
609 2; 6; 0; 0; 0x010600 *2; s8 "P";
611 dnl Machine integer info record.
612 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
616 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
617 "$b=D2 55 0 g e f d"; i8 10; i8 10;
618 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
623 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
624 "$e=E 11 6 choice 0 n o p"; i8 10; i8 10; i8 10; i8 10);
626 dnl Character encoding record.
627 7; 20; 1; 9; "shift_jis";
629 dnl Dictionary termination record.
632 for variant in be le; do
633 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
634 AT_DATA([sys-file.sps], [dnl
635 GET FILE='sys-file.sav'.
636 MRSETS /DISPLAY NAME=ALL.
638 AT_CHECK([pspp -o pspp.csv sys-file.sps])
639 AT_CHECK([cat pspp.csv], [0], [dnl
640 Table: Multiple Response Sets
641 Name,Variables,Details
645 ","Multiple category set
652 ","Multiple dichotomy set
654 Category label source: Variable labels
659 ","Multiple dichotomy set
661 Label source: Provided by user
663 Category label source: Variable labels
668 ","Multiple dichotomy set
670 Label source: Provided by user
672 Category label source: Value labels of counted value
677 ","Multiple dichotomy set
678 Label source: First variable label among variables
679 Counted value: `choice'
680 Category label source: Value labels of counted value
686 dnl Also checks for handling of CR-only line ends in file label and
687 dnl extra product info.
688 AT_SETUP([extra product info])
689 AT_KEYWORDS([sack synthetic system file positive])
690 AT_DATA([sys-file.sack], [dnl
692 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
694 4; dnl Nominal case size
695 0; dnl Not compressed
699 "01 Jan 11"; "20:53:52"; "PSPP synthetic"; i8 13; s49 "test file";
702 dnl Numeric variables.
703 2; 0; 0; 0; 0x050800 *2; s8 "A";
704 2; 0; 0; 0; 0x050800 *2; s8 "B";
705 2; 0; 0; 0; 0x050800 *2; s8 "C";
706 2; 0; 0; 0; 0x050800 *2; s8 "D";
708 dnl Extra product info.
709 7; 10; 1; COUNT ("Extra product info"; i8 13; "another line"; i8 13; "blah");
711 dnl Character encoding record.
712 7; 20; 1; 12; "windows-1252";
714 dnl Dictionary termination record.
717 for variant in be le; do
718 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
719 AT_DATA([sys-file.sps], [dnl
720 SYSFILE INFO FILE='sys-file.sav'.
722 AT_CHECK([pspp -o pspp.csv sys-file.sps])
723 AT_CHECK([sed 7q pspp.csv], [0], [dnl
725 Label:,"PSPP synthetic
727 Created:,01 Jan 11 20:53:52 by $(@%:@) SPSS DATA FILE PSPP synthetic test file
728 Product:,"Extra product info
735 AT_SETUP([variable display parameters, without width])
736 AT_KEYWORDS([sack synthetic system file positive])
737 AT_DATA([sys-file.sack], [dnl
739 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
741 19; dnl Nominal case size
742 0; dnl Not compressed
746 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
749 dnl Numeric variables.
750 2; 0; 0; 0; 0x050800 *2; s8 "A";
751 2; 0; 0; 0; 0x050800 *2; s8 "B";
752 2; 0; 0; 0; 0x050800 *2; s8 "C";
753 2; 0; 0; 0; 0x050800 *2; s8 "D";
755 dnl Short string variables.
756 2; 3; 0; 0; 0x010300 *2; s8 "H";
757 2; 3; 0; 0; 0x010300 *2; s8 "I";
758 2; 3; 0; 0; 0x010300 *2; s8 "J";
759 2; 3; 0; 0; 0x010300 *2; s8 "K";
761 dnl Long string variables.
762 2; 9; 0; 0; 0x010900 *2; s8 "L";
763 2; -1; 0; 0; 0; 0; s8 "";
764 2; 10; 0; 0; 0x010a00 *2; s8 "M";
765 2; -1; 0; 0; 0; 0; s8 "";
766 2; 17; 0; 0; 0x011100 *2; s8 "N";
767 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
768 2; 25; 0; 0; 0x011900 *2; s8 "O";
769 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
771 dnl Variable display parameters
786 dnl Character encoding record.
787 7; 20; 1; 12; "windows-1252";
789 dnl Dictionary termination record.
792 for variant in be le; do
793 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
794 AT_DATA([sys-file.sps], [dnl
795 GET FILE='sys-file.sav'.
798 AT_CHECK([pspp -o pspp.csv sys-file.sps])
799 AT_CHECK([cat pspp.csv], [0], [dnl
800 Variable,Description,Position
803 Display Alignment: Left",1
806 Display Alignment: Left",2
809 Display Alignment: Left",3
812 Display Alignment: Right",4
815 Display Alignment: Right",5
818 Display Alignment: Right",6
821 Display Alignment: Center",7
824 Display Alignment: Center",8
827 Display Alignment: Center",9
830 Display Alignment: Left",10
833 Display Alignment: Right",11
836 Display Alignment: Center",12
841 AT_SETUP([variable display parameters, with width])
842 AT_KEYWORDS([sack synthetic system file positive])
843 AT_DATA([sys-file.sack], [dnl
845 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
847 19; dnl Nominal case size
848 0; dnl Not compressed
852 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
855 dnl Numeric variables.
856 2; 0; 0; 0; 0x050800 *2; s8 "A";
857 2; 0; 0; 0; 0x050800 *2; s8 "B";
858 2; 0; 0; 0; 0x050800 *2; s8 "C";
859 2; 0; 0; 0; 0x050800 *2; s8 "D";
861 dnl Short string variables.
862 2; 3; 0; 0; 0x010300 *2; s8 "H";
863 2; 3; 0; 0; 0x010300 *2; s8 "I";
864 2; 3; 0; 0; 0x010300 *2; s8 "J";
865 2; 3; 0; 0; 0x010300 *2; s8 "K";
867 dnl Long string variables.
868 2; 9; 0; 0; 0x010900 *2; s8 "L";
869 2; -1; 0; 0; 0; 0; s8 "";
870 2; 10; 0; 0; 0x010a00 *2; s8 "M";
871 2; -1; 0; 0; 0; 0; s8 "";
872 2; 17; 0; 0; 0x011100 *2; s8 "N";
873 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
874 2; 25; 0; 0; 0x011900 *2; s8 "O";
875 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
877 dnl Variable display parameters
892 dnl Character encoding record.
893 7; 20; 1; 12; "windows-1252";
895 dnl Dictionary termination record.
898 for variant in be le; do
899 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
900 AT_DATA([sys-file.sps], [dnl
901 GET FILE='sys-file.sav'.
904 AT_CHECK([pspp -o pspp.csv sys-file.sps])
905 AT_CHECK([cat pspp.csv], [0], [dnl
906 Variable,Description,Position
909 Display Alignment: Left
913 Display Alignment: Left
917 Display Alignment: Left
921 Display Alignment: Right
925 Display Alignment: Right
929 Display Alignment: Right
933 Display Alignment: Center
937 Display Alignment: Center
941 Display Alignment: Center
945 Display Alignment: Left
946 Display Width: 10",10
949 Display Alignment: Right
950 Display Width: 11",11
953 Display Alignment: Center
954 Display Width: 12",12
959 AT_SETUP([long variable names])
960 AT_KEYWORDS([sack synthetic system file positive])
961 AT_DATA([sys-file.sack], [dnl
963 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
965 7; dnl Nominal case size
966 0; dnl Not compressed
970 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
973 dnl Numeric variables.
974 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
975 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
976 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
977 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
978 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDINA";
979 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_A";
980 2; 0; 0; 0; 0x050800 *2; "CO"; i8 214; "RDI_B";
982 dnl Machine integer info record.
983 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
985 dnl Machine floating-point info record.
986 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
988 dnl Long variable names.
990 "LONGVARI=LongVariableName1"; i8 9;
991 "LONGVA_A=LongVariableName2"; i8 9;
992 "LONGVA_B=LongVariableName3"; i8 9;
993 "LONGVA_C=LongVariableName4"; i8 9;
994 "CO"; i8 214; "RDINA=Co"; i8 246; "rdinate_X"; i8 9;
995 "CO"; i8 214; "RDI_A=Co"; i8 246; "rdinate_Y"; i8 9;
996 "CO"; i8 214; "RDI_B=Co"; i8 246; "rdinate_Z";
999 dnl Character encoding record.
1000 7; 20; 1; 12; "windows-1252";
1002 dnl Dictionary termination record.
1005 for variant in be le; do
1006 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1007 AT_DATA([sys-file.sps], [dnl
1008 GET FILE='sys-file.sav'.
1011 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1012 AT_CHECK([cat pspp.csv], [0], [dnl
1013 Variable,Description,Position
1014 LongVariableName1,Format: F8.0,1
1015 LongVariableName2,Format: F8.0,2
1016 LongVariableName3,Format: F8.0,3
1017 LongVariableName4,Format: F8.0,4
1018 Coördinate_X,Format: F8.0,5
1019 Coördinate_Y,Format: F8.0,6
1020 Coördinate_Z,Format: F8.0,7
1025 AT_SETUP([very long strings])
1026 AT_KEYWORDS([sack synthetic system file positive])
1027 AT_DATA([sys-file.sack], [dnl
1029 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1031 109; dnl Nominal case size
1032 0; dnl Not compressed
1036 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1039 dnl 256-byte string.
1040 2; 255; 0; 0; 0x01FF00 *2; "S"; i8 201; s6 "Q256";
1041 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1042 2; 4; 0; 0; 0x010400 *2; "S"; i8 201; "Q256_1";
1044 dnl 600-byte string.
1045 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600";
1046 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1047 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600_1";
1048 (2; -1; 0; 0; 0; 0; s8 "") * 31;
1049 2; 96; 0; 0; 0x016000 *2; s8 "STR600_2";
1050 (2; -1; 0; 0; 0; 0; s8 "") * 11;
1052 dnl Machine integer info record.
1053 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1055 dnl Very long string record.
1057 "S"; i8 201; "Q256=00256"; i8 0; i8 9;
1058 "STR600=00600"; i8 0; i8 9;
1061 dnl Character encoding record.
1062 7; 20; 1; 12; "windows-1252";
1064 dnl Dictionary termination record.
1068 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 4;
1070 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 9;
1071 "abcdefghijklmnopqrstuvwxyzABCDEF";
1073 for variant in be le; do
1074 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1075 AT_DATA([sys-file.sps], [dnl
1076 GET FILE='sys-file.sav'.
1080 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1081 AT_CHECK([cat pspp.csv], [0], [dnl
1082 Variable,Description,Position
1083 séq256,Format: A256,1
1084 str600,Format: A600,2
1088 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@a,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyz
1093 AT_SETUP([data file and variable attributes])
1094 AT_KEYWORDS([sack synthetic system file positive])
1095 AT_DATA([sys-file.sack], [dnl
1097 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1099 2; dnl Nominal case size
1100 0; dnl Not compressed
1104 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1108 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
1109 2; 0; 0; 0; 0x050800 *2; s8 "SECONDVA";
1111 dnl Machine integer info record.
1112 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1114 dnl Long variable names.
1116 "FIRSTVAR=FirstVariable"; i8 9;
1117 "SECONDVA=S"; i8 233; "condVariable"; i8 9;
1120 dnl Data file attributes record.
1122 "Attr1('Value1'"; i8 10; "''d"; i8 233; "claration''"; i8 10; ")";
1123 "S"; i8 233; "condAttr('123'"; i8 10; "'456'"; i8 10; ")";
1126 dnl Variable attributes record.
1129 "ad"; i8 232; "le('23'"; i8 10; "'34'"; i8 10; ")";
1130 "bert('123'"; i8 10; ")";
1131 "$@Role('1'"; i8 10; ")";
1132 "/S"; i8 233; "condVariable:";
1133 "xyzzy('quux'"; i8 10; ")";
1137 dnl Character encoding record.
1138 7; 20; 1; 12; "windows-1252";
1140 dnl Dictionary termination record.
1143 for variant in be le; do
1144 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1145 AT_DATA([sys-file.sps], [dnl
1146 GET FILE='sys-file.sav'.
1147 DISPLAY @ATTRIBUTES.
1149 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1150 AT_CHECK([cat pspp.csv], [0],
1151 [[Variable,Description
1152 FirstVariable,"Attribute,Value
1157 SécondVariable,"Attribute,Value
1160 Table: Custom data file attributes.
1163 Attr1[2],'déclaration'
1167 AT_DATA([sys-file.sps], [dnl
1168 GET FILE='sys-file.sav'.
1171 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1172 AT_CHECK([cat pspp.csv], [0],
1173 [[Variable,Description,Position
1174 FirstVariable,"Format: F8.0
1181 SécondVariable,"Format: F8.0
1187 Table: Custom data file attributes.
1190 Attr1[2],'déclaration'
1197 AT_SETUP([variable roles])
1198 AT_KEYWORDS([sack synthetic system file positive])
1199 AT_DATA([sys-file.sack], [dnl
1201 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1203 7; dnl Nominal case size
1204 0; dnl Not compressed
1208 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1212 2; 0; 0; 0; 0x050800 *2; s8 "I";
1213 2; 0; 0; 0; 0x050800 *2; s8 "O";
1214 2; 0; 0; 0; 0x050800 *2; s8 "B";
1215 2; 0; 0; 0; 0x050800 *2; s8 "N";
1216 2; 0; 0; 0; 0x050800 *2; s8 "P";
1217 2; 0; 0; 0; 0x050800 *2; s8 "S";
1218 2; 0; 0; 0; 0x050800 *2; s8 "X";
1220 dnl Machine integer info record.
1221 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1223 dnl Variable attributes record.
1225 "I:$@Role('0'"; i8 10; ")";
1226 "/O:$@Role('1'"; i8 10; ")";
1227 "/B:$@Role('2'"; i8 10; ")";
1228 "/N:$@Role('3'"; i8 10; ")";
1229 "/P:$@Role('4'"; i8 10; ")";
1230 "/S:$@Role('5'"; i8 10; ")";
1231 "/X:$@Role('6'"; i8 10; ")";
1234 dnl Character encoding record.
1235 7; 20; 1; 12; "windows-1252";
1237 dnl Dictionary termination record.
1240 for variant in be le; do
1241 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1242 AT_DATA([sys-file.sps], [dnl
1243 GET FILE='sys-file.sav'.
1246 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [dnl
1247 warning: `sys-file.sav': Invalid role for variable x.
1249 AT_CHECK([cat pspp.csv], [0], [dnl
1250 warning: `sys-file.sav': Invalid role for variable x.
1252 Variable,Description,Position
1271 AT_SETUP([compressed data])
1272 AT_KEYWORDS([sack synthetic system file positive])
1273 AT_DATA([sys-file.sack], [dnl
1275 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1277 6; dnl Nominal case size
1278 1; dnl Simple compression
1280 -1; dnl Unspecified number of cases.
1282 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1285 dnl Numeric variables.
1286 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1287 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1289 dnl String variable.
1290 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1291 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1292 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1293 2; -1; 0; 0; 0; 0; s8 "";
1295 dnl Character encoding record.
1296 7; 20; 1; 12; "windows-1252";
1298 dnl Dictionary termination record.
1301 dnl Compressed data.
1302 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1303 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1304 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1305 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1308 for variant in be le; do
1309 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1310 AT_DATA([sys-file.sps], [dnl
1311 GET FILE='sys-file.sav'.
1315 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1316 AT_CHECK([cat pspp.csv], [0], [dnl
1317 Variable,Description,Position
1325 num1,num2,str4,str8,str15
1326 -99,0,,abcdefgh,0123 @&t@
1327 .,151,jklm,nopqrstu,vwxyzABC @&t@
1328 1,2,DEFG,HIJKLMNO,PQRSTUV
1333 AT_SETUP([compressed data, zero bias])
1334 AT_KEYWORDS([sack synthetic system file positive])
1335 AT_DATA([sys-file.sack], [dnl
1337 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1339 6; dnl Nominal case size
1340 1; dnl Simple compression.
1342 -1; dnl Unspecified number of cases.
1344 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1347 dnl Numeric variables.
1348 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1349 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1351 dnl String variable.
1352 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1353 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1354 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1355 2; -1; 0; 0; 0; 0; s8 "";
1357 dnl Character encoding record.
1358 7; 20; 1; 12; "windows-1252";
1360 dnl Dictionary termination record.
1363 dnl Compressed data.
1364 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1365 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1366 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1367 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1370 for variant in be le; do
1371 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1372 AT_DATA([sys-file.sps], [dnl
1373 GET FILE='sys-file.sav'.
1377 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1378 AT_CHECK([cat pspp.csv], [0], [dnl
1379 Variable,Description,Position
1387 num1,num2,str4,str8,str15
1388 1,100,,abcdefgh,0123 @&t@
1389 .,251,jklm,nopqrstu,vwxyzABC @&t@
1390 101,102,DEFG,HIJKLMNO,PQRSTUV
1395 AT_SETUP([compressed data, other bias])
1396 AT_KEYWORDS([sack synthetic system file positive])
1397 AT_DATA([sys-file.sack], [dnl
1399 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1401 6; dnl Nominal case size
1402 1; dnl Simple compression.
1404 -1; dnl Unspecified number of cases.
1406 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1409 dnl Numeric variables.
1410 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1411 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1413 dnl String variable.
1414 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1415 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1416 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1417 2; -1; 0; 0; 0; 0; s8 "";
1419 dnl Character encoding record.
1420 7; 20; 1; 12; "windows-1252";
1422 dnl Dictionary termination record.
1425 dnl Compressed data.
1426 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1427 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1428 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1429 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1432 for variant in be le; do
1433 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1434 AT_DATA([sys-file.sps], [dnl
1435 GET FILE='sys-file.sav'.
1439 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0],
1440 [warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1442 AT_CHECK([cat pspp.csv], [0], [dnl
1443 "warning: `sys-file.sav' near offset 0x54: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1445 Variable,Description,Position
1453 num1,num2,str4,str8,str15
1454 -49,50,,abcdefgh,0123 @&t@
1455 .,201,jklm,nopqrstu,vwxyzABC @&t@
1456 51,52,DEFG,HIJKLMNO,PQRSTUV
1461 m4_divert_push([PREPARE_TESTS])
1462 zcompressed_sack () {
1465 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1467 6; dnl Nominal case size
1468 2; dnl zlib compressed
1470 -1; dnl Unspecified number of cases.
1472 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1475 dnl Numeric variables.
1476 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1477 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1479 dnl String variable.
1480 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1481 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1482 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1483 2; -1; 0; 0; 0; 0; s8 "";
1485 dnl Character encoding record.
1486 7; 20; 1; 12; "windows-1252";
1488 dnl Dictionary termination record.
1491 dnl ZLIB data header.
1492 i64 0x194; # zheader_ofs
1493 i64 0x205; # ztrailer_ofs
1494 i64 48; # ztrailer_len
1496 dnl ZLIB data block.
1498 dnl This is the compressed form of:
1500 dnl 01 64 fe fd fe fd ff fb 61 62 63 64 65 66 67 68 |.d......abcdefgh|
1501 dnl 30 31 32 33 20 20 20 20 fd fd fd fe 65 66 fd fd |0123 ....ef..|
1502 dnl 6a 6b 6c 6d 20 20 20 20 6e 6f 70 71 72 73 74 75 |jklm nopqrstu|
1503 dnl 76 77 78 79 7a 41 42 43 44 45 46 47 20 20 20 20 |vwxyzABCDEFG |
1504 dnl 48 49 4a 4b 4c 4d 4e 4f fe fd fc 00 00 00 00 00 |HIJKLMNO........|
1505 dnl 50 51 52 53 54 55 56 57 |PQRSTUVW|
1507 dnl which is the data from the "compressed data" test.
1508 hex "78 01 63 4c f9 f7 f7 df df ff bf 13 93 92 53 52";
1509 hex "d3 d2 33 0c 0c 8d 8c 15 80 e0 ef df bf ff 52 d3";
1510 hex "fe fe cd ca ce c9 05 f1 f3 f2 0b 0a 8b 8a 4b 4a";
1511 hex "cb ca 2b 2a ab 1c 9d 9c 5d 5c dd dc 41 e2 1e 9e";
1512 hex "5e de 3e be 7e fe ff fe fe 61 00 81 80 c0 a0 e0";
1513 hex "90 d0 b0 70 00 0f 3f 23 d7";
1515 dnl ZLIB data trailer fixed header:
1516 i64 -100; # ztrailer_bias
1517 i64 0; # ztrailer_zero
1518 0x3ff000; # block_size
1521 dnl ZLIB block descriptor:
1522 i64 0x194; # uncompressed_ofs
1523 i64 0x1ac; # compressed_ofs
1524 88; # uncompressed_size
1525 89; # compressed_size
1528 m4_divert_pop([PREPARE_TESTS])
1530 AT_SETUP([zcompressed data])
1531 AT_KEYWORDS([sack synthetic system file positive zlib])
1532 zcompressed_sack > sys-file.sack
1533 for variant in be le; do
1534 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1535 AT_DATA([sys-file.sps], [dnl
1536 GET FILE='sys-file.sav'.
1540 AT_CHECK([pspp -o pspp.csv sys-file.sps])
1541 AT_CHECK([cat pspp.csv], [0], [dnl
1542 Variable,Description,Position
1550 num1,num2,str4,str8,str15
1551 -99,0,,abcdefgh,0123 @&t@
1552 .,151,jklm,nopqrstu,vwxyzABC @&t@
1553 1,2,DEFG,HIJKLMNO,PQRSTUV
1558 AT_BANNER([system file reader - negative])
1560 AT_SETUP([unspecified character encoding])
1561 AT_KEYWORDS([sack synthetic system file positive])
1562 AT_DATA([sys-file.sack], [dnl
1564 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1566 4; dnl Nominal case size
1567 0; dnl Not compressed
1571 "01 Jan 11"; "20:53:52";
1572 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1575 dnl Numeric variables.
1576 2; 0; 0; 0; 0x050800 *2; s8 "A";
1577 2; 0; 0; 0; 0x050800 *2; s8 "B";
1578 2; 0; 0; 0; 0x050800 *2; s8 "C";
1579 2; 0; 0; 0; 0x050800 *2; s8 "D";
1581 dnl Dictionary termination record.
1584 for variant in be le; do
1585 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1586 AT_DATA([sys-file.sps], [dnl
1589 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [stdout])
1590 AT_CHECK([sed 's/default encoding.*For/default encoding. For/' stdout], [0], [dnl
1591 "warning: `sys-file.sav': This system file does not indicate its own character encoding. Using default encoding. For best results, specify an encoding explicitly. Use SYSFILE INFO with ENCODING=""DETECT"" to analyze the possible encodings."
1596 AT_SETUP([misplaced type 4 record])
1597 AT_KEYWORDS([sack synthetic system file negative])
1598 AT_DATA([sys-file.sack], [dnl
1600 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1601 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1603 dnl Numeric variable.
1604 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1609 for variant in be le; do
1610 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1611 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1613 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1614 [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1619 AT_SETUP([bad record type])
1620 AT_KEYWORDS([sack synthetic system file negative])
1621 AT_DATA([sys-file.sack], [dnl
1623 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1624 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1626 dnl Numeric variable.
1627 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1629 dnl Type 8 record (not a valid type).
1632 for variant in be le; do
1633 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1634 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1636 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1637 [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1642 AT_SETUP([wrong number of variable positions])
1643 AT_KEYWORDS([sack synthetic system file negative])
1644 AT_DATA([sys-file.sack], [dnl
1646 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1647 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1649 dnl Numeric variable.
1650 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1652 dnl Character encoding record.
1653 7; 20; 1; 12; "windows-1252";
1655 dnl End of dictionary.
1658 for variant in be le; do
1659 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1660 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1662 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1663 [warning: `sys-file.sav': File header claims 2 variable positions but 1 were read from file.
1668 AT_SETUP([variable name may not begin with `#'])
1669 AT_KEYWORDS([sack synthetic system file negative])
1670 AT_DATA([sys-file.sack], [dnl
1672 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1673 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1675 dnl Numeric variable.
1676 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1678 dnl Character encoding record.
1679 7; 20; 1; 12; "windows-1252";
1681 dnl End of dictionary.
1684 for variant in be le; do
1685 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1686 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1688 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1689 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `$UM1'.
1694 AT_SETUP([variable name may not be reserved word])
1695 AT_KEYWORDS([sack synthetic system file negative])
1696 AT_DATA([sys-file.sack], [dnl
1698 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1699 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1701 dnl Numeric variable.
1702 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1704 dnl Character encoding record.
1705 7; 20; 1; 12; "windows-1252";
1707 dnl End of dictionary.
1710 for variant in be le; do
1711 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1712 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1714 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1715 [error: `sys-file.sav' near offset 0xb4: Invalid variable name `TO'.
1720 AT_SETUP([variable width must be between 0 and 255])
1721 AT_KEYWORDS([sack synthetic system file negative])
1722 AT_DATA([sys-file.sack], [dnl
1724 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1725 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1727 dnl String variable with invalid width 256.
1728 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1730 dnl Character encoding record.
1731 7; 20; 1; 12; "windows-1252";
1733 dnl End of dictionary.
1736 for variant in be le; do
1737 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1738 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1740 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1741 [error: `sys-file.sav' near offset 0xb4: Bad width 256 for variable VAR1.
1746 dnl SPSS-generated system file can contain duplicate variable names
1747 dnl (see bug #41475).
1748 AT_SETUP([duplicate variable name])
1749 AT_KEYWORDS([sack synthetic system file negative])
1750 AT_DATA([sys-file.sack], [dnl
1752 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1753 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1755 dnl Numeric variables.
1756 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1757 2; 0; 0; 0; 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'.
1770 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
1771 [warning: `sys-file.sav' near offset 0xd4: Renaming variable with duplicate name `VAR1' to `VAR001'.
1773 Variable,Description,Position
1775 var001,Format: F8.0,2
1780 AT_SETUP([variable label indicator not 0 or 1])
1781 AT_KEYWORDS([sack synthetic system file negative])
1782 AT_DATA([sys-file.sack], [dnl
1784 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1785 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1787 dnl Numeric variable.
1788 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1790 dnl Character encoding record.
1791 7; 20; 1; 12; "windows-1252";
1793 dnl End of dictionary.
1796 for variant in be le; do
1797 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1798 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1800 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1801 [error: `sys-file.sav' near offset 0xb4: Variable label indicator field is not 0 or 1.
1806 AT_SETUP([invalid numeric missing value indicator])
1807 AT_KEYWORDS([sack synthetic system file negative])
1808 AT_DATA([sys-file.sack], [dnl
1810 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1811 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1813 dnl Numeric variable.
1814 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1816 dnl Character encoding record.
1817 7; 20; 1; 12; "windows-1252";
1819 dnl End of dictionary.
1822 for variant in be le; do
1823 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1824 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1826 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1827 ["error: `sys-file.sav' near offset 0xb4: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1832 AT_SETUP([invalid string missing value indicator])
1833 AT_KEYWORDS([sack synthetic system file negative])
1834 AT_DATA([sys-file.sack], [dnl
1836 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1837 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1839 dnl String variable.
1840 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1842 dnl Character encoding record.
1843 7; 20; 1; 12; "windows-1252";
1845 dnl End of dictionary.
1848 for variant in be le; do
1849 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1850 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1852 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1853 ["error: `sys-file.sav' near offset 0xb4: String missing value indicator field is not 0, 1, 2, or 3."
1858 AT_SETUP([missing string continuation record])
1859 AT_KEYWORDS([sack synthetic system file negative])
1860 AT_DATA([sys-file.sack], [dnl
1862 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1863 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1865 dnl String variable.
1866 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1867 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
1869 dnl Character encoding record.
1870 7; 20; 1; 12; "windows-1252";
1872 dnl End of dictionary.
1875 for variant in be le; do
1876 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1877 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1879 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
1880 [error: `sys-file.sav' near offset 0xb4: Missing string continuation record.
1885 AT_SETUP([invalid variable format])
1886 AT_KEYWORDS([sack synthetic system file negative])
1887 AT_DATA([sys-file.sack], [dnl
1889 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1890 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1892 dnl Numeric variable, invalid format types.
1893 dnl No warning is issued for type 0 because it has been observed in real
1895 2; 0; 0; 0; >>0xff0800; 0<<; s8 "NUM1";
1897 dnl Numeric variable, string formats.
1898 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
1900 dnl String variable, numeric formats.
1901 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
1903 dnl String variable, wrong width formats.
1904 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
1906 dnl Character encoding record.
1907 7; 20; 1; 12; "windows-1252";
1909 dnl End of dictionary.
1912 for variant in be le; do
1913 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1914 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1916 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1917 warning: `sys-file.sav' near offset 0xc0: Variable NUM1 with width 0 has invalid print format 0xff0800.
1919 warning: `sys-file.sav' near offset 0xe0: Variable VAR1 with width 0 has invalid print format 0x10800.
1921 warning: `sys-file.sav' near offset 0xe4: Variable VAR1 with width 0 has invalid write format 0x21000.
1923 warning: `sys-file.sav' near offset 0x100: Variable STR1 with width 4 has invalid print format 0x50800.
1925 warning: `sys-file.sav' near offset 0x104: Variable STR1 with width 4 has invalid write format 0x110a01.
1927 warning: `sys-file.sav' near offset 0x120: Variable STR2 with width 4 has invalid print format 0x10800.
1929 warning: `sys-file.sav' near offset 0x124: Variable STR2 with width 4 has invalid write format 0x20400.
1934 AT_SETUP([invalid long string missing values])
1935 AT_KEYWORDS([sack synthetic system file negative])
1936 AT_DATA([sys-file.sack], [dnl
1938 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1940 7; dnl Nominal case size
1941 0; dnl Not compressed
1945 "01 Jan 11"; "20:53:52";
1946 "PSPP synthetic test file: "; i8 244; i8 245; i8 246; i8 248; s34 "";
1949 dnl One numeric variable.
1950 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1952 dnl Long string variables that will have missing values added with a
1954 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
1955 2; -1; 0; 0; 0; 0; s8 "";
1956 2; 10; 0; 0; 0x010a00 *2; s8 "STR2";
1957 2; -1; 0; 0; 0; 0; s8 "";
1958 2; 11; 0; 0; 0x010b00 *2; s8 "STR3";
1959 2; -1; 0; 0; 0; 0; s8 "";
1961 dnl Machine integer info record.
1962 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1964 dnl Machine floating-point info record.
1965 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
1967 dnl Long string variable missing values record.
1969 dnl Zero missing values (not allowed) for STR1 .
1970 COUNT("STR1"); i8 >>0<<;
1972 dnl Four missing values (not allowed) for STR2.
1973 COUNT("STR2"); i8 4;
1974 8; "abcdefgh"; 8; "ijklmnop"; 8; "qrstuvwx"; 8; "yz012345";
1976 dnl Missing values for unknown variable
1977 COUNT(>>"Nonexistent"<<); i8 1; 8; "abcdefgh";
1979 dnl Missing values for numeric variable
1980 COUNT(>>"NUM1"<<); i8 1; 8; "abcdefgh";
1982 dnl Too long missing value
1983 COUNT("STR3"); i8 1; >>COUNT("abcdefghijkl")<<;
1986 dnl Character encoding record.
1987 7; 20; 1; 12; "windows-1252";
1989 dnl Dictionary termination record.
1991 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
1992 s16 "yzABCDEFGHI"; s16 "JKLMNOPQR"; s16 "STUVWXYZ01";
1993 s16 "23456789abc"; s32 "defghijklmnopqstuvwxyzABC";
1996 for variant in be le; do
1997 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
1998 AT_DATA([sys-file.sps], [dnl
1999 GET FILE='sys-file.sav'.
2002 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2003 ["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."
2005 "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."
2007 warning: `sys-file.sav' near offset 0x242: Ignoring long string missing value record for unknown variable Nonexistent.
2009 warning: `sys-file.sav' near offset 0x257: Ignoring long string missing value record for numeric variable NUM1.
2011 "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."
2013 Variable,Description,Position
2017 Missing Values: ""abcdefgh""; ""ijklmnop""; ""qrstuvwx""",3
2023 AT_SETUP([weighting variable must be numeric])
2024 AT_KEYWORDS([sack synthetic system file negative])
2025 AT_DATA([sys-file.sack], [dnl
2027 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2028 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2030 dnl Numeric variable.
2031 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2033 dnl String variable.
2034 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2036 dnl Character encoding record.
2037 7; 20; 1; 12; "windows-1252";
2039 dnl End of dictionary.
2042 for variant in be le; do
2043 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2044 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2047 AT_CHECK([pspp -O format=csv sys-file.sps], [0],
2048 [warning: `sys-file.sav': Ignoring string variable `STR1' set as weighting variable.
2050 Variable,Description,Position
2057 AT_SETUP([bad weighting variable index])
2058 AT_KEYWORDS([sack synthetic system file negative])
2059 AT_DATA([sys-file.sack], [dnl
2061 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2062 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2064 dnl Numeric variable.
2065 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2067 dnl String variable.
2068 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
2070 dnl Character encoding record.
2071 7; 20; 1; 12; "windows-1252";
2073 dnl End of dictionary.
2076 for variant in be le; do
2077 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2078 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2080 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2081 [error: `sys-file.sav' near offset 0x4c: Variable index 3 not in valid range 1...2.
2086 AT_SETUP([variable index is long string contination])
2087 AT_KEYWORDS([sack synthetic system file negative])
2088 AT_DATA([sys-file.sack], [dnl
2090 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2091 2; 3; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2093 dnl Numeric variable.
2094 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2096 dnl Long string variable.
2097 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2098 (2; -1; 0; 0; 0; 0; s8 "");
2100 dnl Character encoding record.
2101 7; 20; 1; 12; "windows-1252";
2103 dnl End of dictionary.
2106 for variant in be le; do
2107 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2108 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2110 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
2111 [error: `sys-file.sav' near offset 0x4c: Variable index 3 refers to long string continuation.
2116 AT_SETUP([multiple documents records])
2117 AT_KEYWORDS([sack synthetic system file negative])
2118 AT_DATA([sys-file.sack], [dnl
2120 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2121 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2123 dnl Numeric variable, no label or missing values.
2124 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2126 dnl Two document records.
2127 (6; 1; s80 "One line of documents") >>* 2<<;
2129 dnl Dictionary termination record.
2132 dnl Character encoding record.
2133 7; 20; 1; 12; "windows-1252";
2138 for variant in be le; do
2139 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2140 AT_DATA([sys-file.sps], [dnl
2141 GET FILE='sys-file.sav'.
2143 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2144 error: `sys-file.sav' near offset 0x12c: Duplicate type 6 (document) record.
2150 AT_SETUP([empty document record])
2151 AT_KEYWORDS([sack synthetic system file negative])
2152 AT_DATA([sys-file.sack], [dnl
2154 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2155 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2157 dnl Numeric variable, no label or missing values.
2158 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2160 dnl Empty document record.
2163 dnl Dictionary termination record.
2169 for variant in be le; do
2170 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2171 AT_DATA([sys-file.sps], [dnl
2172 GET FILE='sys-file.sav'.
2174 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2175 error: `sys-file.sav' near offset 0xd4: Number of document lines (0) must be greater than 0 and less than 26843545.
2180 AT_SETUP([extension record too large])
2181 AT_KEYWORDS([sack synthetic system file negative])
2182 AT_DATA([sys-file.sack], [dnl
2184 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2185 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2187 dnl Numeric variable, no label or missing values.
2188 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2190 dnl Too-large extension record.
2191 7; 3; >>0xfffff000 * 2<<;
2193 for variant in be le; do
2194 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2195 AT_DATA([sys-file.sps], [dnl
2196 GET FILE='sys-file.sav'.
2198 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2199 error: `sys-file.sav' near offset 0xd8: Record type 7 subtype 3 too large.
2204 AT_SETUP([unknown extension record])
2205 AT_KEYWORDS([sack synthetic system file negative])
2206 AT_DATA([sys-file.sack], [dnl
2208 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2209 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2211 dnl Numeric variable, no label or missing values.
2212 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2214 dnl Unknown extension record type.
2217 dnl Character encoding record.
2218 7; 20; 1; 12; "windows-1252";
2220 dnl End of dictionary.
2223 for variant in be le; do
2224 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2225 AT_DATA([sys-file.sps], [dnl
2226 GET FILE='sys-file.sav'.
2228 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2229 "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."
2234 AT_SETUP([bad machine integer info size])
2235 AT_KEYWORDS([sack synthetic system file negative])
2236 AT_DATA([sys-file.sack], [dnl
2238 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2239 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2241 dnl Numeric variable, no label or missing values.
2242 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2244 dnl Machine integer info record.
2245 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252; >>1234<<;
2247 dnl Character encoding record.
2248 7; 20; 1; 12; "windows-1252";
2250 dnl End of dictionary.
2253 for variant in be le; do
2254 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2255 AT_DATA([sys-file.sps], [dnl
2256 GET FILE='sys-file.sav'.
2258 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2259 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 3 has bad count 9 (expected 8)."
2264 AT_SETUP([bad machine integer info float format])
2265 AT_KEYWORDS([sack synthetic system file negative])
2266 AT_DATA([sys-file.sack], [dnl
2268 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2269 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2271 dnl Numeric variable, no label or missing values.
2272 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2274 dnl Machine integer info record.
2275 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
2277 dnl Character encoding record.
2278 7; 20; 1; 12; "windows-1252";
2280 dnl End of dictionary.
2283 for variant in be le; do
2284 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2285 AT_DATA([sys-file.sps], [dnl
2286 GET FILE='sys-file.sav'.
2288 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2289 error: `sys-file.sav' near offset 0xd8: Floating-point representation indicated by system file (2) differs from expected (1).
2294 AT_SETUP([bad machine integer info endianness])
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 integer info record.
2305 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
2307 dnl Character encoding record.
2308 7; 20; 1; 12; "windows-1252";
2310 dnl End of dictionary.
2313 for variant in "be 1" "le 2"; do
2315 AT_CHECK([sack --$[1] sys-file.sack > sys-file.sav])
2316 AT_DATA([sys-file.sps], [dnl
2317 GET FILE='sys-file.sav'.
2320 AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2321 warning: \`sys-file.sav' near offset 0xd8: Integer format indicated by system file (3) differs from expected ($[2]).
2323 Variable,Description,Position
2330 AT_SETUP([bad machine floating-point info size])
2331 AT_KEYWORDS([sack synthetic system file negative])
2332 AT_DATA([sys-file.sack], [dnl
2334 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2335 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2337 dnl Numeric variable, no label or missing values.
2338 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2340 dnl Machine floating-point info record.
2341 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2343 dnl Character encoding record.
2344 7; 20; 1; 12; "windows-1252";
2346 dnl End of dictionary.
2349 for variant in be le; do
2350 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2351 AT_DATA([sys-file.sps], [dnl
2352 GET FILE='sys-file.sav'.
2354 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2355 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 4 has bad count 4 (expected 3)."
2360 AT_SETUP([wrong special floating point values])
2361 AT_KEYWORDS([sack synthetic system file negative])
2362 AT_DATA([sys-file.sack], [dnl
2364 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2365 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2367 dnl Numeric variable, no label or missing values.
2368 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2370 dnl Machine floating-point info record.
2371 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2373 dnl Character encoding record.
2374 7; 20; 1; 12; "windows-1252";
2376 dnl End of dictionary.
2379 for variant in be le; do
2380 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2381 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2383 AT_CHECK([pspp -O format=csv sys-file.sps | sed 's/ [(].*/.../'], [0], [dnl
2384 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 0...
2386 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 1...
2388 "warning: `sys-file.sav' near offset 0xd8: File specifies unexpected value 2...
2393 AT_SETUP([bad mrsets name])
2394 AT_KEYWORDS([sack synthetic system file negative multiple response])
2395 AT_DATA([sys-file.sack], [dnl
2397 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2399 16; dnl Nominal case size
2400 0; dnl Not compressed
2404 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
2408 2; 0; 0; 0; 0x050800 *2; i8 0x82; i8 0xa0; s6 "";
2409 2; 0; 0; 0; 0x050800 *2; s8 "B";
2410 2; 0; 0; 0; 0x050800 *2; s8 "C";
2413 2; 0; 0; 0; 0x050800 *2; s8 "D";
2414 2; 0; 0; 0; 0x050800 *2; s8 "E";
2415 2; 0; 0; 0; 0x050800 *2; s8 "F";
2416 2; 0; 0; 0; 0x050800 *2; s8 "G";
2419 2; 4; 0; 0; 0x010400 *2; s8 "H";
2420 2; 4; 0; 0; 0x010400 *2; s8 "I";
2421 2; 4; 0; 0; 0x010400 *2; s8 "J";
2424 2; 0; 0; 0; 0x050800 *2; s8 "K";
2425 2; 0; 0; 0; 0x050800 *2; s8 "L";
2426 2; 0; 0; 0; 0x050800 *2; s8 "M";
2429 2; 6; 0; 0; 0x010600 *2; s8 "N";
2430 2; 6; 0; 0; 0x010600 *2; s8 "O";
2431 2; 6; 0; 0; 0x010600 *2; s8 "P";
2433 dnl Machine integer info record.
2434 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 932;
2438 "$a=C 10 my mcgroup "; i8 0x82; i8 0xa0; " b c"; i8 10;
2439 "b=D2 55 0 g e f d"; i8 10;
2440 "$c=D4 "; i8 0x82; i8 0xcd; i8 0x82; i8 0xa2; " 10 mdgroup #2 h i j"; i8 10);
2444 "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
2445 "e=E 11 6 choice 0 n o p"; i8 10);
2447 dnl Character encoding record.
2448 7; 20; 1; 9; "shift_jis";
2450 dnl Dictionary termination record.
2453 for variant in be le; do
2454 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2455 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2456 MRSETS /DISPLAY NAME=ALL.
2458 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2459 warning: `sys-file.sav': Multiple response set name `b' does not begin with `$'.
2461 warning: `sys-file.sav': Multiple response set name `e' does not begin with `$'.
2463 Table: Multiple Response Sets
2464 Name,Variables,Details
2468 ","Multiple category set
2474 ","Multiple dichotomy set
2476 Label source: Provided by user
2478 Category label source: Variable labels
2483 ","Multiple dichotomy set
2484 Label: third mdgroup
2485 Label source: Provided by user
2487 Category label source: Value labels of counted value
2493 AT_SETUP([missing space after C in mrsets])
2494 AT_KEYWORDS([sack synthetic system file negative multiple response])
2495 AT_DATA([sys-file.sack], [dnl
2497 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2498 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2500 dnl Numeric variable, no label or missing values.
2501 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2503 dnl Multiple response sets.
2504 7; 7; 1; COUNT("$a=Cx");
2506 dnl Character encoding record.
2507 7; 20; 1; 12; "windows-1252";
2511 for variant in be le; do
2512 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2513 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2515 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2516 warning: `sys-file.sav' near offset 0xd8: Missing space following `C' at offset 4 in MRSETS record.
2521 AT_SETUP([missing space after E in mrsets])
2522 AT_KEYWORDS([sack synthetic system file negative multiple response])
2523 AT_DATA([sys-file.sack], [dnl
2525 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2526 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2528 dnl Numeric variable, no label or missing values.
2529 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2531 dnl Multiple response sets.
2532 7; 7; 1; COUNT("$a=Ex");
2534 dnl Character encoding record.
2535 7; 20; 1; 12; "windows-1252";
2539 for variant in be le; do
2540 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2541 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2543 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2544 warning: `sys-file.sav' near offset 0xd8: Missing space following `E' at offset 4 in MRSETS record.
2549 AT_SETUP([unexpected label source in mrsets])
2550 AT_KEYWORDS([sack synthetic system file negative multiple response])
2551 AT_DATA([sys-file.sack], [dnl
2553 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2554 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2556 dnl Numeric variable, no label or missing values.
2557 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2559 dnl Multiple response sets.
2560 7; 7; 1; COUNT("$a=E 2");
2562 dnl Character encoding record.
2563 7; 20; 1; 12; "windows-1252";
2567 for variant in be le; do
2568 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2569 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2571 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2572 warning: `sys-file.sav' near offset 0xd8: Unexpected label source value following `E' at offset 7 in MRSETS record.
2574 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 7 in MRSETS record.
2579 AT_SETUP([bad type character in mrsets])
2580 AT_KEYWORDS([sack synthetic system file negative multiple response])
2581 AT_DATA([sys-file.sack], [dnl
2583 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2584 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2586 dnl Numeric variable, no label or missing values.
2587 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2589 dnl Multiple response sets.
2590 7; 7; 1; COUNT("$a=");
2592 dnl Character encoding record.
2593 7; 20; 1; 12; "windows-1252";
2597 for variant in be le; do
2598 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2599 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2601 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2602 "warning: `sys-file.sav' near offset 0xd8: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2607 AT_SETUP([bad counted string length in mrsets])
2608 AT_KEYWORDS([sack synthetic system file negative multiple response])
2609 AT_DATA([sys-file.sack], [dnl
2611 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2612 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2614 dnl Numeric variable, no label or missing values.
2615 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2617 dnl Multiple response sets.
2618 7; 7; 1; COUNT("$a=Dx");
2620 dnl Character encoding record.
2621 7; 20; 1; 12; "windows-1252";
2625 for variant in be le; do
2626 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2627 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2629 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2630 warning: `sys-file.sav' near offset 0xd8: Expecting digit at offset 4 in MRSETS record.
2635 AT_SETUP([missing space in counted string in mrsets])
2636 AT_KEYWORDS([sack synthetic system file negative multiple response])
2637 AT_DATA([sys-file.sack], [dnl
2639 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2640 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2642 dnl Numeric variable, no label or missing values.
2643 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2645 dnl Multiple response sets.
2646 7; 7; 1; COUNT("$a=D1x");
2648 dnl Character encoding record.
2649 7; 20; 1; 12; "windows-1252";
2653 for variant in be le; do
2654 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2655 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2657 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2658 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 5 in MRSETS record.
2663 AT_SETUP([counted string too long in mrsets])
2664 AT_KEYWORDS([sack synthetic system file negative multiple response])
2665 AT_DATA([sys-file.sack], [dnl
2667 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2668 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2670 dnl Numeric variable, no label or missing values.
2671 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2673 dnl Multiple response sets.
2674 7; 7; 1; COUNT("$a=D4 abc");
2676 dnl Character encoding record.
2677 7; 20; 1; 12; "windows-1252";
2681 for variant in be le; do
2682 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2683 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2685 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2686 warning: `sys-file.sav' near offset 0xd8: 4-byte string starting at offset 6 exceeds record length 9.
2691 AT_SETUP([missing space after counted string in mrsets])
2692 AT_KEYWORDS([sack synthetic system file negative multiple response])
2693 AT_DATA([sys-file.sack], [dnl
2695 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2696 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2698 dnl Numeric variable, no label or missing values.
2699 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2701 dnl Multiple response sets.
2702 7; 7; 1; COUNT("$a=D3 abcx");
2704 dnl Character encoding record.
2705 7; 20; 1; 12; "windows-1252";
2709 for variant in be le; do
2710 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2711 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2713 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2714 warning: `sys-file.sav' near offset 0xd8: Expecting space at offset 9 following 3-byte string.
2719 AT_SETUP([missing newline after variable name in mrsets])
2720 AT_KEYWORDS([sack synthetic system file negative multiple response])
2721 AT_DATA([sys-file.sack], [dnl
2723 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2724 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2726 dnl Numeric variable, no label or missing values.
2727 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2729 dnl Multiple response sets.
2730 7; 7; 1; COUNT("$a=C 0 NUM1");
2732 dnl Character encoding record.
2733 7; 20; 1; 12; "windows-1252";
2737 for variant in be le; do
2738 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2739 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2741 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2742 warning: `sys-file.sav' near offset 0xd8: Missing new-line parsing variable names at offset 13 in MRSETS record.
2744 warning: `sys-file.sav': MRSET $a has only one variable.
2749 AT_SETUP([duplicate variable name in mrsets])
2750 AT_KEYWORDS([sack synthetic system file negative multiple response])
2751 AT_DATA([sys-file.sack], [dnl
2753 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2754 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2756 dnl Numeric variable, no label or missing values.
2757 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2759 dnl Multiple response sets.
2760 7; 7; 1; COUNT("$a=C 0 NUM1 NUM1"; i8 10);
2762 dnl Character encoding record.
2763 7; 20; 1; 12; "windows-1252";
2767 for variant in be le; do
2768 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2769 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2771 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2772 warning: `sys-file.sav': MRSET $a contains duplicate variable name NUM1.
2774 warning: `sys-file.sav': MRSET $a has only one variable.
2779 AT_SETUP([mixed variable types in mrsets])
2780 AT_KEYWORDS([sack synthetic system file negative multiple response])
2781 AT_DATA([sys-file.sack], [dnl
2783 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2784 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2787 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2788 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2790 dnl Multiple response sets.
2791 7; 7; 1; COUNT("$a=C 0 NUM1 STR1"; i8 10);
2793 dnl Character encoding record.
2794 7; 20; 1; 12; "windows-1252";
2798 for variant in be le; do
2799 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2800 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2802 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2803 warning: `sys-file.sav': MRSET $a contains both string and numeric variables.
2805 warning: `sys-file.sav': MRSET $a has only one variable.
2810 AT_SETUP([missing newline after variable name in mrsets])
2811 AT_KEYWORDS([sack synthetic system file negative multiple response])
2812 AT_DATA([sys-file.sack], [dnl
2814 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2815 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2817 dnl Numeric variable, no label or missing values.
2818 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2820 dnl Multiple response sets.
2821 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10);
2823 dnl Character encoding record.
2824 7; 20; 1; 12; "windows-1252";
2828 for variant in be le; do
2829 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2830 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2832 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2833 warning: `sys-file.sav': MRSET $a has only one variable.
2838 AT_SETUP([zero or one variable in mrset])
2839 AT_KEYWORDS([sack synthetic system file negative multiple response])
2840 AT_DATA([sys-file.sack], [dnl
2842 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2843 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2845 dnl Numeric variable, no label or missing values.
2846 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2848 dnl Multiple response sets.
2849 7; 7; 1; COUNT("$a=C 0 NUM1"; i8 10; "$b=C 0 "; i8 10);
2851 dnl Character encoding record.
2852 7; 20; 1; 12; "windows-1252";
2856 for variant in be le; do
2857 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2858 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2860 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2861 warning: `sys-file.sav': MRSET $a has only one variable.
2863 warning: `sys-file.sav': MRSET $b has no variables.
2868 AT_SETUP([wrong display parameter size])
2869 AT_KEYWORDS([sack synthetic system file negative])
2870 AT_DATA([sys-file.sack], [dnl
2872 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2873 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2875 dnl Numeric variable, no label or missing values.
2876 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2878 dnl Display parameters record.
2879 7; 11; >>8<<; 2; 1.0; 1.0;
2881 dnl Character encoding record.
2882 7; 20; 1; 12; "windows-1252";
2884 dnl End of dictionary.
2887 for variant in be le; do
2888 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2889 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2891 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2892 "warning: `sys-file.sav' near offset 0xd8: Record type 7, subtype 11 has bad size 8 (expected 4)."
2897 AT_SETUP([wrong display parameter count])
2898 AT_KEYWORDS([sack synthetic system file negative])
2899 AT_DATA([sys-file.sack], [dnl
2901 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2902 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2904 dnl Numeric variable, no label or missing values.
2905 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2907 dnl Display parameters record.
2908 7; 11; 4; >>4<<; 1; 1; 2; 2;
2910 dnl Character encoding record.
2911 7; 20; 1; 12; "windows-1252";
2913 dnl End of dictionary.
2916 for variant in be le; do
2917 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2918 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2920 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2921 warning: `sys-file.sav' near offset 0xd8: Extension 11 has bad count 4 (for 1 variables).
2926 AT_SETUP([wrong display measurement level])
2927 AT_KEYWORDS([sack synthetic system file negative])
2928 AT_DATA([sys-file.sack], [dnl
2930 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2931 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2933 dnl Numeric variable, no label or missing values.
2934 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2936 dnl Display parameters record.
2937 7; 11; 4; 2; >>4<<; 0;
2939 dnl Character encoding record.
2940 7; 20; 1; 12; "windows-1252";
2942 dnl End of dictionary.
2945 for variant in be le; do
2946 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2947 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2949 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2950 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
2955 AT_SETUP([wrong display alignment])
2956 AT_KEYWORDS([sack synthetic system file negative])
2957 AT_DATA([sys-file.sack], [dnl
2959 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2960 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2962 dnl Numeric variable, no label or missing values.
2963 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2965 dnl Display parameters record.
2966 7; 11; 4; 2; 1; >>-1<<;
2968 dnl Character encoding record.
2969 7; 20; 1; 12; "windows-1252";
2971 dnl End of dictionary.
2974 for variant in be le; do
2975 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
2976 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2978 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2979 warning: `sys-file.sav' near offset 0xd8: Invalid variable display parameters for variable 0 (NUM1). Default parameters substituted.
2984 AT_SETUP([bad variable name in variable/value pair])
2985 AT_KEYWORDS([sack synthetic system file negative])
2986 AT_DATA([sys-file.sack], [dnl
2988 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2989 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2991 dnl Numeric variables.
2992 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2994 dnl Long variable names.
2995 7; 13; 1; COUNT (>>"xyzzy"<<);
2997 dnl Character encoding record.
2998 7; 20; 1; 12; "windows-1252";
3000 dnl Dictionary termination record.
3003 for variant in be le; do
3004 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3005 AT_DATA([sys-file.sps], [dnl
3006 GET FILE='sys-file.sav'.
3008 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3009 warning: `sys-file.sav' near offset 0xde: Dictionary record refers to unknown variable xyzzy.
3014 AT_SETUP([duplicate long variable name])
3015 AT_KEYWORDS([sack synthetic system file negative])
3016 AT_DATA([sys-file.sack], [dnl
3018 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3019 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3021 dnl Numeric variables.
3022 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
3023 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
3024 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
3025 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
3027 dnl Long variable names.
3029 "LONGVARI=_Invalid"; i8 9;
3030 "LONGVA_A=LongVariableName"; i8 9;
3031 "LONGVA_B=LONGVARIABLENAME"; 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], [0], [dnl
3046 warning: `sys-file.sav' near offset 0x138: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
3048 warning: `sys-file.sav' near offset 0x138: Duplicate long variable name `LONGVARIABLENAME'.
3053 AT_SETUP([bad very long string length])
3054 AT_KEYWORDS([sack synthetic system file negative])
3055 AT_DATA([sys-file.sack], [dnl
3057 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3058 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3060 dnl Numeric variable.
3061 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3063 dnl Very long string map.
3065 "NUM1=00000"; i8 0; i8 9;
3066 "NUM1=00255"; i8 0; i8 9;
3067 "NUM1=00256"; i8 0; i8 9;
3070 dnl Character encoding record.
3071 7; 20; 1; 12; "windows-1252";
3073 dnl Dictionary termination record.
3076 for variant in be le; do
3077 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3078 AT_DATA([sys-file.sps], [dnl
3079 GET FILE='sys-file.sav'.
3081 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3082 warning: `sys-file.sav' near offset 0xd8: NUM1 listed as string of invalid length 00000 in very long string record.
3084 "warning: `sys-file.sav' near offset 0xd8: NUM1 listed in very long string record with width 00255, which requires only one segment."
3086 error: `sys-file.sav' near offset 0xd8: Very long string NUM1 overflows dictionary.
3091 AT_SETUP([bad very long string segment width])
3092 AT_KEYWORDS([sack synthetic system file negative])
3093 AT_DATA([sys-file.sack], [dnl
3095 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3096 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3099 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
3100 (2; -1; 0; 0; 0; 0; s8 "") * 31;
3101 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
3102 >>2; -1; 0; 0; 0; 0; s8 "";<<
3104 dnl Very long string map.
3106 "STR1=00256"; i8 0; i8 9;
3109 dnl Character encoding record.
3110 7; 20; 1; 12; "windows-1252";
3112 dnl Dictionary termination record.
3115 for variant in be le; do
3116 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3117 AT_DATA([sys-file.sps], [dnl
3118 GET FILE='sys-file.sav'.
3120 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3121 error: `sys-file.sav' near offset 0x4f8: Very long string with width 256 has segment 1 of width 9 (expected 4).
3126 AT_SETUP([too many value labels])
3127 AT_KEYWORDS([sack synthetic system file negative])
3128 AT_DATA([sys-file.sack], [dnl
3130 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3131 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3133 dnl Numeric variable.
3134 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3137 for variant in be le; do
3138 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3139 AT_DATA([sys-file.sps], [dnl
3140 GET FILE='sys-file.sav'.
3142 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3143 error: `sys-file.sav' near offset 0xd4: Invalid number of labels 2147483647.
3148 AT_SETUP([missing type 4 record])
3149 AT_KEYWORDS([sack synthetic system file negative])
3150 AT_DATA([sys-file.sack], [dnl
3152 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3153 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3155 dnl Numeric variable.
3156 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3158 dnl Value label with missing type 4 record.
3159 3; 1; 1.0; i8 3; s7 "one";
3161 dnl Character encoding record.
3162 7; 20; 1; 12; "windows-1252";
3164 dnl End of dictionary.
3167 for variant in be le; do
3168 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3169 AT_DATA([sys-file.sps], [dnl
3170 GET FILE='sys-file.sav'.
3172 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3173 error: `sys-file.sav' near offset 0xe8: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
3178 AT_SETUP([value label with no associated variables])
3179 AT_KEYWORDS([sack synthetic system file negative])
3180 AT_DATA([sys-file.sack], [dnl
3182 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3183 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3185 dnl Numeric variable.
3186 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3188 dnl Value label with no variables.
3189 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
3191 for variant in be le; do
3192 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3193 AT_DATA([sys-file.sps], [dnl
3194 GET FILE='sys-file.sav'.
3196 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3197 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).
3202 AT_SETUP([type 4 record names long string variable])
3203 AT_KEYWORDS([sack synthetic system file negative])
3204 AT_DATA([sys-file.sack], [dnl
3206 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3207 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3209 dnl Long string variable.
3210 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
3211 2; -1; 0; 0; 0; 0; s8 "";
3213 dnl Value label that names long string variable.
3214 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
3216 dnl Character encoding record.
3217 7; 20; 1; 12; "windows-1252";
3219 dnl End of dictionary.
3222 for variant in be le; do
3223 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3224 AT_DATA([sys-file.sps], [dnl
3225 GET FILE='sys-file.sav'.
3227 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3228 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.
3233 AT_SETUP([variables for value label must all be same type])
3234 AT_KEYWORDS([sack synthetic system file negative])
3235 AT_DATA([sys-file.sack], [dnl
3237 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3238 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3241 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3242 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3244 dnl Value label that names numeric and string variables.
3245 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
3247 dnl Character encoding record.
3248 7; 20; 1; 12; "windows-1252";
3250 dnl End of dictionary.
3253 for variant in be le; do
3254 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3255 AT_DATA([sys-file.sps], [dnl
3256 GET FILE='sys-file.sav'.
3258 AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
3259 "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."
3264 AT_SETUP([duplicate value labels type])
3265 AT_KEYWORDS([sack synthetic system file negative])
3266 AT_DATA([sys-file.sack], [dnl
3268 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3269 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3272 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
3273 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3275 dnl Duplicate value labels.
3276 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
3277 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
3279 dnl Character encoding record.
3280 7; 20; 1; 12; "windows-1252";
3282 dnl End of dictionary.
3285 for variant in be le; do
3286 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3287 AT_DATA([sys-file.sps], [dnl
3288 GET FILE='sys-file.sav'.
3290 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3291 warning: `sys-file.sav' near offset 0xf4: Duplicate value label for `xyzzy ' on STR1.
3293 warning: `sys-file.sav' near offset 0x11c: Duplicate value label for 1 on NUM1.
3298 AT_SETUP([missing attribute value])
3299 AT_KEYWORDS([sack synthetic system file negative])
3300 AT_DATA([sys-file.sack], [dnl
3302 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3303 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3306 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3308 dnl Data file attributes record.
3313 dnl Variable attributes record.
3319 dnl Character encoding record.
3320 7; 20; 1; 12; "windows-1252";
3322 dnl Dictionary termination record.
3325 for variant in be le; do
3326 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3327 AT_DATA([sys-file.sps], [dnl
3328 GET FILE='sys-file.sav'.
3330 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3331 warning: `sys-file.sav' near offset 0xde: Error parsing attribute value Attr1[[1]].
3333 warning: `sys-file.sav' near offset 0x101: Error parsing attribute value fred[[2]].
3338 AT_SETUP([unquoted attribute value])
3339 AT_KEYWORDS([sack synthetic system file negative])
3340 AT_DATA([sys-file.sack], [dnl
3342 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3343 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3346 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3348 dnl Data file attributes record.
3350 "Attr1(value"; i8 10;
3354 dnl Variable attributes record.
3357 "fred(23"; i8 10; ")"
3360 dnl Character encoding record.
3361 7; 20; 1; 12; "windows-1252";
3363 dnl Dictionary termination record.
3366 for variant in be le; do
3367 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3368 AT_DATA([sys-file.sps], [dnl
3369 GET FILE='sys-file.sav'.
3371 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3372 warning: `sys-file.sav' near offset 0xe4: Attribute value Attr1[[1]] is not quoted: value.
3374 warning: `sys-file.sav' near offset 0x106: Attribute value fred[[1]] is not quoted: 23.
3379 AT_SETUP([bad variable name in long string value label])
3380 AT_KEYWORDS([sack synthetic system file negative])
3381 AT_DATA([sys-file.sack], [dnl
3383 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3384 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3387 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3388 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3389 2; -1; 0; 0; 0; 0; s8 "";
3392 dnl No variable named STR9.
3393 COUNT(>>"STR9"<<); 9;
3394 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3396 dnl NUM1 is numeric.
3397 COUNT(>>"NUM1"<<); 0;
3398 1; COUNT("xyz"); COUNT("value label for 1.0");
3400 dnl Wrong width for STR14.
3401 COUNT("STR14"); >>9<<;
3402 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3404 dnl Wrong width for value.
3406 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3408 dnl Duplicate value label.
3409 COUNT("STR14"); 14; 2;
3410 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3411 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3414 dnl Character encoding record.
3415 7; 20; 1; 12; "windows-1252";
3417 dnl Dictionary termination record.
3420 for variant in be le; do
3421 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3422 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3424 AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3425 warning: `sys-file.sav' near offset 0x128: Ignoring long string value label record for unknown variable STR9.
3427 warning: `sys-file.sav' near offset 0x164: Ignoring long string value label record for numeric variable NUM1.
3429 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).
3431 "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."
3433 warning: `sys-file.sav' near offset 0x259: Duplicate value label for `abcdefghijklmn' on str14.
3438 AT_SETUP([fewer data records than indicated by file header])
3439 AT_KEYWORDS([sack synthetic system file negative])
3440 AT_DATA([sys-file.sack], [dnl
3442 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3443 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3445 dnl Numeric variables.
3446 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3447 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3449 dnl Character encoding record.
3450 7; 20; 1; 12; "windows-1252";
3458 dnl Missing record here.
3460 for variant in be le; do
3461 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3462 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3465 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3466 [error: Error reading case from file `sys-file.sav'.
3478 AT_SETUP([partial data record between variables])
3479 AT_KEYWORDS([sack synthetic system file negative])
3480 AT_DATA([sys-file.sack], [dnl
3482 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3483 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3485 dnl Numeric variables.
3486 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3487 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3489 dnl Character encoding record.
3490 7; 20; 1; 12; "windows-1252";
3497 for variant in be le; do
3498 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3499 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3502 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3503 [error: `sys-file.sav' near offset 0x12c: File ends in partial case.
3512 AT_SETUP([partial data record within long string])
3513 AT_KEYWORDS([sack synthetic system file negative])
3514 AT_DATA([sys-file.sack], [dnl
3516 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3517 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3519 dnl Numeric variables.
3520 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3521 2; -1; 0; 0; 0; 0; s8 "";
3523 dnl Character encoding record.
3524 7; 20; 1; 12; "windows-1252";
3528 s14 "one data item";
3531 for variant in be le; do
3532 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3533 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3536 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3537 [error: `sys-file.sav' near offset 0x12a: Unexpected end of file.
3546 AT_SETUP([partial compressed data record])
3547 AT_KEYWORDS([sack synthetic system file positive])
3548 AT_DATA([sys-file.sack], [dnl
3550 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3552 6; dnl Nominal case size
3555 -1; dnl Unspecified number of cases.
3557 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3560 dnl Numeric variables.
3561 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3562 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3564 dnl String variable.
3565 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3566 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3567 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3568 2; -1; 0; 0; 0; 0; s8 "";
3570 dnl Character encoding record.
3571 7; 20; 1; 12; "windows-1252";
3573 dnl Dictionary termination record.
3576 dnl Compressed data.
3577 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3579 for variant in be le; do
3580 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3581 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3584 AT_CHECK([pspp -O format=csv sys-file.sps], [1],
3585 [error: `sys-file.sav' near offset 0x1ac: File ends in partial case.
3588 num1,num2,str4,str8,str15
3589 -99,0,,abcdefgh,0123 @&t@
3594 AT_SETUP([zcompressed data - bad zheader_ofs])
3595 AT_KEYWORDS([sack synthetic system file negative zlib])
3596 zcompressed_sack | sed 's/.*zheader_ofs.*/>>i64 0<<;/' > sys-file.sack
3597 for variant in be le; do
3598 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3599 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3601 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).
3606 AT_SETUP([zcompressed data - bad ztrailer_ofs])
3607 AT_KEYWORDS([sack synthetic system file negative zlib])
3608 zcompressed_sack | sed 's/.*ztrailer_ofs.*/>>i64 0<<;/' > sys-file.sack
3609 for variant in be le; do
3610 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3611 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3613 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Impossible ZLIB trailer offset 0x0.
3618 # ztrailer_len must be a multiple of 24 and at least 48,
3619 # so a value of 12 is impossible.
3620 AT_SETUP([zcompressed data - invalid ztrailer_len])
3621 AT_KEYWORDS([sack synthetic system file negative zlib])
3622 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 12<<;/' > sys-file.sack
3623 for variant in be le; do
3624 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3625 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3627 AT_CHECK([pspp -o pspp.csv sys-file.sps], [1], [error: `sys-file.sav' near offset 0x194: Invalid ZLIB trailer length 12.
3632 # ztrailer_ofs + ztrailer_len must be the file size.
3633 AT_SETUP([zcompressed data - wrong ztrailer_len])
3634 AT_KEYWORDS([sack synthetic system file negative zlib])
3635 zcompressed_sack | sed 's/.*ztrailer_len.*/>>i64 72<<;/' > sys-file.sack
3636 for variant in be le; do
3637 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3638 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3640 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).
3641 error: `sys-file.sav' near offset 0x21d: 72-byte ZLIB trailer specifies 1 data blocks (expected 2).
3646 AT_SETUP([zcompressed data - wrong ztrailer_bias])
3647 AT_KEYWORDS([sack synthetic system file negative zlib])
3648 zcompressed_sack | sed 's/.*ztrailer_bias.*/>>i64 0<<;/' > sys-file.sack
3649 for variant in be le; do
3650 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3651 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3653 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).
3658 AT_SETUP([zcompressed data - wrong ztrailer_zero])
3659 AT_KEYWORDS([sack synthetic system file negative zlib])
3660 zcompressed_sack | sed 's/.*ztrailer_zero.*/>>i64 100<<;/' > sys-file.sack
3661 for variant in be le; do
3662 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3663 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3665 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x215: ZLIB trailer "zero" field has nonzero value 100.
3670 AT_SETUP([zcompressed data - wrong block_size])
3671 AT_KEYWORDS([sack synthetic system file negative zlib])
3672 zcompressed_sack | sed 's/.*block_size.*/>>0x1000<<;/' > sys-file.sack
3673 for variant in be le; do
3674 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3675 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3677 AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], [warning: `sys-file.sav' near offset 0x219: ZLIB trailer specifies unexpected 4096-byte block size.
3682 AT_SETUP([zcompressed data - wrong n_blocks])
3683 AT_KEYWORDS([sack synthetic system file negative zlib])
3684 zcompressed_sack | sed 's/.*n_blocks.*/>>2<<;/' > sys-file.sack
3685 for variant in be le; do
3686 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3687 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3689 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).
3694 AT_SETUP([zcompressed data - wrong uncompressed_ofs])
3695 AT_KEYWORDS([sack synthetic system file negative zlib])
3696 zcompressed_sack | sed 's/.*uncompressed_ofs.*/i64 >>0x177<<;/' > sys-file.sack
3697 for variant in be le; do
3698 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3699 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3701 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.
3706 AT_SETUP([zcompressed data - wrong compressed_ofs])
3707 AT_KEYWORDS([sack synthetic system file negative zlib])
3708 zcompressed_sack | sed 's/.*@%:@ compressed_ofs.*/i64 >>0x191<<;/' > sys-file.sack
3709 for variant in be le; do
3710 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3711 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3713 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.
3718 AT_SETUP([zcompressed data - compressed sizes don't add up])
3719 AT_KEYWORDS([sack synthetic system file negative zlib])
3720 AT_DATA([sys-file.sack], [dnl
3722 "$FL3"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3724 6; dnl Nominal case size
3725 2; dnl zlib compressed
3727 -1; dnl Unspecified number of cases.
3729 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3732 dnl Numeric variables.
3733 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3734 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3736 dnl String variable.
3737 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3738 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3739 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3740 2; -1; 0; 0; 0; 0; s8 "";
3742 dnl Character encoding record.
3743 7; 20; 1; 12; "windows-1252";
3745 dnl Dictionary termination record.
3748 dnl ZLIB data header.
3749 i64 0x194; # zheader_ofs
3750 i64 0x1ac; # ztrailer_ofs
3751 i64 72; # ztrailer_len
3753 dnl This is where the ZLIB data blocks would go, but we don't need any to
3754 dnl provoke this message so we omit them.
3756 dnl ZLIB data trailer fixed header:
3757 i64 -100; # ztrailer_bias
3758 i64 0; # ztrailer_zero
3759 0x3ff000; # block_size
3762 dnl ZLIB block descriptor 1:
3763 i64 0x194; # uncompressed_ofs
3764 i64 0x1ac; # compressed_ofs
3765 0x100000; # uncompressed_size
3766 0x12345; # compressed_size
3768 dnl ZLIB block descriptor 2:
3769 i64 0x100194; # uncompressed_ofs
3770 i64 0x12421; # compressed_ofs
3771 0x100000; # uncompressed_size
3772 0x12345; # compressed_size
3774 for variant in be le; do
3775 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3776 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3778 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.
3779 error: `sys-file.sav' near offset 0x1dc: ZLIB block descriptor 1 reported compressed data offset 0x12421, when 0x124f1 was expected.
3784 AT_SETUP([zcompressed data - uncompressed_size > block_size])
3785 AT_KEYWORDS([sack synthetic system file negative zlib])
3786 zcompressed_sack | sed 's/.*uncompressed_size.*/>>0x400000<<;/' > sys-file.sack
3787 for variant in be le; do
3788 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3789 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3791 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.
3796 AT_SETUP([zcompressed data - compression expands data too much])
3797 AT_KEYWORDS([sack synthetic system file negative zlib])
3798 zcompressed_sack | sed 's/.*uncompressed_size.*/>>50<<;/
3799 s/.*@%:@ compressed_size.*/>>100<<;/' > sys-file.sack
3800 for variant in be le; do
3801 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3802 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3804 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.
3809 AT_SETUP([zcompressed data - compressed sizes don't add up])
3810 AT_KEYWORDS([sack synthetic system file negative zlib])
3811 zcompressed_sack | sed 's/.*@%:@ compressed_size.*/>>88<<;/' > sys-file.sack
3812 for variant in be le; do
3813 AT_CHECK([sack --$variant sys-file.sack > sys-file.sav])
3814 AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3816 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.