1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
17 AT_BANNER([SPSS/PC+ file reader - positive])
19 AT_SETUP([variable labels and missing values])
20 AT_KEYWORDS([sack synthetic PC+ file positive])
21 AT_DATA([pc+-file.sack], [dnl
24 @MAIN; @MAIN_END - @MAIN;
25 @VARS; @VARS_END - @VARS;
26 @LABELS; @LABELS_END - @LABELS;
27 @DATA; @DATA_END - @DATA;
33 s62 "PCSPSS PSPP synthetic test product";
35 0; 0; i16 1; dnl Fixed.
43 s64 "PSPP synthetic test file";
47 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
48 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
49 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
51 dnl Numeric variable, no label or missing values.
52 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
54 dnl Numeric variable, variable label.
55 0; 0; @NUM2_LABEL - @LABELS_OFS; 0x050800; s8 "NUM2"; PCSYSMIS;
57 dnl Numeric variable with missing value.
58 0; 0; 0; 0x050800; s8 "NUM3"; 1.0;
60 dnl Numeric variable, variable label and missing value.
61 0; 0; @NUM4_LABEL - @LABELS_OFS; 0x050800; s8 "NUM4"; 2.0;
63 dnl String variable, no label or missing values.
64 0; 0; 0; 0x010800; s8 "STR1"; PCSYSMIS;
66 dnl String variable, variable label.
67 0; 0; @STR2_LABEL - @LABELS_OFS; 0x010400; s8 "STR2"; PCSYSMIS;
69 dnl String variable with missing value.
70 0; 0; 0; 0x010500; s8 "STR3"; s8 "MISS";
72 dnl String variable, variable label and missing value.
73 0; 0; @STR4_LABEL - @LABELS_OFS; 0x010100; s8 "STR4"; s8 "OTHR";
75 dnl Long string variable
76 0; 0; 0; 0x010b00; s8 "STR5"; PCSYSMIS;
79 dnl Long string variable with variable label
80 0; 0; @STR6_LABEL - @LABELS_OFS; 0x010b00; s8 "STR6"; PCSYSMIS;
85 3; i8 0 0 0; LABELS_OFS: i8 0;
86 NUM2_LABEL: COUNT8("Numeric variable 2's label");
87 NUM4_LABEL: COUNT8("Another numeric variable label");
88 STR2_LABEL: COUNT8("STR2's variable label");
89 STR4_LABEL: COUNT8("STR4's variable label");
90 STR6_LABEL: COUNT8("Another string variable's label");
95 0.0; 1.0; 2.0; PCSYSMIS; s8 "abcdefgh"; s8 "ijkl"; s8 "mnopq"; s8 "r";
96 s16 "stuvwxyzAB"; s16 "CDEFGHIJKLM";
99 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
100 AT_DATA([pc+-file.sps], [dnl
101 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
106 AT_CHECK([pspp -o pspp.csv pc+-file.sps])
107 AT_CHECK([cat pspp.csv], [0], [dnl
108 File label: PSPP synthetic test file
110 Variable,Description,Position
112 NUM2,"Label: Numeric variable 2's label
116 NUM4,"Label: Another numeric variable label
120 STR2,"Label: STR2's variable label
123 Missing Values: ""MISS """,7
124 STR4,"Label: STR4's variable label
126 Missing Values: ""O""",8
128 STR6,"Label: Another string variable's label
132 NUM1,NUM2,NUM3,NUM4,STR1,STR2,STR3,STR4,STR5,STR6
133 0,1,2,.,abcdefgh,ijkl,mnopq,r,stuvwxyzAB ,CDEFGHIJKLM
137 AT_SETUP([value labels])
138 AT_KEYWORDS([sack synthetic PC+ file positive])
139 AT_DATA([pc+-file.sack], [dnl
142 @MAIN; @MAIN_END - @MAIN;
143 @VARS; @VARS_END - @VARS;
144 @LABELS; @LABELS_END - @LABELS;
145 @DATA; @DATA_END - @DATA;
151 s62 "PCSPSS PSPP synthetic test product";
153 0; 0; i16 1; dnl Fixed.
161 s64 "PSPP synthetic test file";
165 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
166 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
167 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
169 dnl Numeric variables.
170 @N1 - @LOFF; @N1E - @LOFF; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
171 @N2 - @LOFF; @N2E - @LOFF; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
172 @N3 - @LOFF; @N3E - @LOFF; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
173 @N4 - @LOFF; @N4E - @LOFF; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
174 @N5 - @LOFF; @N5E - @LOFF; 0; 0x050800; s8 "NUM5"; PCSYSMIS;
176 dnl String variables.
177 @S1 - @LOFF; @S1E - @LOFF; 0; 0x010100; s8 "STR1"; PCSYSMIS;
178 @S2 - @LOFF; @S2E - @LOFF; 0; 0x010200; s8 "STR2"; PCSYSMIS;
179 @S3 - @LOFF; @S3E - @LOFF; 0; 0x010300; s8 "STR3"; PCSYSMIS;
180 @S4 - @LOFF; @S4E - @LOFF; 0; 0x010400; s8 "STR4"; PCSYSMIS;
181 @S5 - @LOFF; @S5E - @LOFF; 0; 0x010500; s8 "STR5"; PCSYSMIS;
182 @S6 - @LOFF; @S6E - @LOFF; 0; 0x010600; s8 "STR6"; PCSYSMIS;
183 @S7 - @LOFF; @S7E - @LOFF; 0; 0x010700; s8 "STR7"; PCSYSMIS;
184 @S8 - @LOFF; @S8E - @LOFF; 0; 0x010800; s8 "STR8"; PCSYSMIS;
188 3; i8 0 0 0; LOFF: i8 0;
190 N1: 1.0; COUNT8("one"); N1E:
191 N2: 2.0; COUNT8("two"); 3.0; COUNT8("three"); N2E:
193 3.0; COUNT8("three");
200 S1: s8 "a"; COUNT8("value label for `a'"); S1E:
201 S2: s8 "ab"; COUNT8("value label for `ab'"); S2E:
202 S3: s8 "abc"; COUNT8("value label for `abc'"); S3E:
204 s8 "abcdefgh"; COUNT8("value label for abcdefgh"); S4E:
206 s8 "ijklmnop"; COUNT8("value label for ijklmnop"); S5E:
207 s8 "qrstuvwx"; COUNT8("value label for qrstuvwx"); S6E:
208 s8 "yzABCDEF"; COUNT8("value label for yzABCDEF"); S7E:
209 s8 "GHIJKLMN"; COUNT8("value label for GHIJKLMN"); S8E:
213 1.0; "11/28/14"; 1.0;
214 1.0; 2.0; 3.0; 4.0; 5.0;
215 s8 "a"; s8 "bc"; s8 "cde"; s8 "fghj"; s8 "klmno"; s8 "pqrstu";
216 s8 "vwxyzAB"; s8 "CDEFGHIJ";
219 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
220 AT_DATA([pc+-file.sps], [dnl
221 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
226 AT_CHECK([pspp -o pspp.csv pc+-file.sps])
227 AT_CHECK([cat pspp.csv], [0], [dnl
228 File label: PSPP synthetic test file
230 Variable,Description,Position
257 a,value label for `a'",6
261 ab,value label for `ab'",7
265 abc,value label for `abc'",8
269 abcd,value label for abcdefgh",9
273 abcde,value label for abcdefgh
274 ijklm,value label for ijklmnop",10
278 abcdef,value label for abcdefgh
279 ijklmn,value label for ijklmnop
280 qrstuv,value label for qrstuvwx",11
284 abcdefg,value label for abcdefgh
285 ijklmno,value label for ijklmnop
286 qrstuvw,value label for qrstuvwx
287 yzABCDE,value label for yzABCDEF",12
291 GHIJKLMN,value label for GHIJKLMN
292 ijklmnop,value label for ijklmnop
293 qrstuvwx,value label for qrstuvwx
294 yzABCDEF,value label for yzABCDEF",13
297 NUM1,NUM2,NUM3,NUM4,NUM5,STR1,STR2,STR3,STR4,STR5,STR6,STR7,STR8
298 1,2,3,4,5,a,bc,cde,fghj,klmno,pqrstu,vwxyzAB,CDEFGHIJ
302 AT_SETUP([compressed data])
303 AT_KEYWORDS([sack synthetic PC+ file positive])
304 AT_DATA([pc+-file.sack], [dnl
307 @MAIN; @MAIN_END - @MAIN;
308 @VARS; @VARS_END - @VARS;
310 @DATA; @DATA_END - @DATA;
316 s62 "PCSPSS PSPP synthetic test product";
318 0; 0; i16 1; dnl Fixed.
326 s64 "PSPP synthetic test file";
330 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
331 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
332 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
334 dnl Numeric variables.
335 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
336 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
338 dnl String variables.
339 0; 0; 0; 0x010400; s8 "STR4"; PCSYSMIS;
340 0; 0; 0; 0x010800; s8 "STR8"; PCSYSMIS;
341 0; 0; 0; 0x010f00; s8 "STR15"; PCSYSMIS;
346 i8 101 1 101 100 255 1 1 1;
347 s8 "11/28/14"; s8 "abcd"; s8 "efghj"; s8 "efghijkl";
348 i8 1; i8 102 1 101 1 0 1 1;
349 s8 "ABCDEFG"; s8 "11/28/14"; 1000.0; s8 "PQRS"; s8 "TUVWXYZa";
351 s16 "bcdefghijklmnop";
354 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
355 AT_DATA([pc+-file.sps], [dnl
356 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
361 AT_CHECK([pspp -o pspp.csv pc+-file.sps])
362 AT_CHECK([cat pspp.csv], [0], [dnl
363 File label: PSPP synthetic test file
365 Variable,Description,Position
373 NUM1,NUM2,STR4,STR8,STR15
374 -5,150,abcd,efghj ,efghijklABCDEFG
375 1000,.,PQRS,TUVWXYZa,bcdefghijklmnop
380 AT_KEYWORDS([sack synthetic PC+ file negative])
381 AT_DATA([pc+-file.sack], [dnl
384 @MAIN; @MAIN_END - @MAIN;
385 @VARS; @VARS_END - @VARS;
387 @DATA; @DATA_END - @DATA;
393 s62 "PCSPSS PSPP synthetic test product";
395 0; 0; i16 1; dnl Fixed.
403 s64 "PSPP synthetic test file";
407 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
408 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
409 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
411 dnl Numeric variables.
412 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
413 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
414 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
415 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
419 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
422 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
423 AT_DATA([pc+-file.sps], [dnl
424 SYSFILE INFO FILE='pc+-file.sav' ENCODING='us-ascii'.
426 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
428 Label:,PSPP synthetic test file
429 Created:,11/28/14 15:11:00 by PCSPSS PSPP synthetic test product
430 Integer Format:,Little Endian
431 Real Format:,IEEE 754 LE.
434 Type:,SPSS/PC+ System File
439 Variable,Description,Position
443 Display Alignment: Right
448 Display Alignment: Right
453 Display Alignment: Right
458 Display Alignment: Right
463 AT_BANNER([SPSS/PC+ file reader - negative])
465 AT_SETUP([unspecified character encoding])
466 AT_KEYWORDS([sack synthetic PC+ file negative])
467 AT_DATA([pc+-file.sack], [dnl
470 @MAIN; @MAIN_END - @MAIN;
471 @VARS; @VARS_END - @VARS;
473 @DATA; @DATA_END - @DATA;
479 s62 "PCSPSS PSPP synthetic test product";
481 0; 0; i16 1; dnl Fixed.
489 s64 "PSPP synthetic test file";
493 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
494 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
495 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
497 dnl Numeric variables.
498 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
499 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
500 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
501 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
505 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
508 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
509 AT_DATA([pc+-file.sps], [dnl
510 GET FILE='pc+-file.sav'.
515 SYSFILE INFO FILE='pc+-file.sav' ENCODING='us-ascii'.
517 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [stdout], [])
518 AT_CHECK([sed 's/default encoding.*For/default encoding. For/' stdout], [0], [dnl
519 "warning: `pc+-file.sav': Using default encoding. For best results, specify an encoding explicitly. Use SYSFILE INFO with ENCODING=""DETECT"" to analyze the possible encodings."
521 File label: PSPP synthetic test file
523 Variable,Description,Position
534 Label:,PSPP synthetic test file
535 Created:,11/28/14 15:11:00 by PCSPSS PSPP synthetic test product
536 Integer Format:,Little Endian
537 Real Format:,IEEE 754 LE.
540 Type:,SPSS/PC+ System File
541 Weight:,Not weighted.
545 Variable,Description,Position
549 Display Alignment: Right
554 Display Alignment: Right
559 Display Alignment: Right
564 Display Alignment: Right
569 AT_SETUP([unexpected fixed values])
570 AT_KEYWORDS([sack synthetic PC+ file negative])
571 AT_DATA([pc+-file.sack], [dnl
574 @MAIN; @MAIN_END - @MAIN;
575 @VARS; @VARS_END - @VARS;
577 @DATA; @DATA_END - @DATA;
583 s62 "PCSPSS PSPP synthetic test product";
585 0; >>2<<; i16 1; dnl Fixed.
593 s64 "PSPP synthetic test file";
597 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
598 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
599 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
601 dnl Numeric variables.
602 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
603 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
604 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
605 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
609 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
612 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
613 AT_DATA([pc+-file.sps], [dnl
614 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
616 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
617 "warning: `pc+-file.sav' near offset 0x0: Directory fields have unexpected values (1,2)."
619 warning: `pc+-file.sav' near offset 0x100: Record 0 specifies unexpected system missing value 1 (0x1p+0).
621 "warning: `pc+-file.sav' near offset 0x100: Record 0 reserved fields have unexpected values (1,1,0,2,0,0)."
623 warning: `pc+-file.sav' near offset 0x100: Record 0 case counts differ (1 versus 3).
627 AT_SETUP([short main header])
628 AT_KEYWORDS([sack synthetic PC+ file negative])
629 AT_DATA([pc+-file.sack], [dnl
632 @MAIN; @MAIN_END - @MAIN;
633 @VARS; @VARS_END - @VARS;
635 @DATA; @DATA_END - @DATA;
641 s62 "PCSPSS PSPP synthetic test product";
643 0; 0; i16 1; dnl Fixed.
654 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
655 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
656 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
658 dnl Numeric variables.
659 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
660 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
661 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
662 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
666 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
669 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
670 AT_DATA([pc+-file.sps], [dnl
671 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
673 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
674 error: `pc+-file.sav' near offset 0x100: This is not an SPSS/PC+ system file.
678 AT_SETUP([long main header])
679 AT_KEYWORDS([sack synthetic PC+ file negative])
680 AT_DATA([pc+-file.sack], [dnl
683 @MAIN; @MAIN_END - @MAIN;
684 @VARS; @VARS_END - @VARS;
686 @DATA; @DATA_END - @DATA;
692 s62 "PCSPSS PSPP synthetic test product";
694 0; 0; i16 1; dnl Fixed.
702 >>s80 "PSPP synthetic test file"<<;
706 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
707 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
708 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
710 dnl Numeric variables.
711 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
712 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
713 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
714 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
718 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
721 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
722 AT_DATA([pc+-file.sps], [dnl
723 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
725 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
726 warning: `pc+-file.sav' near offset 0x100: Record 0 has unexpected length 192.
730 AT_SETUP([invalid compression type])
731 AT_KEYWORDS([sack synthetic PC+ file negative])
732 AT_DATA([pc+-file.sack], [dnl
735 @MAIN; @MAIN_END - @MAIN;
736 @VARS; @VARS_END - @VARS;
738 @DATA; @DATA_END - @DATA;
744 s62 "PCSPSS PSPP synthetic test product";
746 0; 0; i16 1; dnl Fixed.
754 s64 "PSPP synthetic test file";
758 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
759 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
760 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
762 dnl Numeric variables.
763 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
764 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
765 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
766 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
770 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
773 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
774 AT_DATA([pc+-file.sps], [dnl
775 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
777 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
778 error: `pc+-file.sav' near offset 0x100: Invalid compression type 2.
782 AT_SETUP([unrealistic number of cases])
783 AT_KEYWORDS([sack synthetic PC+ file negative])
784 AT_DATA([pc+-file.sack], [dnl
787 @MAIN; @MAIN_END - @MAIN;
788 @VARS; @VARS_END - @VARS;
790 @DATA; @DATA_END - @DATA;
796 s62 "PCSPSS PSPP synthetic test product";
798 0; 0; i16 1; dnl Fixed.
806 s64 "PSPP synthetic test file";
810 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
811 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
812 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
814 dnl Numeric variables.
815 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
816 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
817 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
818 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
822 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
825 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
826 AT_DATA([pc+-file.sps], [dnl
827 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
829 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
830 warning: `pc+-file.sav' near offset 0x100: Record 0 claims 1000 cases with 7 values per case (requiring at least 56000 bytes) but data record is only 56 bytes long.
834 AT_SETUP([labels bad offsets])
835 AT_KEYWORDS([sack synthetic PC+ file negative])
836 AT_DATA([pc+-file.sack], [dnl
839 @MAIN; @MAIN_END - @MAIN;
840 @VARS; @VARS_END - @VARS;
841 @LABELS; @LABELS_END - @LABELS;
842 @DATA; @DATA_END - @DATA;
848 s62 "PCSPSS PSPP synthetic test product";
850 0; 0; i16 1; dnl Fixed.
858 s64 "PSPP synthetic test file";
862 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
863 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
864 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
866 dnl Numeric variables.
867 @N1L - @LOFF; @N1E - @LOFF; 1000; 0x050800; s8 "NUM1"; PCSYSMIS;
868 @N1L - @LOFF - 1; @LABELS_END - @LOFF; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
869 @N1L - @LOFF + 1; @LABELS_END - @LOFF; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
870 0; 0; @LABELS_END - @LOFF - 1; 0x050800; s8 "NUM4"; PCSYSMIS;
874 3; i8 0 0 0; LOFF: i8 0;
879 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0; N1E:
882 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
883 AT_DATA([pc+-file.sps], [dnl
884 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
886 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
887 warning: `pc+-file.sav' near offset 0x210: Variable label claimed to start at offset 1007 in labels record but labels record is only 16 bytes.
889 warning: `pc+-file.sav' near offset 0x210: Value labels claimed to end at offset 72 in labels record but labels record is only 16 bytes.
891 "warning: `pc+-file.sav' near offset 0x2a0: Value labels end with partial label (0 bytes left in record, label length 255)."
893 warning: `pc+-file.sav' near offset 0x299: 7 leftover bytes following value labels.
895 warning: `pc+-file.sav' near offset 0x29f: Variable label with length 255 starting at offset 16 in labels record overruns end of 16-byte labels record.
899 AT_SETUP([record 1 bad length])
900 AT_KEYWORDS([sack synthetic PC+ file negative])
901 AT_DATA([pc+-file.sack], [dnl
904 @MAIN; @MAIN_END - @MAIN;
905 @VARS; @VARS_END - @VARS;
907 @DATA; @DATA_END - @DATA;
913 s62 "PCSPSS PSPP synthetic test product";
915 0; 0; i16 1; dnl Fixed.
923 s64 "PSPP synthetic test file";
927 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
928 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
929 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
931 dnl Numeric variables.
932 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
933 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
934 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
938 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
941 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
942 AT_DATA([pc+-file.sps], [dnl
943 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
945 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
946 error: `pc+-file.sav' near offset 0x1b0: Record 1 has length 192 (expected 224).
948 pc+-file.sps:1: error: GET: `pc+-file.sav': Data file dictionary has no variables.
952 AT_SETUP([bad variable format])
953 AT_KEYWORDS([sack synthetic PC+ file negative])
954 AT_DATA([pc+-file.sack], [dnl
957 @MAIN; @MAIN_END - @MAIN;
958 @VARS; @VARS_END - @VARS;
960 @DATA; @DATA_END - @DATA;
966 s62 "PCSPSS PSPP synthetic test product";
968 0; 0; i16 1; dnl Fixed.
976 s64 "PSPP synthetic test file";
980 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
981 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
982 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
984 dnl Numeric variables.
985 0; 0; 0; 0xff0000; s8 "NUM1"; PCSYSMIS;
986 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
987 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
988 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
992 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
995 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
996 AT_DATA([pc+-file.sps], [dnl
997 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
999 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
1000 error: `pc+-file.sav' near offset 0x210: Variable 3 has invalid type 255.
1004 AT_SETUP([bad variable name])
1005 AT_KEYWORDS([sack synthetic PC+ file negative])
1006 AT_DATA([pc+-file.sack], [dnl
1009 @MAIN; @MAIN_END - @MAIN;
1010 @VARS; @VARS_END - @VARS;
1012 @DATA; @DATA_END - @DATA;
1018 s62 "PCSPSS PSPP synthetic test product";
1020 0; 0; i16 1; dnl Fixed.
1028 s64 "PSPP synthetic test file";
1032 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1033 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1034 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1036 dnl Numeric variables.
1037 0; 0; 0; 0x050000; s8 "#NUM"; PCSYSMIS;
1038 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1039 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1040 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1044 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1047 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1048 AT_DATA([pc+-file.sps], [dnl
1049 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1051 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
1052 error: `pc+-file.sav' near offset 0x210: Invalid variable name `#NUM'.
1056 AT_SETUP([duplicate variable name])
1057 AT_KEYWORDS([sack synthetic PC+ file negative])
1058 AT_DATA([pc+-file.sack], [dnl
1061 @MAIN; @MAIN_END - @MAIN;
1062 @VARS; @VARS_END - @VARS;
1064 @DATA; @DATA_END - @DATA;
1070 s62 "PCSPSS PSPP synthetic test product";
1072 0; 0; i16 1; dnl Fixed.
1080 s64 "PSPP synthetic test file";
1084 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1085 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1086 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1088 dnl Numeric variables.
1089 0; 0; 0; 0x050000; s8 "NUM1"; PCSYSMIS;
1090 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1091 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1092 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1096 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1099 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1100 AT_DATA([pc+-file.sps], [dnl
1101 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1103 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
1104 warning: `pc+-file.sav' near offset 0x230: Renaming variable with duplicate name `NUM1' to `VAR001'.
1106 warning: `pc+-file.sav' near offset 0x250: Renaming variable with duplicate name `NUM1' to `VAR002'.
1108 warning: `pc+-file.sav' near offset 0x270: Renaming variable with duplicate name `NUM1' to `VAR003'.
1112 AT_SETUP([partial case])
1113 AT_KEYWORDS([sack synthetic PC+ file negative])
1114 AT_DATA([pc+-file.sack], [dnl
1117 @MAIN; @MAIN_END - @MAIN;
1118 @VARS; @VARS_END - @VARS;
1120 @DATA; @DATA_END - @DATA;
1126 s62 "PCSPSS PSPP synthetic test product";
1128 0; 0; i16 1; dnl Fixed.
1136 s64 "PSPP synthetic test file";
1140 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1141 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1142 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1144 dnl Numeric variables.
1145 0; 0; 0; 0x050000; s8 "NUM1"; PCSYSMIS;
1146 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1147 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1148 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1152 1.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1153 2.0; "11/28/14"; 1.0; 6.0; 7.0; 8.0; 9.0;
1154 3.0; "11/28/14"; 1.0; 10.0;
1157 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1158 AT_DATA([pc+-file.sps], [dnl
1159 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1162 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
1163 warning: `pc+-file.sav' near offset 0x100: Record 0 claims 3 cases with 7 values per case (requiring at least 168 bytes) but data record is only 144 bytes long.
1165 error: `pc+-file.sav' near offset 0x320: File ends in partial case.
1167 error: Error reading case from file `pc+-file.sav'.
1176 AT_SETUP([case extends past end of data record])
1177 AT_KEYWORDS([sack synthetic PC+ file negative])
1178 AT_DATA([pc+-file.sack], [dnl
1181 @MAIN; @MAIN_END - @MAIN;
1182 @VARS; @VARS_END - @VARS;
1184 @DATA; @DATA_END - @DATA;
1190 s62 "PCSPSS PSPP synthetic test product";
1192 0; 0; i16 1; dnl Fixed.
1200 s64 "PSPP synthetic test file";
1204 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1205 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1206 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1208 dnl Numeric variables.
1209 0; 0; 0; 0x050000; s8 "NUM1"; PCSYSMIS;
1210 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1211 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1212 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1216 1.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1217 2.0; "11/28/14"; 1.0; 6.0; 7.0; 8.0; 9.0;
1218 3.0; "11/28/14"; 1.0; 10.0;
1222 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1223 AT_DATA([pc+-file.sps], [dnl
1224 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1227 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
1228 warning: `pc+-file.sav' near offset 0x100: Record 0 claims 3 cases with 7 values per case (requiring at least 168 bytes) but data record is only 144 bytes long.
1230 error: `pc+-file.sav' near offset 0x338: Case beginning at offset 0x00000300 extends past end of data record at offset 0x00000320.
1232 error: Error reading case from file `pc+-file.sav'.
1241 AT_SETUP([corrupt compressed data])
1242 AT_KEYWORDS([sack synthetic PC+ file positive])
1243 AT_DATA([pc+-file.sack], [dnl
1246 @MAIN; @MAIN_END - @MAIN;
1247 @VARS; @VARS_END - @VARS;
1249 @DATA; @DATA_END - @DATA;
1255 s62 "PCSPSS PSPP synthetic test product";
1257 0; 0; i16 1; dnl Fixed.
1265 s64 "PSPP synthetic test file";
1269 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1270 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1271 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1273 dnl Numeric variables.
1274 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1275 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1277 dnl String variables.
1278 0; 0; 0; 0x010400; s8 "STR4"; PCSYSMIS;
1279 0; 0; 0; 0x010800; s8 "STR8"; PCSYSMIS;
1280 0; 0; 0; 0x010f00; s8 "STR15"; PCSYSMIS;
1285 i8 101 1 101 100 255 1 1 1;
1286 s8 "11/28/14"; s8 "abcd"; s8 "efghj"; s8 "efghijkl";
1287 i8 1; i8 102 101 101 1 0 1 1;
1288 s8 "ABCDEFG"; 1000.0; s8 "PQRS"; s8 "TUVWXYZa";
1290 s16 "bcdefghijklmnop";
1293 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1294 AT_DATA([pc+-file.sps], [dnl
1295 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1300 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
1301 File label: PSPP synthetic test file
1303 Variable,Description,Position
1310 warning: `pc+-file.sav' near offset 0x308: Possible compressed data corruption: string contains compressed integer (opcode 101).
1313 NUM1,NUM2,STR4,STR8,STR15
1314 -5,150,abcd,efghj ,efghijklABCDEFG
1315 1000,.,PQRS,TUVWXYZa,bcdefghijklmnop
1319 AT_SETUP([invalid weight index])
1320 AT_KEYWORDS([sack synthetic PC+ file negative])
1321 AT_DATA([pc+-file.sack], [dnl
1324 @MAIN; @MAIN_END - @MAIN;
1325 @VARS; @VARS_END - @VARS;
1327 @DATA; @DATA_END - @DATA;
1333 s62 "PCSPSS PSPP synthetic test product";
1335 0; 0; i16 1; dnl Fixed.
1343 s64 "PSPP synthetic test file";
1347 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1348 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1349 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1351 dnl Numeric variables.
1352 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1353 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1354 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1355 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1359 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1362 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1363 AT_DATA([pc+-file.sps], [dnl
1364 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1366 AT_CHECK([pspp -O format=csv pc+-file.sps], [0],
1367 [warning: `pc+-file.sav': Invalid weight index 10.
1371 AT_SETUP([string weight])
1372 AT_KEYWORDS([sack synthetic PC+ file negative])
1373 AT_DATA([pc+-file.sack], [dnl
1376 @MAIN; @MAIN_END - @MAIN;
1377 @VARS; @VARS_END - @VARS;
1379 @DATA; @DATA_END - @DATA;
1385 s62 "PCSPSS PSPP synthetic test product";
1387 0; 0; i16 1; dnl Fixed.
1395 s64 "PSPP synthetic test file";
1399 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1400 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1401 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1404 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1405 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1406 0; 0; 0; 0x010800; s8 "STR1"; PCSYSMIS;
1407 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1411 0.0; "11/28/14"; 1.0; s8 "acbdefgh"; 3.0; 4.0; 5.0;
1414 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1415 AT_DATA([pc+-file.sps], [dnl
1416 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1418 AT_CHECK([pspp -O format=csv pc+-file.sps], [0],
1419 [warning: `pc+-file.sav' near offset 0x250: Cannot weight by string variable `STR1'.