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
363 AT_BANNER([SPSS/PC+ file reader - negative])
365 AT_SETUP([unspecified character encoding])
366 AT_KEYWORDS([sack synthetic PC+ file negative])
367 AT_DATA([pc+-file.sack], [dnl
370 @MAIN; @MAIN_END - @MAIN;
371 @VARS; @VARS_END - @VARS;
373 @DATA; @DATA_END - @DATA;
379 s62 "PCSPSS PSPP synthetic test product";
381 0; 0; i16 1; dnl Fixed.
389 s64 "PSPP synthetic test file";
393 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
394 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
395 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
397 dnl Numeric variables.
398 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
399 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
400 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
401 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
405 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
408 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
409 AT_DATA([pc+-file.sps], [dnl
410 GET FILE='pc+-file.sav'.
415 SYSFILE INFO FILE='pc+-file.sav' ENCODING='us-ascii'.
417 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [stdout], [])
418 AT_CHECK([sed 's/default encoding.*For/default encoding. For/' stdout], [0], [dnl
419 "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."
421 File label: PSPP synthetic test file
423 Variable,Description,Position
434 Label:,PSPP synthetic test file
435 Created:,11/28/14 15:11:00 by PCSPSS PSPP synthetic test product
436 Integer Format:,Little Endian
437 Real Format:,IEEE 754 LE.
440 Type:,SPSS/PC+ System File
441 Weight:,Not weighted.
445 Variable,Description,Position
449 Display Alignment: Right
454 Display Alignment: Right
459 Display Alignment: Right
464 Display Alignment: Right
469 AT_SETUP([unexpected fixed values])
470 AT_KEYWORDS([sack synthetic PC+ file negative])
471 AT_DATA([pc+-file.sack], [dnl
474 @MAIN; @MAIN_END - @MAIN;
475 @VARS; @VARS_END - @VARS;
477 @DATA; @DATA_END - @DATA;
483 s62 "PCSPSS PSPP synthetic test product";
485 0; >>2<<; i16 1; dnl Fixed.
493 s64 "PSPP synthetic test file";
497 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
498 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
499 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
501 dnl Numeric variables.
502 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
503 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
504 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
505 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
509 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
512 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
513 AT_DATA([pc+-file.sps], [dnl
514 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
516 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
517 "warning: `pc+-file.sav' near offset 0x0: Directory fields have unexpected values (1,2)."
519 warning: `pc+-file.sav' near offset 0x100: Record 0 specifies unexpected system missing value 1 (0x1p+0).
521 "warning: `pc+-file.sav' near offset 0x100: Record 0 reserved fields have unexpected values (1,1,0,2,0)."
523 warning: `pc+-file.sav' near offset 0x100: Record 0 case counts differ (1 versus 3).
527 AT_SETUP([short main header])
528 AT_KEYWORDS([sack synthetic PC+ file negative])
529 AT_DATA([pc+-file.sack], [dnl
532 @MAIN; @MAIN_END - @MAIN;
533 @VARS; @VARS_END - @VARS;
535 @DATA; @DATA_END - @DATA;
541 s62 "PCSPSS PSPP synthetic test product";
543 0; 0; i16 1; dnl Fixed.
554 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
555 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
556 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
558 dnl Numeric variables.
559 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
560 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
561 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
562 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
566 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
569 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
570 AT_DATA([pc+-file.sps], [dnl
571 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
573 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
574 error: `pc+-file.sav' near offset 0x100: This is not an SPSS/PC+ system file.
578 AT_SETUP([long main header])
579 AT_KEYWORDS([sack synthetic PC+ file negative])
580 AT_DATA([pc+-file.sack], [dnl
583 @MAIN; @MAIN_END - @MAIN;
584 @VARS; @VARS_END - @VARS;
586 @DATA; @DATA_END - @DATA;
592 s62 "PCSPSS PSPP synthetic test product";
594 0; 0; i16 1; dnl Fixed.
602 >>s80 "PSPP synthetic test file"<<;
606 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
607 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
608 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
610 dnl Numeric variables.
611 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
612 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
613 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
614 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
618 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
621 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
622 AT_DATA([pc+-file.sps], [dnl
623 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
625 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
626 warning: `pc+-file.sav' near offset 0x100: Record 0 has unexpected length 192.
630 AT_SETUP([invalid compression type])
631 AT_KEYWORDS([sack synthetic PC+ file negative])
632 AT_DATA([pc+-file.sack], [dnl
635 @MAIN; @MAIN_END - @MAIN;
636 @VARS; @VARS_END - @VARS;
638 @DATA; @DATA_END - @DATA;
644 s62 "PCSPSS PSPP synthetic test product";
646 0; 0; i16 1; dnl Fixed.
654 s64 "PSPP synthetic test file";
658 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
659 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
660 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
662 dnl Numeric variables.
663 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
664 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
665 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
666 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
670 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
673 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
674 AT_DATA([pc+-file.sps], [dnl
675 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
677 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
678 error: `pc+-file.sav' near offset 0x100: Invalid compression type 2.
682 AT_SETUP([unrealistic number of cases])
683 AT_KEYWORDS([sack synthetic PC+ file negative])
684 AT_DATA([pc+-file.sack], [dnl
687 @MAIN; @MAIN_END - @MAIN;
688 @VARS; @VARS_END - @VARS;
690 @DATA; @DATA_END - @DATA;
696 s62 "PCSPSS PSPP synthetic test product";
698 0; 0; i16 1; dnl Fixed.
706 s64 "PSPP synthetic test file";
710 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
711 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
712 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
714 dnl Numeric variables.
715 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
716 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
717 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
718 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
722 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
725 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
726 AT_DATA([pc+-file.sps], [dnl
727 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
729 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
730 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.
734 AT_SETUP([labels bad offsets])
735 AT_KEYWORDS([sack synthetic PC+ file negative])
736 AT_DATA([pc+-file.sack], [dnl
739 @MAIN; @MAIN_END - @MAIN;
740 @VARS; @VARS_END - @VARS;
741 @LABELS; @LABELS_END - @LABELS;
742 @DATA; @DATA_END - @DATA;
748 s62 "PCSPSS PSPP synthetic test product";
750 0; 0; i16 1; dnl Fixed.
758 s64 "PSPP synthetic test file";
762 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
763 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
764 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
766 dnl Numeric variables.
767 @N1L - @LOFF; @N1E - @LOFF; 1000; 0x050800; s8 "NUM1"; PCSYSMIS;
768 @N1L - @LOFF - 1; @LABELS_END - @LOFF; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
769 @N1L - @LOFF + 1; @LABELS_END - @LOFF; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
770 0; 0; @LABELS_END - @LOFF - 1; 0x050800; s8 "NUM4"; PCSYSMIS;
774 3; i8 0 0 0; LOFF: i8 0;
779 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0; N1E:
782 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
783 AT_DATA([pc+-file.sps], [dnl
784 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
786 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
787 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.
789 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.
791 "warning: `pc+-file.sav' near offset 0x2a0: Value labels end with partial label (0 bytes left in record, label length 255)."
793 warning: `pc+-file.sav' near offset 0x299: 7 leftover bytes following value labels.
795 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.
799 AT_SETUP([record 1 bad length])
800 AT_KEYWORDS([sack synthetic PC+ file negative])
801 AT_DATA([pc+-file.sack], [dnl
804 @MAIN; @MAIN_END - @MAIN;
805 @VARS; @VARS_END - @VARS;
807 @DATA; @DATA_END - @DATA;
813 s62 "PCSPSS PSPP synthetic test product";
815 0; 0; i16 1; dnl Fixed.
823 s64 "PSPP synthetic test file";
827 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
828 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
829 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
831 dnl Numeric variables.
832 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
833 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
834 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
838 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
841 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
842 AT_DATA([pc+-file.sps], [dnl
843 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
845 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
846 error: `pc+-file.sav' near offset 0x1b0: Record 1 has length 192 (expected 224).
850 AT_SETUP([bad variable format])
851 AT_KEYWORDS([sack synthetic PC+ file negative])
852 AT_DATA([pc+-file.sack], [dnl
855 @MAIN; @MAIN_END - @MAIN;
856 @VARS; @VARS_END - @VARS;
858 @DATA; @DATA_END - @DATA;
864 s62 "PCSPSS PSPP synthetic test product";
866 0; 0; i16 1; dnl Fixed.
874 s64 "PSPP synthetic test file";
878 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
879 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
880 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
882 dnl Numeric variables.
883 0; 0; 0; 0xff0000; s8 "NUM1"; PCSYSMIS;
884 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
885 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
886 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
890 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
893 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
894 AT_DATA([pc+-file.sps], [dnl
895 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
897 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
898 error: `pc+-file.sav' near offset 0x210: Variable 3 has invalid type 255.
902 AT_SETUP([bad variable name])
903 AT_KEYWORDS([sack synthetic PC+ file negative])
904 AT_DATA([pc+-file.sack], [dnl
907 @MAIN; @MAIN_END - @MAIN;
908 @VARS; @VARS_END - @VARS;
910 @DATA; @DATA_END - @DATA;
916 s62 "PCSPSS PSPP synthetic test product";
918 0; 0; i16 1; dnl Fixed.
926 s64 "PSPP synthetic test file";
930 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
931 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
932 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
934 dnl Numeric variables.
935 0; 0; 0; 0x050000; s8 "#NUM"; PCSYSMIS;
936 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
937 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
938 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
942 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
945 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
946 AT_DATA([pc+-file.sps], [dnl
947 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
949 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
950 error: `pc+-file.sav' near offset 0x210: Invalid variable name `#NUM'.
954 AT_SETUP([duplicate variable name])
955 AT_KEYWORDS([sack synthetic PC+ file negative])
956 AT_DATA([pc+-file.sack], [dnl
959 @MAIN; @MAIN_END - @MAIN;
960 @VARS; @VARS_END - @VARS;
962 @DATA; @DATA_END - @DATA;
968 s62 "PCSPSS PSPP synthetic test product";
970 0; 0; i16 1; dnl Fixed.
978 s64 "PSPP synthetic test file";
982 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
983 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
984 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
986 dnl Numeric variables.
987 0; 0; 0; 0x050000; s8 "NUM1"; PCSYSMIS;
988 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
989 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
990 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
994 0.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
997 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
998 AT_DATA([pc+-file.sps], [dnl
999 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1001 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
1002 warning: `pc+-file.sav' near offset 0x230: Renaming variable with duplicate name `NUM1' to `VAR001'.
1004 warning: `pc+-file.sav' near offset 0x250: Renaming variable with duplicate name `NUM1' to `VAR002'.
1006 warning: `pc+-file.sav' near offset 0x270: Renaming variable with duplicate name `NUM1' to `VAR003'.
1010 AT_SETUP([partial case])
1011 AT_KEYWORDS([sack synthetic PC+ file negative])
1012 AT_DATA([pc+-file.sack], [dnl
1015 @MAIN; @MAIN_END - @MAIN;
1016 @VARS; @VARS_END - @VARS;
1018 @DATA; @DATA_END - @DATA;
1024 s62 "PCSPSS PSPP synthetic test product";
1026 0; 0; i16 1; dnl Fixed.
1034 s64 "PSPP synthetic test file";
1038 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1039 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1040 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1042 dnl Numeric variables.
1043 0; 0; 0; 0x050000; s8 "NUM1"; PCSYSMIS;
1044 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1045 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1046 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1050 1.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1051 2.0; "11/28/14"; 1.0; 6.0; 7.0; 8.0; 9.0;
1052 3.0; "11/28/14"; 1.0; 10.0;
1055 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1056 AT_DATA([pc+-file.sps], [dnl
1057 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1060 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
1061 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.
1063 error: `pc+-file.sav' near offset 0x320: File ends in partial case.
1065 error: Error reading case from file `pc+-file.sav'.
1074 AT_SETUP([case extends past end of data record])
1075 AT_KEYWORDS([sack synthetic PC+ file negative])
1076 AT_DATA([pc+-file.sack], [dnl
1079 @MAIN; @MAIN_END - @MAIN;
1080 @VARS; @VARS_END - @VARS;
1082 @DATA; @DATA_END - @DATA;
1088 s62 "PCSPSS PSPP synthetic test product";
1090 0; 0; i16 1; dnl Fixed.
1098 s64 "PSPP synthetic test file";
1102 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1103 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1104 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1106 dnl Numeric variables.
1107 0; 0; 0; 0x050000; s8 "NUM1"; PCSYSMIS;
1108 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1109 0; 0; 0; 0x050800; s8 "NUM3"; PCSYSMIS;
1110 0; 0; 0; 0x050800; s8 "NUM4"; PCSYSMIS;
1114 1.0; "11/28/14"; 1.0; 2.0; 3.0; 4.0; 5.0;
1115 2.0; "11/28/14"; 1.0; 6.0; 7.0; 8.0; 9.0;
1116 3.0; "11/28/14"; 1.0; 10.0;
1120 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1121 AT_DATA([pc+-file.sps], [dnl
1122 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1125 AT_CHECK([pspp -O format=csv pc+-file.sps], [1], [dnl
1126 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.
1128 error: `pc+-file.sav' near offset 0x338: Case beginning at offset 0x00000300 extends past end of data record at offset 0x00000320.
1130 error: Error reading case from file `pc+-file.sav'.
1139 AT_SETUP([corrupt compressed data])
1140 AT_KEYWORDS([sack synthetic PC+ file positive])
1141 AT_DATA([pc+-file.sack], [dnl
1144 @MAIN; @MAIN_END - @MAIN;
1145 @VARS; @VARS_END - @VARS;
1147 @DATA; @DATA_END - @DATA;
1153 s62 "PCSPSS PSPP synthetic test product";
1155 0; 0; i16 1; dnl Fixed.
1163 s64 "PSPP synthetic test file";
1167 0; 0; 0; 0x050800; s8 "$CASENUM"; PCSYSMIS;
1168 0; 0; 0; 0x010800; s8 "$DATE"; PCSYSMIS;
1169 0; 0; 0; 0x050802; s8 "$WEIGHT"; PCSYSMIS;
1171 dnl Numeric variables.
1172 0; 0; 0; 0x050800; s8 "NUM1"; PCSYSMIS;
1173 0; 0; 0; 0x050800; s8 "NUM2"; PCSYSMIS;
1175 dnl String variables.
1176 0; 0; 0; 0x010400; s8 "STR4"; PCSYSMIS;
1177 0; 0; 0; 0x010800; s8 "STR8"; PCSYSMIS;
1178 0; 0; 0; 0x010f00; s8 "STR15"; PCSYSMIS;
1183 i8 101 1 101 100 255 1 1 1;
1184 s8 "11/28/14"; s8 "abcd"; s8 "efghj"; s8 "efghijkl";
1185 i8 1; i8 102 101 101 1 0 1 1;
1186 s8 "ABCDEFG"; 1000.0; s8 "PQRS"; s8 "TUVWXYZa";
1188 s16 "bcdefghijklmnop";
1191 AT_CHECK([sack --le pc+-file.sack > pc+-file.sav])
1192 AT_DATA([pc+-file.sps], [dnl
1193 GET FILE='pc+-file.sav' ENCODING='us-ascii'.
1198 AT_CHECK([pspp -O format=csv pc+-file.sps], [0], [dnl
1199 File label: PSPP synthetic test file
1201 Variable,Description,Position
1208 warning: `pc+-file.sav' near offset 0x308: Possible compressed data corruption: string contains compressed integer (opcode 101).
1211 NUM1,NUM2,STR4,STR8,STR15
1212 -5,150,abcd,efghj ,efghijklABCDEFG
1213 1000,.,PQRS,TUVWXYZa,bcdefghijklmnop