1 AT_BANNER([SPSS/PC+ file reader - positive])
3 AT_SETUP([variable labels and missing values])
4 AT_KEYWORDS([sack synthetic PC+ file positive])
5 AT_DATA([pc+-file.sack], [dnl
8 @MAIN; @MAIN_END - @MAIN;
9 @VARS; @VARS_END - @VARS;
10 @LABELS; @LABELS_END - @LABELS;
11 @DATA; @DATA_END - @DATA;
17 s62 "PCSPSS PSPP synthetic test product";
19 0; 0; i16 1; dnl Fixed.
27 s64 "PSPP synthetic test file";
31 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
32 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
33 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
35 dnl Numeric variable, no label or missing values.
36 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
38 dnl Numeric variable, variable label.
39 0; 0; @NUM2_LABEL - @LABELS_OFS; 0x050800; s8 "NUM2"; PCSYSMIS;
41 dnl Numeric variable with missing value.
42 0; 0; 0; 0x050800; s8 "NUM3"; 1.0;
44 dnl Numeric variable, variable label and missing value.
45 0; 0; @NUM4_LABEL - @LABELS_OFS; 0x050800; s8 "NUM4"; 2.0;
47 dnl String variable, no label or missing values.
48 0; 0; 0; 0x010800; s8 "STR1"; PCSYSMIS;
50 dnl String variable, variable label.
51 0; 0; @STR2_LABEL - @LABELS_OFS; 0x010400; s8 "STR2"; PCSYSMIS;
53 dnl String variable with missing value.
54 0; 0; 0; 0x010500; s8 "STR3"; s8 "MISS";
56 dnl String variable, variable label and missing value.
57 0; 0; @STR4_LABEL - @LABELS_OFS; 0x010100; s8 "STR4"; s8 "OTHR";
59 dnl Long string variable
60 0; 0; 0; 0x010b00; s8 "STR5"; PCSYSMIS;
63 dnl Long string variable with variable label
64 0; 0; @STR6_LABEL - @LABELS_OFS; 0x010b00; s8 "STR6"; PCSYSMIS;
69 3; i8 0 0 0; LABELS_OFS: i8 0;
70 NUM2_LABEL: COUNT8("Numeric variable 2's label");
71 NUM4_LABEL: COUNT8("Another numeric variable label");
72 STR2_LABEL: COUNT8("STR2's variable label");
73 STR4_LABEL: COUNT8("STR4's variable label");
74 STR6_LABEL: COUNT8("Another string variable's label");
79 0.0; 1.0; 2.0; PCSYSMIS; s8 "abcdefgh"; s8 "ijkl"; s8 "mnopq"; s8 "r";
80 s16 "stuvwxyzAB"; s16 "CDEFGHIJKLM";
83 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
84 AT_DATA([pc+-file.sps], [dnl
85 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
90 AT_CHECK([pspp -o pspp.csv pc+-file.sps])
91 AT_CHECK([cat pspp.csv], [0], [dnl
92 File label: PSPP synthetic test file
94 Variable,Description,Position
96 NUM2,"Label: Numeric variable 2's label
100 NUM4,"Label: Another numeric variable label
104 STR2,"Label: STR2's variable label
107 Missing Values: ""MISS """,7
108 STR4,"Label: STR4's variable label
110 Missing Values: ""O""",8
112 STR6,"Label: Another string variable's label
116 NUM1,NUM2,NUM3,NUM4,STR1,STR2,STR3,STR4,STR5,STR6
117 0,1,2,.,abcdefgh,ijkl,mnopq,r,stuvwxyzAB ,CDEFGHIJKLM
121 AT_SETUP([value labels])
122 AT_KEYWORDS([sack synthetic PC+ file positive])
123 AT_DATA([pc+-file.sack], [dnl
126 @MAIN; @MAIN_END - @MAIN;
127 @VARS; @VARS_END - @VARS;
128 @LABELS; @LABELS_END - @LABELS;
129 @DATA; @DATA_END - @DATA;
135 s62 "PCSPSS PSPP synthetic test product";
137 0; 0; i16 1; dnl Fixed.
145 s64 "PSPP synthetic test file";
149 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
150 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
151 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
153 dnl Numeric variables.
154 @N1 - @LOFF; @N1E - @LOFF; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
155 @N2 - @LOFF; @N2E - @LOFF; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
156 @N3 - @LOFF; @N3E - @LOFF; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
157 @N4 - @LOFF; @N4E - @LOFF; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
158 @N5 - @LOFF; @N5E - @LOFF; 0; 0x050800; s8 "NUM5"; PCSYSMIS;
160 dnl String variables.
161 @S1 - @LOFF; @S1E - @LOFF; 0; 0x010100; s8 "STR1"; PCSYSMIS;
162 @S2 - @LOFF; @S2E - @LOFF; 0; 0x010200; s8 "STR2"; PCSYSMIS;
163 @S3 - @LOFF; @S3E - @LOFF; 0; 0x010300; s8 "STR3"; PCSYSMIS;
164 @S4 - @LOFF; @S4E - @LOFF; 0; 0x010400; s8 "STR4"; PCSYSMIS;
165 @S5 - @LOFF; @S5E - @LOFF; 0; 0x010500; s8 "STR5"; PCSYSMIS;
166 @S6 - @LOFF; @S6E - @LOFF; 0; 0x010600; s8 "STR6"; PCSYSMIS;
167 @S7 - @LOFF; @S7E - @LOFF; 0; 0x010700; s8 "STR7"; PCSYSMIS;
168 @S8 - @LOFF; @S8E - @LOFF; 0; 0x010800; s8 "STR8"; PCSYSMIS;
172 3; i8 0 0 0; LOFF: i8 0;
174 N1: 1.0; COUNT8("one"); N1E:
175 N2: 2.0; COUNT8("two"); 3.0; COUNT8("three"); N2E:
177 3.0; COUNT8("three");
184 S1: s8 "a"; COUNT8("value label for `a'"); S1E:
185 S2: s8 "ab"; COUNT8("value label for `ab'"); S2E:
186 S3: s8 "abc"; COUNT8("value label for `abc'"); S3E:
188 s8 "abcdefgh"; COUNT8("value label for abcdefgh"); S4E:
190 s8 "ijklmnop"; COUNT8("value label for ijklmnop"); S5E:
191 s8 "qrstuvwx"; COUNT8("value label for qrstuvwx"); S6E:
192 s8 "yzABCDEF"; COUNT8("value label for yzABCDEF"); S7E:
193 s8 "GHIJKLMN"; COUNT8("value label for GHIJKLMN"); S8E:
197 1.0; "11/28/14"; 1.0;
198 1.0; 2.0; 3.0; 4.0; 5.0;
199 s8 "a"; s8 "bc"; s8 "cde"; s8 "fghj"; s8 "klmno"; s8 "pqrstu";
200 s8 "vwxyzAB"; s8 "CDEFGHIJ";
203 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
204 AT_DATA([pc+-file.sps], [dnl
205 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
210 AT_CHECK([pspp -o pspp.csv pc+-file.sps])
211 AT_CHECK([cat pspp.csv], [0], [dnl
212 File label: PSPP synthetic test file
214 Variable,Description,Position
241 a,value label for `a'",6
245 ab,value label for `ab'",7
249 abc,value label for `abc'",8
253 abcd,value label for abcdefgh",9
257 abcde,value label for abcdefgh
258 ijklm,value label for ijklmnop",10
262 abcdef,value label for abcdefgh
263 ijklmn,value label for ijklmnop
264 qrstuv,value label for qrstuvwx",11
268 abcdefg,value label for abcdefgh
269 ijklmno,value label for ijklmnop
270 qrstuvw,value label for qrstuvwx
271 yzABCDE,value label for yzABCDEF",12
275 GHIJKLMN,value label for GHIJKLMN
276 ijklmnop,value label for ijklmnop
277 qrstuvwx,value label for qrstuvwx
278 yzABCDEF,value label for yzABCDEF",13
281 NUM1,NUM2,NUM3,NUM4,NUM5,STR1,STR2,STR3,STR4,STR5,STR6,STR7,STR8
282 1,2,3,4,5,a,bc,cde,fghj,klmno,pqrstu,vwxyzAB,CDEFGHIJ
286 AT_SETUP([compressed data])
287 AT_KEYWORDS([sack synthetic PC+ file positive])
288 AT_DATA([pc+-file.sack], [dnl
291 @MAIN; @MAIN_END - @MAIN;
292 @VARS; @VARS_END - @VARS;
294 @DATA; @DATA_END - @DATA;
300 s62 "PCSPSS PSPP synthetic test product";
302 0; 0; i16 1; dnl Fixed.
310 s64 "PSPP synthetic test file";
314 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
315 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
316 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
318 dnl Numeric variables.
319 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
320 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
322 dnl String variables.
323 0; 0; 0; 0x010400; s8 "STR4"; PCSYSMIS;
324 0; 0; 0; 0x010800; s8 "STR8"; PCSYSMIS;
325 0; 0; 0; 0x010f00; s8 "STR15"; PCSYSMIS;
330 i8 101 1 101 100 255 1 1 1;
331 s8 "11/28/14"; s8 "abcd"; s8 "efghj"; s8 "efghijkl";
332 i8 1; i8 102 1 101 1 0 1 1;
333 s8 "ABCDEFG"; s8 "11/28/14"; 1000.0; s8 "PQRS"; s8 "TUVWXYZa";
335 s16 "bcdefghijklmnop";
338 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
339 AT_DATA([pc+-file.sps], [dnl
340 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
345 AT_CHECK([pspp -o pspp.csv pc+-file.sps])
346 AT_CHECK([cat pspp.csv], [0], [dnl
347 File label: PSPP synthetic test file
349 Variable,Description,Position
357 NUM1,NUM2,STR4,STR8,STR15
358 -5,150,abcd,efghj ,efghijklABCDEFG
359 1000,.,PQRS,TUVWXYZa,bcdefghijklmnop
364 AT_KEYWORDS([sack synthetic PC+ file negative])
365 AT_DATA([pc+-file.sack], [dnl
368 @MAIN; @MAIN_END - @MAIN;
369 @VARS; @VARS_END - @VARS;
371 @DATA; @DATA_END - @DATA;
377 s62 "PCSPSS PSPP synthetic test product";
379 0; 0; i16 1; dnl Fixed.
387 s64 "PSPP synthetic test file";
391 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
392 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
393 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
395 dnl Numeric variables.
396 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
397 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
398 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
399 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
403 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
406 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
407 AT_DATA([pc+-file.sps], [dnl
408 SYSFILE INFO FILE='pc+-file.sav' ENCODING='us-ascii'.
410 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
412 Label:,PSPP synthetic test file
413 Created:,11/28/14 15:11:00 by PCSPSS PSPP synthetic test product
414 Integer Format:,Little Endian
415 Real Format:,IEEE 754 LE.
418 Type:,SPSS/PC+ System File
423 Variable,Description,Position
427 Display Alignment: Right
432 Display Alignment: Right
437 Display Alignment: Right
442 Display Alignment: Right
447 AT_BANNER([SPSS/PC+ file reader - negative])
449 AT_SETUP([unspecified character encoding])
450 AT_KEYWORDS([sack synthetic PC+ file negative])
451 AT_DATA([pc+-file.sack], [dnl
454 @MAIN; @MAIN_END - @MAIN;
455 @VARS; @VARS_END - @VARS;
457 @DATA; @DATA_END - @DATA;
463 s62 "PCSPSS PSPP synthetic test product";
465 0; 0; i16 1; dnl Fixed.
473 s64 "PSPP synthetic test file";
477 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
478 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
479 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
481 dnl Numeric variables.
482 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
483 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
484 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
485 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
489 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
492 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
493 AT_DATA([pc+-file.sps], [dnl
494 GET FILE='pc+-file.sav'.
499 SYSFILE INFO FILE='pc+-file.sav' ENCODING='us-ascii'.
501 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [stdout], [])
502 AT_CHECK([sed 's/default encoding.*For/default encoding. For/' stdout], [0], [dnl
503 "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."
505 File label: PSPP synthetic test file
507 Variable,Description,Position
518 Label:,PSPP synthetic test file
519 Created:,11/28/14 15:11:00 by PCSPSS PSPP synthetic test product
520 Integer Format:,Little Endian
521 Real Format:,IEEE 754 LE.
524 Type:,SPSS/PC+ System File
525 Weight:,Not weighted.
529 Variable,Description,Position
533 Display Alignment: Right
538 Display Alignment: Right
543 Display Alignment: Right
548 Display Alignment: Right
553 AT_SETUP([unexpected fixed values])
554 AT_KEYWORDS([sack synthetic PC+ file negative])
555 AT_DATA([pc+-file.sack], [dnl
558 @MAIN; @MAIN_END - @MAIN;
559 @VARS; @VARS_END - @VARS;
561 @DATA; @DATA_END - @DATA;
567 s62 "PCSPSS PSPP synthetic test product";
569 0; >>2<<; i16 1; dnl Fixed.
577 s64 "PSPP synthetic test file";
581 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
582 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
583 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
585 dnl Numeric variables.
586 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
587 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
588 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
589 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
593 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
596 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
597 AT_DATA([pc+-file.sps], [dnl
598 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
600 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
601 "warning: `pc+-file.sav' near offset 0x0: Directory fields have unexpected values (1,2)."
603 warning: `pc+-file.sav' near offset 0x100: Record 0 specifies unexpected system missing value 1 (0x1p+0).
605 "warning: `pc+-file.sav' near offset 0x100: Record 0 reserved fields have unexpected values (1,1,0,2,0,0)."
607 warning: `pc+-file.sav' near offset 0x100: Record 0 case counts differ (1 versus 3).
611 AT_SETUP([short main header])
612 AT_KEYWORDS([sack synthetic PC+ file negative])
613 AT_DATA([pc+-file.sack], [dnl
616 @MAIN; @MAIN_END - @MAIN;
617 @VARS; @VARS_END - @VARS;
619 @DATA; @DATA_END - @DATA;
625 s62 "PCSPSS PSPP synthetic test product";
627 0; 0; i16 1; dnl Fixed.
638 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
639 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
640 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
642 dnl Numeric variables.
643 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
644 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
645 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
646 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
650 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
653 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
654 AT_DATA([pc+-file.sps], [dnl
655 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
657 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
658 error: `pc+-file.sav' near offset 0x100: This is not an SPSS/PC+ system file.
662 AT_SETUP([long main header])
663 AT_KEYWORDS([sack synthetic PC+ file negative])
664 AT_DATA([pc+-file.sack], [dnl
667 @MAIN; @MAIN_END - @MAIN;
668 @VARS; @VARS_END - @VARS;
670 @DATA; @DATA_END - @DATA;
676 s62 "PCSPSS PSPP synthetic test product";
678 0; 0; i16 1; dnl Fixed.
686 >>s80 "PSPP synthetic test file"<<;
690 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
691 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
692 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
694 dnl Numeric variables.
695 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
696 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
697 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
698 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
702 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
705 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
706 AT_DATA([pc+-file.sps], [dnl
707 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
709 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
710 warning: `pc+-file.sav' near offset 0x100: Record 0 has unexpected length 192.
714 AT_SETUP([invalid compression type])
715 AT_KEYWORDS([sack synthetic PC+ file negative])
716 AT_DATA([pc+-file.sack], [dnl
719 @MAIN; @MAIN_END - @MAIN;
720 @VARS; @VARS_END - @VARS;
722 @DATA; @DATA_END - @DATA;
728 s62 "PCSPSS PSPP synthetic test product";
730 0; 0; i16 1; dnl Fixed.
738 s64 "PSPP synthetic test file";
742 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
743 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
744 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
746 dnl Numeric variables.
747 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
748 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
749 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
750 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
754 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
757 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
758 AT_DATA([pc+-file.sps], [dnl
759 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
761 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
762 error: `pc+-file.sav' near offset 0x100: Invalid compression type 2.
766 AT_SETUP([unrealistic number of cases])
767 AT_KEYWORDS([sack synthetic PC+ file negative])
768 AT_DATA([pc+-file.sack], [dnl
771 @MAIN; @MAIN_END - @MAIN;
772 @VARS; @VARS_END - @VARS;
774 @DATA; @DATA_END - @DATA;
780 s62 "PCSPSS PSPP synthetic test product";
782 0; 0; i16 1; dnl Fixed.
790 s64 "PSPP synthetic test file";
794 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
795 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
796 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
798 dnl Numeric variables.
799 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
800 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
801 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
802 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
806 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
809 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
810 AT_DATA([pc+-file.sps], [dnl
811 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
813 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
814 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.
818 AT_SETUP([labels bad offsets])
819 AT_KEYWORDS([sack synthetic PC+ file negative])
820 AT_DATA([pc+-file.sack], [dnl
823 @MAIN; @MAIN_END - @MAIN;
824 @VARS; @VARS_END - @VARS;
825 @LABELS; @LABELS_END - @LABELS;
826 @DATA; @DATA_END - @DATA;
832 s62 "PCSPSS PSPP synthetic test product";
834 0; 0; i16 1; dnl Fixed.
842 s64 "PSPP synthetic test file";
846 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
847 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
848 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
850 dnl Numeric variables.
851 @N1L - @LOFF; @N1E - @LOFF; 1000; 0x050800; s8 "NUM1"; PCSYSMIS;
852 @N1L - @LOFF - 1; @LABELS_END - @LOFF; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
853 @N1L - @LOFF + 1; @LABELS_END - @LOFF; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
854 0; 0; @LABELS_END - @LOFF - 1; 0x050800; s8 "NUM4"; PCSYSMIS;
858 3; i8 0 0 0; LOFF: i8 0;
863 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0; N1E:
866 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
867 AT_DATA([pc+-file.sps], [dnl
868 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
870 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
871 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.
873 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.
875 "warning: `pc+-file.sav' near offset 0x2a0: Value labels end with partial label (0 bytes left in record, label length 255)."
877 warning: `pc+-file.sav' near offset 0x299: 7 leftover bytes following value labels.
879 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.
883 AT_SETUP([record 1 bad length])
884 AT_KEYWORDS([sack synthetic PC+ file negative])
885 AT_DATA([pc+-file.sack], [dnl
888 @MAIN; @MAIN_END - @MAIN;
889 @VARS; @VARS_END - @VARS;
891 @DATA; @DATA_END - @DATA;
897 s62 "PCSPSS PSPP synthetic test product";
899 0; 0; i16 1; dnl Fixed.
907 s64 "PSPP synthetic test file";
911 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
912 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
913 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
915 dnl Numeric variables.
916 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
917 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
918 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
922 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
925 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
926 AT_DATA([pc+-file.sps], [dnl
927 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
929 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
930 error: `pc+-file.sav' near offset 0x1b0: Record 1 has length 192 (expected 224).
932 pc+-file.sps:1: error: GET: `pc+-file.sav': Data file dictionary has no variables.
936 AT_SETUP([bad variable format])
937 AT_KEYWORDS([sack synthetic PC+ file negative])
938 AT_DATA([pc+-file.sack], [dnl
941 @MAIN; @MAIN_END - @MAIN;
942 @VARS; @VARS_END - @VARS;
944 @DATA; @DATA_END - @DATA;
950 s62 "PCSPSS PSPP synthetic test product";
952 0; 0; i16 1; dnl Fixed.
960 s64 "PSPP synthetic test file";
964 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
965 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
966 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
968 dnl Numeric variables.
969 0; 0; 0; 0xff0000; s8 "NUM1"; PCSYSMIS;
970 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
971 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
972 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
976 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
979 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
980 AT_DATA([pc+-file.sps], [dnl
981 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
983 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
984 error: `pc+-file.sav' near offset 0x210: Variable 3 has invalid type 255.
988 AT_SETUP([bad variable name])
989 AT_KEYWORDS([sack synthetic PC+ file negative])
990 AT_DATA([pc+-file.sack], [dnl
993 @MAIN; @MAIN_END - @MAIN;
994 @VARS; @VARS_END - @VARS;
996 @DATA; @DATA_END - @DATA;
1002 s62 "PCSPSS PSPP synthetic test product";
1004 0; 0; i16 1; dnl Fixed.
1012 s64 "PSPP synthetic test file";
1016 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1017 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1018 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1020 dnl Numeric variables.
1021 0; 0; 0; 0x050000; s8 "#NUM"; PCSYSMIS;
1022 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1023 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1024 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1028 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1031 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1032 AT_DATA([pc+-file.sps], [dnl
1033 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1035 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
1036 error: `pc+-file.sav' near offset 0x210: Invalid variable name `#NUM'.
1040 AT_SETUP([duplicate variable name])
1041 AT_KEYWORDS([sack synthetic PC+ file negative])
1042 AT_DATA([pc+-file.sack], [dnl
1045 @MAIN; @MAIN_END - @MAIN;
1046 @VARS; @VARS_END - @VARS;
1048 @DATA; @DATA_END - @DATA;
1054 s62 "PCSPSS PSPP synthetic test product";
1056 0; 0; i16 1; dnl Fixed.
1064 s64 "PSPP synthetic test file";
1068 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1069 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1070 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1072 dnl Numeric variables.
1073 0; 0; 0; 0x050000; s8 "NUM1"; PCSYSMIS;
1074 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1075 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1076 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1080 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1083 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1084 AT_DATA([pc+-file.sps], [dnl
1085 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1087 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
1088 warning: `pc+-file.sav' near offset 0x230: Renaming variable with duplicate name `NUM1' to `VAR001'.
1090 warning: `pc+-file.sav' near offset 0x250: Renaming variable with duplicate name `NUM1' to `VAR002'.
1092 warning: `pc+-file.sav' near offset 0x270: Renaming variable with duplicate name `NUM1' to `VAR003'.
1096 AT_SETUP([partial case])
1097 AT_KEYWORDS([sack synthetic PC+ file negative])
1098 AT_DATA([pc+-file.sack], [dnl
1101 @MAIN; @MAIN_END - @MAIN;
1102 @VARS; @VARS_END - @VARS;
1104 @DATA; @DATA_END - @DATA;
1110 s62 "PCSPSS PSPP synthetic test product";
1112 0; 0; i16 1; dnl Fixed.
1120 s64 "PSPP synthetic test file";
1124 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1125 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1126 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1128 dnl Numeric variables.
1129 0; 0; 0; 0x050000; s8 "NUM1"; PCSYSMIS;
1130 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1131 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1132 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1136 1.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1137 2.0; "11/28/14"; 1.0; 6.0; 7.0; 8.0; 9.0;
1138 3.0; "11/28/14"; 1.0; 10.0;
1141 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1142 AT_DATA([pc+-file.sps], [dnl
1143 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1146 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
1147 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.
1149 error: `pc+-file.sav' near offset 0x320: File ends in partial case.
1151 error: Error reading case from file `pc+-file.sav'.
1160 AT_SETUP([case extends past end of data record])
1161 AT_KEYWORDS([sack synthetic PC+ file negative])
1162 AT_DATA([pc+-file.sack], [dnl
1165 @MAIN; @MAIN_END - @MAIN;
1166 @VARS; @VARS_END - @VARS;
1168 @DATA; @DATA_END - @DATA;
1174 s62 "PCSPSS PSPP synthetic test product";
1176 0; 0; i16 1; dnl Fixed.
1184 s64 "PSPP synthetic test file";
1188 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1189 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1190 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1192 dnl Numeric variables.
1193 0; 0; 0; 0x050000; s8 "NUM1"; PCSYSMIS;
1194 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1195 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1196 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1200 1.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1201 2.0; "11/28/14"; 1.0; 6.0; 7.0; 8.0; 9.0;
1202 3.0; "11/28/14"; 1.0; 10.0;
1206 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1207 AT_DATA([pc+-file.sps], [dnl
1208 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1211 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
1212 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.
1214 error: `pc+-file.sav' near offset 0x338: Case beginning at offset 0x00000300 extends past end of data record at offset 0x00000320.
1216 error: Error reading case from file `pc+-file.sav'.
1225 AT_SETUP([corrupt compressed data])
1226 AT_KEYWORDS([sack synthetic PC+ file positive])
1227 AT_DATA([pc+-file.sack], [dnl
1230 @MAIN; @MAIN_END - @MAIN;
1231 @VARS; @VARS_END - @VARS;
1233 @DATA; @DATA_END - @DATA;
1239 s62 "PCSPSS PSPP synthetic test product";
1241 0; 0; i16 1; dnl Fixed.
1249 s64 "PSPP synthetic test file";
1253 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1254 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1255 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1257 dnl Numeric variables.
1258 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1259 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1261 dnl String variables.
1262 0; 0; 0; 0x010400; s8 "STR4"; PCSYSMIS;
1263 0; 0; 0; 0x010800; s8 "STR8"; PCSYSMIS;
1264 0; 0; 0; 0x010f00; s8 "STR15"; PCSYSMIS;
1269 i8 101 1 101 100 255 1 1 1;
1270 s8 "11/28/14"; s8 "abcd"; s8 "efghj"; s8 "efghijkl";
1271 i8 1; i8 102 101 101 1 0 1 1;
1272 s8 "ABCDEFG"; 1000.0; s8 "PQRS"; s8 "TUVWXYZa";
1274 s16 "bcdefghijklmnop";
1277 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1278 AT_DATA([pc+-file.sps], [dnl
1279 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1284 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
1285 File label: PSPP synthetic test file
1287 Variable,Description,Position
1294 warning: `pc+-file.sav' near offset 0x308: Possible compressed data corruption: string contains compressed integer (opcode 101).
1297 NUM1,NUM2,STR4,STR8,STR15
1298 -5,150,abcd,efghj ,efghijklABCDEFG
1299 1000,.,PQRS,TUVWXYZa,bcdefghijklmnop
1303 AT_SETUP([invalid weight index])
1304 AT_KEYWORDS([sack synthetic PC+ file negative])
1305 AT_DATA([pc+-file.sack], [dnl
1308 @MAIN; @MAIN_END - @MAIN;
1309 @VARS; @VARS_END - @VARS;
1311 @DATA; @DATA_END - @DATA;
1317 s62 "PCSPSS PSPP synthetic test product";
1319 0; 0; i16 1; dnl Fixed.
1327 s64 "PSPP synthetic test file";
1331 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1332 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1333 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1335 dnl Numeric variables.
1336 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1337 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1338 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1339 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1343 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1346 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1347 AT_DATA([pc+-file.sps], [dnl
1348 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1350 AT_CHECK([pspp -O format=csv pc+-file.sps], [0],
1351 [warning: `pc+-file.sav': Invalid weight index 10.
1355 AT_SETUP([string weight])
1356 AT_KEYWORDS([sack synthetic PC+ file negative])
1357 AT_DATA([pc+-file.sack], [dnl
1360 @MAIN; @MAIN_END - @MAIN;
1361 @VARS; @VARS_END - @VARS;
1363 @DATA; @DATA_END - @DATA;
1369 s62 "PCSPSS PSPP synthetic test product";
1371 0; 0; i16 1; dnl Fixed.
1379 s64 "PSPP synthetic test file";
1383 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1384 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1385 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1388 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1389 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1390 0; 0; 0; 0x010800; s8 "STR1"; PCSYSMIS;
1391 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1395 0.0; "11/28/14"; 1.0; s8 "acbdefgh"; 3.0; 4.0; 5.0;
1398 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1399 AT_DATA([pc+-file.sps], [dnl
1400 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1402 AT_CHECK([pspp -O format=csv pc+-file.sps], [0],
1403 [warning: `pc+-file.sav' near offset 0x250: Cannot weight by string variable `STR1'.