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/>.
16 dnl AT_BANNER([SPSS/PC+ file reader - positive])
18 AT_SETUP([variable labels and missing values])
19 AT_KEYWORDS([sack synthetic PC+ file positive])
20 AT_DATA([pc+-file.sack], [dnl
23 @MAIN; @MAIN_END - @MAIN;
24 @VARS; @VARS_END - @VARS;
25 @LABELS; @LABELS_END - @LABELS;
26 @DATA; @DATA_END - @DATA;
32 s62 "PCSPSS PSPP synthetic test product";
34 0; 0; i16 1; dnl Fixed.
42 s64 "PSPP synthetic test file";
46 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
47 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
48 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
50 dnl Numeric variable, no label or missing values.
51 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
53 dnl Numeric variable, variable label.
54 0; 0; @NUM2_LABEL - @LABELS_OFS; 0x050800; s8 "NUM2"; PCSYSMIS;
56 dnl Numeric variable with missing value.
57 0; 0; 0; 0x050800; s8 "NUM3"; 1.0;
59 dnl Numeric variable, variable label and missing value.
60 0; 0; @NUM4_LABEL - @LABELS_OFS; 0x050800; s8 "NUM4"; 2.0;
62 dnl String variable, no label or missing values.
63 0; 0; 0; 0x010800; s8 "STR1"; PCSYSMIS;
65 dnl String variable, variable label.
66 0; 0; @STR2_LABEL - @LABELS_OFS; 0x010400; s8 "STR2"; PCSYSMIS;
68 dnl String variable with missing value.
69 0; 0; 0; 0x010500; s8 "STR3"; s8 "MISS";
71 dnl String variable, variable label and missing value.
72 0; 0; @STR4_LABEL - @LABELS_OFS; 0x010100; s8 "STR4"; s8 "OTHR";
74 dnl Long string variable
75 0; 0; 0; 0x010b00; s8 "STR5"; PCSYSMIS;
78 dnl Long string variable with variable label
79 0; 0; @STR6_LABEL - @LABELS_OFS; 0x010b00; s8 "STR6"; PCSYSMIS;
84 3; i8 0 0 0; LABELS_OFS: i8 0;
85 NUM2_LABEL: COUNT8("Numeric variable 2's label");
86 NUM4_LABEL: COUNT8("Another numeric variable label");
87 STR2_LABEL: COUNT8("STR2's variable label");
88 STR4_LABEL: COUNT8("STR4's variable label");
89 STR6_LABEL: COUNT8("Another string variable's label");
94 0.0; 1.0; 2.0; PCSYSMIS; s8 "abcdefgh"; s8 "ijkl"; s8 "mnopq"; s8 "r";
95 s16 "stuvwxyzAB"; s16 "CDEFGHIJKLM";
98 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
99 AT_DATA([pc+-file.sps], [dnl
100 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
105 AT_CHECK([pspp -o pspp.csv pc+-file.sps])
106 AT_CHECK([cat pspp.csv], [0], [dnl
107 File label: PSPP synthetic test file
109 Variable,Description,Position
111 NUM2,"Label: Numeric variable 2's label
115 NUM4,"Label: Another numeric variable label
119 STR2,"Label: STR2's variable label
122 Missing Values: ""MISS """,7
123 STR4,"Label: STR4's variable label
125 Missing Values: ""O""",8
127 STR6,"Label: Another string variable's label
131 NUM1,NUM2,NUM3,NUM4,STR1,STR2,STR3,STR4,STR5,STR6
132 0,1,2,.,abcdefgh,ijkl,mnopq,r,stuvwxyzAB ,CDEFGHIJKLM
136 AT_SETUP([value labels])
137 AT_KEYWORDS([sack synthetic PC+ file positive])
138 AT_DATA([pc+-file.sack], [dnl
141 @MAIN; @MAIN_END - @MAIN;
142 @VARS; @VARS_END - @VARS;
143 @LABELS; @LABELS_END - @LABELS;
144 @DATA; @DATA_END - @DATA;
150 s62 "PCSPSS PSPP synthetic test product";
152 0; 0; i16 1; dnl Fixed.
160 s64 "PSPP synthetic test file";
164 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
165 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
166 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
168 dnl Numeric variables.
169 @N1 - @LOFF; @N1E - @LOFF; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
170 @N2 - @LOFF; @N2E - @LOFF; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
171 @N3 - @LOFF; @N3E - @LOFF; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
172 @N4 - @LOFF; @N4E - @LOFF; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
173 @N5 - @LOFF; @N5E - @LOFF; 0; 0x050800; s8 "NUM5"; PCSYSMIS;
175 dnl String variables.
176 @S1 - @LOFF; @S1E - @LOFF; 0; 0x010100; s8 "STR1"; PCSYSMIS;
177 @S2 - @LOFF; @S2E - @LOFF; 0; 0x010200; s8 "STR2"; PCSYSMIS;
178 @S3 - @LOFF; @S3E - @LOFF; 0; 0x010300; s8 "STR3"; PCSYSMIS;
179 @S4 - @LOFF; @S4E - @LOFF; 0; 0x010400; s8 "STR4"; PCSYSMIS;
180 @S5 - @LOFF; @S5E - @LOFF; 0; 0x010500; s8 "STR5"; PCSYSMIS;
181 @S6 - @LOFF; @S6E - @LOFF; 0; 0x010600; s8 "STR6"; PCSYSMIS;
182 @S7 - @LOFF; @S7E - @LOFF; 0; 0x010700; s8 "STR7"; PCSYSMIS;
183 @S8 - @LOFF; @S8E - @LOFF; 0; 0x010800; s8 "STR8"; PCSYSMIS;
187 3; i8 0 0 0; LOFF: i8 0;
189 N1: 1.0; COUNT8("one"); N1E:
190 N2: 2.0; COUNT8("two"); 3.0; COUNT8("three"); N2E:
192 3.0; COUNT8("three");
199 S1: s8 "a"; COUNT8("value label for `a'"); S1E:
200 S2: s8 "ab"; COUNT8("value label for `ab'"); S2E:
201 S3: s8 "abc"; COUNT8("value label for `abc'"); S3E:
203 s8 "abcdefgh"; COUNT8("value label for abcdefgh"); S4E:
205 s8 "ijklmnop"; COUNT8("value label for ijklmnop"); S5E:
206 s8 "qrstuvwx"; COUNT8("value label for qrstuvwx"); S6E:
207 s8 "yzABCDEF"; COUNT8("value label for yzABCDEF"); S7E:
208 s8 "GHIJKLMN"; COUNT8("value label for GHIJKLMN"); S8E:
212 1.0; "11/28/14"; 1.0;
213 1.0; 2.0; 3.0; 4.0; 5.0;
214 s8 "a"; s8 "bc"; s8 "cde"; s8 "fghj"; s8 "klmno"; s8 "pqrstu";
215 s8 "vwxyzAB"; s8 "CDEFGHIJ";
218 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
219 AT_DATA([pc+-file.sps], [dnl
220 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
225 AT_CHECK([pspp -o pspp.csv pc+-file.sps])
226 AT_CHECK([cat pspp.csv], [0], [dnl
227 File label: PSPP synthetic test file
229 Variable,Description,Position
256 a,value label for `a'",6
260 ab,value label for `ab'",7
264 abc,value label for `abc'",8
268 abcd,value label for abcdefgh",9
272 abcde,value label for abcdefgh
273 ijklm,value label for ijklmnop",10
277 abcdef,value label for abcdefgh
278 ijklmn,value label for ijklmnop
279 qrstuv,value label for qrstuvwx",11
283 abcdefg,value label for abcdefgh
284 ijklmno,value label for ijklmnop
285 qrstuvw,value label for qrstuvwx
286 yzABCDE,value label for yzABCDEF",12
290 GHIJKLMN,value label for GHIJKLMN
291 ijklmnop,value label for ijklmnop
292 qrstuvwx,value label for qrstuvwx
293 yzABCDEF,value label for yzABCDEF",13
296 NUM1,NUM2,NUM3,NUM4,NUM5,STR1,STR2,STR3,STR4,STR5,STR6,STR7,STR8
297 1,2,3,4,5,a,bc,cde,fghj,klmno,pqrstu,vwxyzAB,CDEFGHIJ
301 AT_SETUP([compressed data])
302 AT_KEYWORDS([sack synthetic PC+ file positive])
303 AT_DATA([pc+-file.sack], [dnl
306 @MAIN; @MAIN_END - @MAIN;
307 @VARS; @VARS_END - @VARS;
309 @DATA; @DATA_END - @DATA;
315 s62 "PCSPSS PSPP synthetic test product";
317 0; 0; i16 1; dnl Fixed.
325 s64 "PSPP synthetic test file";
329 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
330 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
331 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
333 dnl Numeric variables.
334 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
335 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
337 dnl String variables.
338 0; 0; 0; 0x010400; s8 "STR4"; PCSYSMIS;
339 0; 0; 0; 0x010800; s8 "STR8"; PCSYSMIS;
340 0; 0; 0; 0x010f00; s8 "STR15"; PCSYSMIS;
345 i8 101 1 101 100 255 1 1 1;
346 s8 "11/28/14"; s8 "abcd"; s8 "efghj"; s8 "efghijkl";
347 i8 1; i8 102 1 101 1 0 1 1;
348 s8 "ABCDEFG"; s8 "11/28/14"; 1000.0; s8 "PQRS"; s8 "TUVWXYZa";
350 s16 "bcdefghijklmnop";
353 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
354 AT_DATA([pc+-file.sps], [dnl
355 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
360 AT_CHECK([pspp -o pspp.csv pc+-file.sps])
361 AT_CHECK([cat pspp.csv], [0], [dnl
362 File label: PSPP synthetic test file
364 Variable,Description,Position
372 NUM1,NUM2,STR4,STR8,STR15
373 -5,150,abcd,efghj ,efghijklABCDEFG
374 1000,.,PQRS,TUVWXYZa,bcdefghijklmnop
379 AT_KEYWORDS([sack synthetic PC+ file negative])
380 AT_DATA([pc+-file.sack], [dnl
383 @MAIN; @MAIN_END - @MAIN;
384 @VARS; @VARS_END - @VARS;
386 @DATA; @DATA_END - @DATA;
392 s62 "PCSPSS PSPP synthetic test product";
394 0; 0; i16 1; dnl Fixed.
402 s64 "PSPP synthetic test file";
406 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
407 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
408 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
410 dnl Numeric variables.
411 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
412 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
413 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
414 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
418 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
421 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
422 AT_DATA([pc+-file.sps], [dnl
423 SYSFILE INFO FILE='pc+-file.sav' ENCODING='us-ascii'.
425 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
427 Label:,PSPP synthetic test file
428 Created:,11/28/14 15:11:00 by PCSPSS PSPP synthetic test product
429 Integer Format:,Little Endian
430 Real Format:,IEEE 754 LE.
433 Type:,SPSS/PC+ System File
438 Variable,Description,Position
442 Display Alignment: Right
447 Display Alignment: Right
452 Display Alignment: Right
457 Display Alignment: Right
462 AT_BANNER([SPSS/PC+ file reader - negative])
464 AT_SETUP([unspecified character encoding])
465 AT_KEYWORDS([sack synthetic PC+ file negative])
466 AT_DATA([pc+-file.sack], [dnl
469 @MAIN; @MAIN_END - @MAIN;
470 @VARS; @VARS_END - @VARS;
472 @DATA; @DATA_END - @DATA;
478 s62 "PCSPSS PSPP synthetic test product";
480 0; 0; i16 1; dnl Fixed.
488 s64 "PSPP synthetic test file";
492 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
493 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
494 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
496 dnl Numeric variables.
497 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
498 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
499 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
500 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
504 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
507 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
508 AT_DATA([pc+-file.sps], [dnl
509 GET FILE='pc+-file.sav'.
514 SYSFILE INFO FILE='pc+-file.sav' ENCODING='us-ascii'.
516 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [stdout], [])
517 AT_CHECK([sed 's/default encoding.*For/default encoding. For/' stdout], [0], [dnl
518 "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."
520 File label: PSPP synthetic test file
522 Variable,Description,Position
533 Label:,PSPP synthetic test file
534 Created:,11/28/14 15:11:00 by PCSPSS PSPP synthetic test product
535 Integer Format:,Little Endian
536 Real Format:,IEEE 754 LE.
539 Type:,SPSS/PC+ System File
540 Weight:,Not weighted.
544 Variable,Description,Position
548 Display Alignment: Right
553 Display Alignment: Right
558 Display Alignment: Right
563 Display Alignment: Right
568 AT_SETUP([unexpected fixed values])
569 AT_KEYWORDS([sack synthetic PC+ file negative])
570 AT_DATA([pc+-file.sack], [dnl
573 @MAIN; @MAIN_END - @MAIN;
574 @VARS; @VARS_END - @VARS;
576 @DATA; @DATA_END - @DATA;
582 s62 "PCSPSS PSPP synthetic test product";
584 0; >>2<<; i16 1; dnl Fixed.
592 s64 "PSPP synthetic test file";
596 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
597 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
598 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
600 dnl Numeric variables.
601 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
602 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
603 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
604 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
608 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
611 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
612 AT_DATA([pc+-file.sps], [dnl
613 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
615 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
616 "warning: `pc+-file.sav' near offset 0x0: Directory fields have unexpected values (1,2)."
618 warning: `pc+-file.sav' near offset 0x100: Record 0 specifies unexpected system missing value 1 (0x1p+0).
620 "warning: `pc+-file.sav' near offset 0x100: Record 0 reserved fields have unexpected values (1,1,0,2,0,0)."
622 warning: `pc+-file.sav' near offset 0x100: Record 0 case counts differ (1 versus 3).
626 AT_SETUP([short main header])
627 AT_KEYWORDS([sack synthetic PC+ file negative])
628 AT_DATA([pc+-file.sack], [dnl
631 @MAIN; @MAIN_END - @MAIN;
632 @VARS; @VARS_END - @VARS;
634 @DATA; @DATA_END - @DATA;
640 s62 "PCSPSS PSPP synthetic test product";
642 0; 0; i16 1; dnl Fixed.
653 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
654 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
655 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
657 dnl Numeric variables.
658 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
659 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
660 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
661 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
665 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
668 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
669 AT_DATA([pc+-file.sps], [dnl
670 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
672 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
673 error: `pc+-file.sav' near offset 0x100: This is not an SPSS/PC+ system file.
677 AT_SETUP([long main header])
678 AT_KEYWORDS([sack synthetic PC+ file negative])
679 AT_DATA([pc+-file.sack], [dnl
682 @MAIN; @MAIN_END - @MAIN;
683 @VARS; @VARS_END - @VARS;
685 @DATA; @DATA_END - @DATA;
691 s62 "PCSPSS PSPP synthetic test product";
693 0; 0; i16 1; dnl Fixed.
701 >>s80 "PSPP synthetic test file"<<;
705 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
706 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
707 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
709 dnl Numeric variables.
710 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
711 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
712 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
713 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
717 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
720 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
721 AT_DATA([pc+-file.sps], [dnl
722 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
724 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
725 warning: `pc+-file.sav' near offset 0x100: Record 0 has unexpected length 192.
729 AT_SETUP([invalid compression type])
730 AT_KEYWORDS([sack synthetic PC+ file negative])
731 AT_DATA([pc+-file.sack], [dnl
734 @MAIN; @MAIN_END - @MAIN;
735 @VARS; @VARS_END - @VARS;
737 @DATA; @DATA_END - @DATA;
743 s62 "PCSPSS PSPP synthetic test product";
745 0; 0; i16 1; dnl Fixed.
753 s64 "PSPP synthetic test file";
757 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
758 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
759 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
761 dnl Numeric variables.
762 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
763 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
764 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
765 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
769 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
772 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
773 AT_DATA([pc+-file.sps], [dnl
774 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
776 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
777 error: `pc+-file.sav' near offset 0x100: Invalid compression type 2.
781 AT_SETUP([unrealistic number of cases])
782 AT_KEYWORDS([sack synthetic PC+ file negative])
783 AT_DATA([pc+-file.sack], [dnl
786 @MAIN; @MAIN_END - @MAIN;
787 @VARS; @VARS_END - @VARS;
789 @DATA; @DATA_END - @DATA;
795 s62 "PCSPSS PSPP synthetic test product";
797 0; 0; i16 1; dnl Fixed.
805 s64 "PSPP synthetic test file";
809 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
810 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
811 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
813 dnl Numeric variables.
814 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
815 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
816 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
817 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
821 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
824 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
825 AT_DATA([pc+-file.sps], [dnl
826 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
828 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
829 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.
833 AT_SETUP([labels bad offsets])
834 AT_KEYWORDS([sack synthetic PC+ file negative])
835 AT_DATA([pc+-file.sack], [dnl
838 @MAIN; @MAIN_END - @MAIN;
839 @VARS; @VARS_END - @VARS;
840 @LABELS; @LABELS_END - @LABELS;
841 @DATA; @DATA_END - @DATA;
847 s62 "PCSPSS PSPP synthetic test product";
849 0; 0; i16 1; dnl Fixed.
857 s64 "PSPP synthetic test file";
861 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
862 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
863 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
865 dnl Numeric variables.
866 @N1L - @LOFF; @N1E - @LOFF; 1000; 0x050800; s8 "NUM1"; PCSYSMIS;
867 @N1L - @LOFF - 1; @LABELS_END - @LOFF; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
868 @N1L - @LOFF + 1; @LABELS_END - @LOFF; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
869 0; 0; @LABELS_END - @LOFF - 1; 0x050800; s8 "NUM4"; PCSYSMIS;
873 3; i8 0 0 0; LOFF: i8 0;
878 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0; N1E:
881 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
882 AT_DATA([pc+-file.sps], [dnl
883 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
885 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
886 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.
888 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.
890 "warning: `pc+-file.sav' near offset 0x2a0: Value labels end with partial label (0 bytes left in record, label length 255)."
892 warning: `pc+-file.sav' near offset 0x299: 7 leftover bytes following value labels.
894 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.
898 AT_SETUP([record 1 bad length])
899 AT_KEYWORDS([sack synthetic PC+ file negative])
900 AT_DATA([pc+-file.sack], [dnl
903 @MAIN; @MAIN_END - @MAIN;
904 @VARS; @VARS_END - @VARS;
906 @DATA; @DATA_END - @DATA;
912 s62 "PCSPSS PSPP synthetic test product";
914 0; 0; i16 1; dnl Fixed.
922 s64 "PSPP synthetic test file";
926 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
927 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
928 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
930 dnl Numeric variables.
931 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
932 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
933 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
937 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
940 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
941 AT_DATA([pc+-file.sps], [dnl
942 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
944 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
945 error: `pc+-file.sav' near offset 0x1b0: Record 1 has length 192 (expected 224).
947 pc+-file.sps:1: error: GET: `pc+-file.sav': Data file dictionary has no variables.
951 AT_SETUP([bad variable format])
952 AT_KEYWORDS([sack synthetic PC+ file negative])
953 AT_DATA([pc+-file.sack], [dnl
956 @MAIN; @MAIN_END - @MAIN;
957 @VARS; @VARS_END - @VARS;
959 @DATA; @DATA_END - @DATA;
965 s62 "PCSPSS PSPP synthetic test product";
967 0; 0; i16 1; dnl Fixed.
975 s64 "PSPP synthetic test file";
979 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
980 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
981 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
983 dnl Numeric variables.
984 0; 0; 0; 0xff0000; s8 "NUM1"; PCSYSMIS;
985 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
986 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
987 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
991 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
994 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
995 AT_DATA([pc+-file.sps], [dnl
996 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
998 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
999 error: `pc+-file.sav' near offset 0x210: Variable 3 has invalid type 255.
1003 AT_SETUP([bad variable name])
1004 AT_KEYWORDS([sack synthetic PC+ file negative])
1005 AT_DATA([pc+-file.sack], [dnl
1008 @MAIN; @MAIN_END - @MAIN;
1009 @VARS; @VARS_END - @VARS;
1011 @DATA; @DATA_END - @DATA;
1017 s62 "PCSPSS PSPP synthetic test product";
1019 0; 0; i16 1; dnl Fixed.
1027 s64 "PSPP synthetic test file";
1031 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1032 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1033 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1035 dnl Numeric variables.
1036 0; 0; 0; 0x050000; s8 "#NUM"; PCSYSMIS;
1037 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1038 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1039 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1043 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1046 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1047 AT_DATA([pc+-file.sps], [dnl
1048 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1050 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
1051 error: `pc+-file.sav' near offset 0x210: Invalid variable name `#NUM'.
1055 AT_SETUP([duplicate variable name])
1056 AT_KEYWORDS([sack synthetic PC+ file negative])
1057 AT_DATA([pc+-file.sack], [dnl
1060 @MAIN; @MAIN_END - @MAIN;
1061 @VARS; @VARS_END - @VARS;
1063 @DATA; @DATA_END - @DATA;
1069 s62 "PCSPSS PSPP synthetic test product";
1071 0; 0; i16 1; dnl Fixed.
1079 s64 "PSPP synthetic test file";
1083 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1084 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1085 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1087 dnl Numeric variables.
1088 0; 0; 0; 0x050000; s8 "NUM1"; PCSYSMIS;
1089 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1090 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1091 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1095 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1098 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1099 AT_DATA([pc+-file.sps], [dnl
1100 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1102 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
1103 warning: `pc+-file.sav' near offset 0x230: Renaming variable with duplicate name `NUM1' to `VAR001'.
1105 warning: `pc+-file.sav' near offset 0x250: Renaming variable with duplicate name `NUM1' to `VAR002'.
1107 warning: `pc+-file.sav' near offset 0x270: Renaming variable with duplicate name `NUM1' to `VAR003'.
1111 AT_SETUP([partial case])
1112 AT_KEYWORDS([sack synthetic PC+ file negative])
1113 AT_DATA([pc+-file.sack], [dnl
1116 @MAIN; @MAIN_END - @MAIN;
1117 @VARS; @VARS_END - @VARS;
1119 @DATA; @DATA_END - @DATA;
1125 s62 "PCSPSS PSPP synthetic test product";
1127 0; 0; i16 1; dnl Fixed.
1135 s64 "PSPP synthetic test file";
1139 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1140 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1141 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1143 dnl Numeric variables.
1144 0; 0; 0; 0x050000; s8 "NUM1"; PCSYSMIS;
1145 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1146 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1147 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1151 1.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1152 2.0; "11/28/14"; 1.0; 6.0; 7.0; 8.0; 9.0;
1153 3.0; "11/28/14"; 1.0; 10.0;
1156 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1157 AT_DATA([pc+-file.sps], [dnl
1158 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1161 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
1162 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.
1164 error: `pc+-file.sav' near offset 0x320: File ends in partial case.
1166 error: Error reading case from file `pc+-file.sav'.
1175 AT_SETUP([case extends past end of data record])
1176 AT_KEYWORDS([sack synthetic PC+ file negative])
1177 AT_DATA([pc+-file.sack], [dnl
1180 @MAIN; @MAIN_END - @MAIN;
1181 @VARS; @VARS_END - @VARS;
1183 @DATA; @DATA_END - @DATA;
1189 s62 "PCSPSS PSPP synthetic test product";
1191 0; 0; i16 1; dnl Fixed.
1199 s64 "PSPP synthetic test file";
1203 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1204 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1205 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1207 dnl Numeric variables.
1208 0; 0; 0; 0x050000; s8 "NUM1"; PCSYSMIS;
1209 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1210 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1211 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1215 1.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1216 2.0; "11/28/14"; 1.0; 6.0; 7.0; 8.0; 9.0;
1217 3.0; "11/28/14"; 1.0; 10.0;
1221 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1222 AT_DATA([pc+-file.sps], [dnl
1223 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1226 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
1227 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.
1229 error: `pc+-file.sav' near offset 0x338: Case beginning at offset 0x00000300 extends past end of data record at offset 0x00000320.
1231 error: Error reading case from file `pc+-file.sav'.
1240 AT_SETUP([corrupt compressed data])
1241 AT_KEYWORDS([sack synthetic PC+ file positive])
1242 AT_DATA([pc+-file.sack], [dnl
1245 @MAIN; @MAIN_END - @MAIN;
1246 @VARS; @VARS_END - @VARS;
1248 @DATA; @DATA_END - @DATA;
1254 s62 "PCSPSS PSPP synthetic test product";
1256 0; 0; i16 1; dnl Fixed.
1264 s64 "PSPP synthetic test file";
1268 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1269 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1270 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1272 dnl Numeric variables.
1273 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1274 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1276 dnl String variables.
1277 0; 0; 0; 0x010400; s8 "STR4"; PCSYSMIS;
1278 0; 0; 0; 0x010800; s8 "STR8"; PCSYSMIS;
1279 0; 0; 0; 0x010f00; s8 "STR15"; PCSYSMIS;
1284 i8 101 1 101 100 255 1 1 1;
1285 s8 "11/28/14"; s8 "abcd"; s8 "efghj"; s8 "efghijkl";
1286 i8 1; i8 102 101 101 1 0 1 1;
1287 s8 "ABCDEFG"; 1000.0; s8 "PQRS"; s8 "TUVWXYZa";
1289 s16 "bcdefghijklmnop";
1292 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1293 AT_DATA([pc+-file.sps], [dnl
1294 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1299 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
1300 File label: PSPP synthetic test file
1302 Variable,Description,Position
1309 warning: `pc+-file.sav' near offset 0x308: Possible compressed data corruption: string contains compressed integer (opcode 101).
1312 NUM1,NUM2,STR4,STR8,STR15
1313 -5,150,abcd,efghj ,efghijklABCDEFG
1314 1000,.,PQRS,TUVWXYZa,bcdefghijklmnop
1318 AT_SETUP([invalid weight index])
1319 AT_KEYWORDS([sack synthetic PC+ file negative])
1320 AT_DATA([pc+-file.sack], [dnl
1323 @MAIN; @MAIN_END - @MAIN;
1324 @VARS; @VARS_END - @VARS;
1326 @DATA; @DATA_END - @DATA;
1332 s62 "PCSPSS PSPP synthetic test product";
1334 0; 0; i16 1; dnl Fixed.
1342 s64 "PSPP synthetic test file";
1346 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1347 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1348 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1350 dnl Numeric variables.
1351 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1352 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1353 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1354 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1358 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1361 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1362 AT_DATA([pc+-file.sps], [dnl
1363 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1365 AT_CHECK([pspp -O format=csv pc+-file.sps], [0],
1366 [warning: `pc+-file.sav': Invalid weight index 10.
1370 AT_SETUP([string weight])
1371 AT_KEYWORDS([sack synthetic PC+ file negative])
1372 AT_DATA([pc+-file.sack], [dnl
1375 @MAIN; @MAIN_END - @MAIN;
1376 @VARS; @VARS_END - @VARS;
1378 @DATA; @DATA_END - @DATA;
1384 s62 "PCSPSS PSPP synthetic test product";
1386 0; 0; i16 1; dnl Fixed.
1394 s64 "PSPP synthetic test file";
1398 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1399 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1400 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1403 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1404 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1405 0; 0; 0; 0x010800; s8 "STR1"; PCSYSMIS;
1406 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1410 0.0; "11/28/14"; 1.0; s8 "acbdefgh"; 3.0; 4.0; 5.0;
1413 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1414 AT_DATA([pc+-file.sps], [dnl
1415 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1417 AT_CHECK([pspp -O format=csv pc+-file.sps], [0],
1418 [warning: `pc+-file.sav' near offset 0x250: Cannot weight by string variable `STR1'.