sys-file-reader: Add tests.
[pspp-builds.git] / tests / data / sys-file-reader.at
1 AT_BANNER([system file reader - positive])
2
3 AT_SETUP([variable labels and missing values])
4 AT_KEYWORDS([sack synthetic system file positive])
5 AT_DATA([sys-file.sack], [dnl
6 dnl File header.
7 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
8 2; dnl Layout code
9 22; dnl Nominal case size
10 0; dnl Not compressed
11 0; dnl Not weighted 
12 1; dnl 1 case.
13 100.0; dnl Bias.
14 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
15 i8 0 *3;
16
17 dnl Numeric variable, no label or missing values.
18 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
19
20 dnl Numeric variable, variable label.
21 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
22 26; "Numeric variable 2's label"; i8 0 *2;
23
24 dnl Numeric variable, one missing value.
25 2; 0; 0; 1; 0x050800 *2; s8 "NUM3";
26 1.0;
27
28 dnl Numeric variable, variable label and missing value.
29 2; 0; 1; 1; 0x050800 *2; s8 "NUM4";
30 30; "Another numeric variable label"; i8 0 * 2;
31 1.0;
32
33 dnl Numeric variable, two missing values.
34 2; 0; 0; 2; 0x050800 *2; s8 "NUM5"; 1.0; 2.0;
35
36 dnl Numeric variable, three missing values.
37 2; 0; 0; 3; 0x050800 *2; s8 "NUM6"; 1.0; 2.0; 3.0;
38
39 dnl Numeric variable, range of missing values.
40 2; 0; 0; -2; 0x050800 *2; s8 "NUM7"; 1.0; 3.0;
41
42 dnl Numeric variables, range of missing values plus discrete value.
43 2; 0; 0; -3; 0x050800 *2; s8 "NUM8"; 1.0; 3.0; 5.0;
44 2; 0; 0; -3; 0x050800 *2; s8 "NUM9"; 1.0; HIGHEST; -5.0;
45 2; 0; 0; -3; 0x050800 *2; s8 "NUM10"; LOWEST; 1.0; 5.0;
46
47 dnl String variable, no label or missing values.
48 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
49
50 dnl String variable, variable label.
51 2; 4; 1; 0; 0x010400 *2; s8 "STR2";
52 25; "String variable 2's label"; i8 0 * 3;
53
54 dnl String variable, one missing value.
55 2; 4; 0; 1; 0x010400 *2; s8 "STR3"; s8 "MISS";
56
57 dnl String variable, variable label and missing value.
58 2; 4; 1; 1; 0x010400 *2; s8 "STR4";
59 29; "Another string variable label"; i8 0 * 3;
60 s8 "OTHR";
61
62 dnl String variable, two missing values.
63 2; 4; 0; 2; 0x010400 *2; s8 "STR5"; s8 "MISS"; s8 "OTHR";
64
65 dnl String variable, three missing values.
66 2; 4; 0; 3; 0x010400 *2; s8 "STR6"; s8 "MISS"; s8 "OTHR"; s8 "MORE";
67
68 dnl Long string variable, one missing value.
69 2; 11; 0; 1; 0x010b00 *2; s8 "STR7"; "first8by";
70 2; -1; 0; 0; 0; 0; s8 "";
71
72 dnl Long string variable, value label.
73 2; 25; 1; 0; 0x011900 *2; s8 "STR8"; 14; "25-byte string"; i8 0 * 2;
74 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
75 dnl Variable label fields on continuation records have been spotted in system
76 dnl files created by "SPSS Power Macintosh Release 6.1".
77 2; -1; 1; 0; 0; 0; s8 ""; 20; "dummy variable label";
78
79 dnl Machine integer info record.
80 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
81
82 dnl Machine floating-point info record.
83 7; 4; 8; 3; SYSMIS; HIGHEST; LOWEST;
84
85 dnl Character encoding record.
86 7; 20; 1; 12; "windows-1252";
87
88 dnl Dictionary termination record.
89 999; 0;
90
91 dnl Data.
92 1.0; 2.0; 3.0; 4.0; 5.0; 6.0; 7.0; 8.0; 9.0; 10.0;
93 s8 "abcd"; s8 "efgh"; s8 "ijkl"; s8 "mnop"; s8 "qrst"; s8 "uvwx";
94 s16 "yzABCDEFGHI"; s32 "JKLMNOPQRSTUVWXYZ01234567";
95 ])
96 for variant in \
97         "be e07ee28eaf7bceca017e83e9fd46be3c" \
98         "le c357aa20227c856b8a80d1b840722da1"
99 do
100   set $variant
101   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
102 ])
103   AT_DATA([sys-file.sps], [dnl
104 GET FILE='sys-file.sav'.
105 DISPLAY DICTIONARY.
106 LIST.
107 ])
108   AT_CHECK([pspp -o pspp.csv sys-file.sps])
109   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
110 Variable,Description,,Position
111 num1,Format: F8.0,,1
112 num2,Numeric variable 2's label,,2
113 ,Format: F8.0,,
114 num3,Format: F8.0,,3
115 ,Missing Values: 1,,
116 num4,Another numeric variable label,,4
117 ,Format: F8.0,,
118 ,Missing Values: 1,,
119 num5,Format: F8.0,,5
120 ,Missing Values: 1; 2,,
121 num6,Format: F8.0,,6
122 ,Missing Values: 1; 2; 3,,
123 num7,Format: F8.0,,7
124 ,Missing Values: 1 THRU 3,,
125 num8,Format: F8.0,,8
126 ,Missing Values: 1 THRU 3; 5,,
127 num9,Format: F8.0,,9
128 ,Missing Values: 1 THRU HIGHEST; -5,,
129 num10,Format: F8.0,,10
130 ,Missing Values: LOWEST THRU 1; 5,,
131 str1,Format: A4,,11
132 str2,String variable 2's label,,12
133 ,Format: A4,,
134 str3,Format: A4,,13
135 ,"Missing Values: ""MISS""",,
136 str4,Another string variable label,,14
137 ,Format: A4,,
138 ,"Missing Values: ""OTHR""",,
139 str5,Format: A4,,15
140 ,"Missing Values: ""MISS""; ""OTHR""",,
141 str6,Format: A4,,16
142 ,"Missing Values: ""MISS""; ""OTHR""; ""MORE""",,
143 str7,Format: A11,,17
144 ,"Missing Values: ""first8by""",,
145 str8,25-byte string,,18
146 ,Format: A25,,
147
148 Table: Data List
149 num1,num2,num3,num4,num5,num6,num7,num8,num9,num10,str1,str2,str3,str4,str5,str6,str7,str8
150 1,2,3,4,5,6,7,8,9,10,abcd,efgh,ijkl,mnop,qrst,uvwx,yzABCDEFGHI,JKLMNOPQRSTUVWXYZ01234567
151 ])
152 done
153 AT_CLEANUP
154
155 AT_SETUP([unspecified number of variable positions])
156 AT_KEYWORDS([sack synthetic system file positive])
157 AT_DATA([sys-file.sack], [dnl
158 dnl File header.
159 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
160 2; dnl Layout code
161 -1; dnl Nominal case size (unspecified)
162 0; dnl Not compressed
163 0; dnl Not weighted 
164 1; dnl 1 case.
165 100.0; dnl Bias.
166 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
167 i8 0 *3;
168
169 dnl Numeric variable, no label or missing values.
170 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
171
172 dnl Numeric variable, variable label.
173 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
174 26; "Numeric variable 2's label"; i8 0 *2;
175
176 dnl Dictionary termination record.
177 999; 0;
178
179 dnl Data.
180 1.0; 2.0; 
181 ])
182 for variant in \
183         "be 413e7bc80a47fcd7e4c8020e8e120060" \
184         "le d7db9120b1ff28c83aa6fe9fc405d903"
185 do
186   set $variant
187   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
188 ])
189   AT_DATA([sys-file.sps], [dnl
190 GET FILE='sys-file.sav'.
191 DISPLAY DICTIONARY.
192 LIST.
193 ])
194   AT_CHECK([pspp -o pspp.csv sys-file.sps])
195   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
196 Variable,Description,,Position
197 num1,Format: F8.0,,1
198 num2,Numeric variable 2's label,,2
199 ,Format: F8.0,,
200
201 Table: Data List
202 num1,num2
203 1,2
204 ])
205 done
206 AT_CLEANUP
207
208 AT_SETUP([wrong number of variable positions but version 13])
209 AT_KEYWORDS([sack synthetic system file positive])
210 AT_DATA([sys-file.sack], [dnl
211 dnl File header.
212 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
213 2; dnl Layout code
214 -1; dnl Nominal case size (unspecified)
215 0; dnl Not compressed
216 0; dnl Not weighted 
217 1; dnl 1 case.
218 100.0; dnl Bias.
219 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
220 i8 0 *3;
221
222 dnl Numeric variable, no label or missing values.
223 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
224
225 dnl Numeric variable, variable label.
226 2; 0; 1; 0; 0x050800 *2; s8 "NUM2";
227 26; "Numeric variable 2's label"; i8 0 *2;
228
229 dnl Machine integer info record (SPSS 13).
230 7; 3; 4; 8; 13; 2; 3; -1; 1; 1; ENDIAN; 1252;
231
232 dnl Dictionary termination record.
233 999; 0;
234
235 dnl Data.
236 1.0; 2.0; 
237 ])
238 for variant in \
239         "be 3d17aae7d99538dc73c5cb42692b1038" \
240         "le 8ad1000df598617d5258f323c882d749"
241 do
242   set $variant
243   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
244 ])
245   AT_DATA([sys-file.sps], [dnl
246 GET FILE='sys-file.sav'.
247 DISPLAY DICTIONARY.
248 LIST.
249 ])
250   AT_CHECK([pspp -o pspp.csv sys-file.sps])
251   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
252 Variable,Description,,Position
253 num1,Format: F8.0,,1
254 num2,Numeric variable 2's label,,2
255 ,Format: F8.0,,
256
257 Table: Data List
258 num1,num2
259 1,2
260 ])
261 done
262 AT_CLEANUP
263
264 AT_SETUP([value labels])
265 AT_KEYWORDS([sack synthetic system file positive])
266 AT_DATA([sys-file.sack], [dnl
267 dnl File header.
268 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
269 2; dnl Layout code
270 22; dnl Nominal case size
271 0; dnl Not compressed
272 0; dnl Not weighted 
273 1; dnl 1 case.
274 100.0; dnl Bias.
275 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
276 i8 0 *3;
277
278 dnl Numeric variables.
279 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
280 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
281 2; 0; 0; 0; 0x050800 *2; s8 "NUM3";
282 2; 0; 0; 0; 0x050800 *2; s8 "NUM4";
283 2; 0; 0; 0; 0x050800 *2; s8 "NUM5";
284
285 dnl String variables.
286 2; 1; 0; 0; 0x010100 *2; s8 "STR1"; dnl index 6
287 2; 2; 0; 0; 0x010200 *2; s8 "STR2"; dnl index 7
288 2; 3; 0; 0; 0x010300 *2; s8 "STR3"; dnl index 8
289 2; 4; 0; 0; 0x010400 *2; s8 "STR4"; dnl index 9
290 2; 4; 0; 0; 0x010400 *2; s8 "STR5"; dnl index 10
291 2; 6; 0; 0; 0x010600 *2; s8 "STR6"; dnl index 11
292 2; 7; 0; 0; 0x010700 *2; s8 "STR7"; dnl index 12
293 2; 8; 0; 0; 0x010800 *2; s8 "STR8"; dnl index 13
294 2; 9; 0; 0; 0x010900 *2; s8 "STR9"; dnl index 14
295 2; -1; 0; 0; 0; 0; s8 "";
296 2; 12; 0; 0; 0x010c00 *2; s8 "STR12"; dnl index 16
297 2; -1; 0; 0; 0; 0; s8 "";
298 2; 16; 0; 0; 0x011000 *2; s8 "STR16"; dnl index 18
299 2; -1; 0; 0; 0; 0; s8 "";
300 2; 17; 0; 0; 0x011100 *2; s8 "STR17"; dnl index 20
301 ( 2; -1; 0; 0; 0; 0; s8 ""; ) * 2;
302
303 dnl One value label for NUM1.
304 3; 1; 1.0; i8 3; s7 "one"; 4; 1; 1;
305
306 dnl Two value labels for NUM2, as a single pair of type 3 and type 4 records.
307 3; 2; 1.0; i8 3; s7 "one"; 2.0; i8 3; s7 "two"; 4; 1; 2;
308
309 dnl Two value labels for NUM3, as two pairs of type 3 and type 4 records.
310 3; 1; 3.0; i8 5; s7 "three"; 4; 1; 3;
311 3; 1; 4.0; i8 4; s7 "four"; 4; 1; 3;
312
313 dnl Two common value labels for NUM4 and NUM5, plus two different ones for each.
314 3; 1; 5.0; i8 4; s7 "five"; 4; 1; 4;
315 3; 1; 6.0; i8 3; s7 "six"; 4; 1; 5;
316 3; 2; 7.0; i8 5; s7 "seven"; 8.0; i8 5; s7 "eight"; 4; 2; 4; 5;
317 3; 1; 9.0; i8 4; s7 "nine"; 4; 1; 4;
318 3; 1; 10.0; i8 3; s7 "ten"; 4; 1; 5;
319
320 dnl One value label for STR1.
321 3; 1; s8 "a"; i8 19; s23 "value label for `a'"; 4; 1; 6;
322
323 dnl Two value labels for STR2, as a single pair of type 3 and type 4 records.
324 3; 2;
325 s8 "bc"; i8 20; s23 "value label for `bc'";
326 s8 "de"; i8 20; s23 "value label for `de'";
327 4; 1; 7;
328
329 dnl Two value labels for STR3, as two pairs of type 3 and type 4 records.
330 3; 1; s8 "fgh"; i8 21; s23 "value label for `fgh'"; 4; 1; 8;
331 3; 1; s8 "ijk"; i8 21; s23 "value label for `ijk'"; 4; 1; 8;
332
333 dnl Two common value labels for STR4 and STR5, plus two different ones for each.
334 3; 1; s8 "lmno"; i8 22; s23 "value label for `lmno'"; 4; 1; 9;
335 3; 1; s8 "pqrs"; i8 22; s23 "value label for `pqrs'"; 4; 1; 10;
336 3; 2;
337 s8 "tuvw"; i8 22; s23 "value label for `tuvw'";
338 s8 "xyzA"; i8 22; s23 "value label for `xyzA'";
339 4; 2; 9; 10;
340 3; 1; s8 "BCDE"; i8 22; s23 "value label for `BCDE'"; 4; 1; 9;
341 3; 1; s8 "FGHI"; i8 22; s23 "value label for `FGHI'"; 4; 1; 10;
342
343 dnl One value label for STR6, STR7, STR8.
344 3; 1; s8 "JKLMNO"; i8 24; s31 "value label for `JKLMNO'"; 4; 1; 11;
345 3; 1; s8 "JKLMNOP"; i8 25; s31 "value label for `JKLMNOP'"; 4; 1; 12;
346 3; 1; s8 "JKLMNOPQ"; i8 26; s31 "value label for `JKLMNOPQ'"; 4; 1; 13;
347
348 7; 21; 1; COUNT (
349 dnl One value label for STR9,
350 COUNT("STR9"); 9; 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
351
352 dnl Two value labels for STR12.
353 COUNT("STR12"); 12; 2;
354 COUNT("0123456789ab"); COUNT("value label for `0123456789ab'");
355 COUNT("cdefghijklmn"); COUNT("value label for `cdefghijklmn'");
356
357 dnl Three value labels for STR16.
358 COUNT("STR16"); 16; 3;
359 COUNT("opqrstuvwxyzABCD"); COUNT("value label for `opqrstuvwxyzABCD'");
360 COUNT("EFGHIJKLMNOPQRST"); COUNT("value label for `EFGHIJKLMNOPQRST'");
361 COUNT("UVWXYZ0123456789"); COUNT("value label for `UVWXYZ0123456789'");
362
363 dnl One value label for STR17.
364 COUNT("STR17"); 17; 1;
365 COUNT("abcdefghijklmnopq"); COUNT("value label for `abcdefghijklmnopq'");
366 );
367
368 dnl Dictionary termination record.
369 999; 0;
370 ])
371 for variant in \
372         "be 1de55cc9fb523c8f9b014cdc5387c12b" \
373         "le 76a6974012df7351b591c5964c41e582"
374 do
375   set $variant
376   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
377 ])
378   AT_DATA([sys-file.sps], [dnl
379 GET FILE='sys-file.sav'.
380 DISPLAY DICTIONARY.
381 ])
382   AT_CHECK([pspp -o pspp.csv sys-file.sps])
383   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
384 Variable,Description,,Position
385 num1,Format: F8.0,,1
386 ,1,one,
387 num2,Format: F8.0,,2
388 ,1,one,
389 ,2,two,
390 num3,Format: F8.0,,3
391 ,3,three,
392 ,4,four,
393 num4,Format: F8.0,,4
394 ,5,five,
395 ,7,seven,
396 ,8,eight,
397 ,9,nine,
398 num5,Format: F8.0,,5
399 ,6,six,
400 ,7,seven,
401 ,8,eight,
402 ,10,ten,
403 str1,Format: A1,,6
404 ,a,value label for `a',
405 str2,Format: A2,,7
406 ,bc,value label for `bc',
407 ,de,value label for `de',
408 str3,Format: A3,,8
409 ,fgh,value label for `fgh',
410 ,ijk,value label for `ijk',
411 str4,Format: A4,,9
412 ,BCDE,value label for `BCDE',
413 ,lmno,value label for `lmno',
414 ,tuvw,value label for `tuvw',
415 ,xyzA,value label for `xyzA',
416 str5,Format: A4,,10
417 ,FGHI,value label for `FGHI',
418 ,pqrs,value label for `pqrs',
419 ,tuvw,value label for `tuvw',
420 ,xyzA,value label for `xyzA',
421 str6,Format: A6,,11
422 ,JKLMNO,value label for `JKLMNO',
423 str7,Format: A7,,12
424 ,JKLMNOP,value label for `JKLMNOP',
425 str8,Format: A8,,13
426 ,JKLMNOPQ,value label for `JKLMNOPQ',
427 str9,Format: A9,,14
428 ,RSTUVWXYZ,value label for `RSTUVWXYZ',
429 str12,Format: A12,,15
430 ,0123456789ab,value label for `0123456789ab',
431 ,cdefghijklmn,value label for `cdefghijklmn',
432 str16,Format: A16,,16
433 ,EFGHIJKLMNOPQRST,value label for `EFGHIJKLMNOPQRST',
434 ,UVWXYZ0123456789,value label for `UVWXYZ0123456789',
435 ,opqrstuvwxyzABCD,value label for `opqrstuvwxyzABCD',
436 str17,Format: A17,,17
437 ,abcdefghijklmnopq,value label for `abcdefghijklmnopq',
438 ])
439 done
440 AT_CLEANUP
441
442 AT_SETUP([documents])
443 AT_KEYWORDS([sack synthetic system file positive])
444 AT_DATA([sys-file.sack], [dnl
445 dnl File header.
446 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
447 2; dnl Layout code
448 1; dnl Nominal case size
449 0; dnl Not compressed
450 0; dnl Not weighted 
451 1; dnl 1 case.
452 100.0; dnl Bias.
453 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
454 i8 0 *3;
455
456 dnl Numeric variable, no label or missing values.
457 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
458
459 dnl Document record.
460 6; 4;
461 s80 "First line of documents";
462 s80 "Second line of documents";
463 s80 "";
464 s80 "Last line of documents";
465
466 dnl Dictionary termination record.
467 999; 0;
468
469 dnl Data.
470 1.0;
471 ])
472 for variant in \
473         "be 8738124d7932cc8ff803142fbf38710b" \
474         "le f3ca2123ec9e8bda91c6b865ba39f506"
475 do
476   set $variant
477   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
478 ])
479   AT_DATA([sys-file.sps], [dnl
480 GET FILE='sys-file.sav'.
481 DISPLAY DOCUMENTS.
482 LIST.
483 ])
484   AT_CHECK([pspp -o pspp.csv sys-file.sps])
485   AT_CHECK([cat pspp.csv], [0], [dnl
486 Documents in the active file:
487
488 First line of documents
489
490 Second line of documents
491
492
493
494 Last line of documents
495
496 Table: Data List
497 num1
498 1
499 ])
500 done
501 AT_CLEANUP
502
503 AT_SETUP([multiple response sets])
504 AT_KEYWORDS([sack synthetic system file positive])
505 AT_DATA([sys-file.sack], [dnl
506 dnl File header.
507 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
508 2; dnl Layout code
509 16; dnl Nominal case size
510 0; dnl Not compressed
511 0; dnl Not weighted 
512 0; dnl No cases.
513 100.0; dnl Bias.
514 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
515 i8 0 *3;
516
517 dnl $a
518 2; 0; 0; 0; 0x050800 *2; s8 "A";
519 2; 0; 0; 0; 0x050800 *2; s8 "B";
520 2; 0; 0; 0; 0x050800 *2; s8 "C";
521
522 dnl $b
523 2; 0; 0; 0; 0x050800 *2; s8 "D";
524 2; 0; 0; 0; 0x050800 *2; s8 "E";
525 2; 0; 0; 0; 0x050800 *2; s8 "F";
526 2; 0; 0; 0; 0x050800 *2; s8 "G";
527
528 dnl $c
529 2; 3; 0; 0; 0x010300 *2; s8 "H";
530 2; 3; 0; 0; 0x010300 *2; s8 "I";
531 2; 3; 0; 0; 0x010300 *2; s8 "J";
532
533 dnl $d
534 2; 0; 0; 0; 0x050800 *2; s8 "K";
535 2; 0; 0; 0; 0x050800 *2; s8 "L";
536 2; 0; 0; 0; 0x050800 *2; s8 "M";
537
538 dnl $e
539 2; 6; 0; 0; 0x010600 *2; s8 "N";
540 2; 6; 0; 0; 0x010600 *2; s8 "O";
541 2; 6; 0; 0; 0x010600 *2; s8 "P";
542
543 7; 7; 1;
544 COUNT(
545   "$a=C 10 my mcgroup a b c"; i8 10;
546   "$b=D2 55 0  g e f d"; i8 10;
547   "$c=D3 Yes 10 mdgroup #2 h i j"; i8 10);
548
549 7; 19; 1;
550 COUNT(
551   "$d=E 1 2 34 13 third mdgroup k l m"; i8 10;
552   "$e=E 11 6 choice 0  n o p"; i8 10);
553
554 dnl Dictionary termination record.
555 999; 0;
556 ])
557 for variant in \
558         "be 0caa3446d7a3f6985e79fd1fcc999b10" \
559         "le 9dbeba699e4149ed836f55bad7346d67"
560 do
561   set $variant
562   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
563 ])
564   AT_DATA([sys-file.sps], [dnl
565 GET FILE='sys-file.sav'.
566 MRSETS /DISPLAY NAME=ALL.
567 ])
568   AT_CHECK([pspp -o pspp.csv sys-file.sps])
569   AT_CHECK([cat pspp.csv], [0], [dnl
570 Table: Multiple Response Sets
571 Name,Variables,Details
572 $a,"a
573 b
574 c
575 ","Multiple category set
576 Label: my mcgroup
577 "
578 $b,"g
579 e
580 f
581 d
582 ","Multiple dichotomy set
583 Counted value: 55
584 Category label source: Variable labels
585 "
586 $c,"h
587 i
588 j
589 ","Multiple dichotomy set
590 Label: mdgroup #2
591 Label source: Provided by user
592 Counted value: `Yes'
593 Category label source: Variable labels
594 "
595 $d,"k
596 l
597 m
598 ","Multiple dichotomy set
599 Label: third mdgroup
600 Label source: Provided by user
601 Counted value: 34
602 Category label source: Value labels of counted value
603 "
604 $e,"n
605 o
606 p
607 ","Multiple dichotomy set
608 Label source: First variable label among variables
609 Counted value: `choice'
610 Category label source: Value labels of counted value
611 "
612 ])
613 done
614 AT_CLEANUP
615
616 AT_SETUP([variable display parameters, without width])
617 AT_KEYWORDS([sack synthetic system file positive])
618 AT_DATA([sys-file.sack], [dnl
619 dnl File header.
620 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
621 2; dnl Layout code
622 19; dnl Nominal case size
623 0; dnl Not compressed
624 0; dnl Not weighted 
625 0; dnl No cases.
626 100.0; dnl Bias.
627 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
628 i8 0 *3;
629
630 dnl Numeric variables.
631 2; 0; 0; 0; 0x050800 *2; s8 "A";
632 2; 0; 0; 0; 0x050800 *2; s8 "B";
633 2; 0; 0; 0; 0x050800 *2; s8 "C";
634 2; 0; 0; 0; 0x050800 *2; s8 "D";
635
636 dnl Short string variables.
637 2; 3; 0; 0; 0x010300 *2; s8 "H";
638 2; 3; 0; 0; 0x010300 *2; s8 "I";
639 2; 3; 0; 0; 0x010300 *2; s8 "J";
640 2; 3; 0; 0; 0x010300 *2; s8 "K";
641
642 dnl Long string variables.
643 2; 9; 0; 0; 0x010900 *2; s8 "L";
644 2; -1; 0; 0; 0; 0; s8 "";
645 2; 10; 0; 0; 0x010a00 *2; s8 "M";
646 2; -1; 0; 0; 0; 0; s8 "";
647 2; 17; 0; 0; 0x011100 *2; s8 "N";
648 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
649 2; 25; 0; 0; 0x011900 *2; s8 "O";
650 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
651
652 dnl Variable display parameters
653 7; 11; 4; 24;
654 1; 0;
655 2; 0;
656 3; 0;
657 1; 1;
658 2; 1;
659 3; 1;
660 1; 2;
661 2; 2;
662 3; 2;
663 0; 0;
664 0; 1;
665 0; 2;
666
667 dnl Dictionary termination record.
668 999; 0;
669 ])
670 for variant in \
671         "be c130d9345080579b8862b360924edbfa" \
672         "le 6fde96f5a7c7386bff6cca049cd84d6a"
673 do
674   set $variant
675   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
676 ])
677   AT_DATA([sys-file.sps], [dnl
678 GET FILE='sys-file.sav'.
679 DISPLAY DICTIONARY.
680 ])
681   AT_CHECK([pspp -o pspp.csv sys-file.sps])
682   AT_CHECK([cat pspp.csv], [0], [dnl
683 Variable,Description,,Position
684 a,Format: F8.0,,1
685 ,Measure: Nominal,,
686 ,Display Alignment: Left,,
687 ,Display Width: 8,,
688 b,Format: F8.0,,2
689 ,Measure: Ordinal,,
690 ,Display Alignment: Left,,
691 ,Display Width: 8,,
692 c,Format: F8.0,,3
693 ,Measure: Scale,,
694 ,Display Alignment: Left,,
695 ,Display Width: 8,,
696 d,Format: F8.0,,4
697 ,Measure: Nominal,,
698 ,Display Alignment: Right,,
699 ,Display Width: 8,,
700 h,Format: A3,,5
701 ,Measure: Ordinal,,
702 ,Display Alignment: Right,,
703 ,Display Width: 3,,
704 i,Format: A3,,6
705 ,Measure: Scale,,
706 ,Display Alignment: Right,,
707 ,Display Width: 3,,
708 j,Format: A3,,7
709 ,Measure: Nominal,,
710 ,Display Alignment: Center,,
711 ,Display Width: 3,,
712 k,Format: A3,,8
713 ,Measure: Ordinal,,
714 ,Display Alignment: Center,,
715 ,Display Width: 3,,
716 l,Format: A9,,9
717 ,Measure: Scale,,
718 ,Display Alignment: Center,,
719 ,Display Width: 9,,
720 m,Format: A10,,10
721 ,Measure: Nominal,,
722 ,Display Alignment: Left,,
723 ,Display Width: 10,,
724 n,Format: A17,,11
725 ,Measure: Nominal,,
726 ,Display Alignment: Right,,
727 ,Display Width: 17,,
728 o,Format: A25,,12
729 ,Measure: Nominal,,
730 ,Display Alignment: Center,,
731 ,Display Width: 25,,
732 ])
733 done
734 AT_CLEANUP
735
736 AT_SETUP([variable display parameters, with width])
737 AT_KEYWORDS([sack synthetic system file positive])
738 AT_DATA([sys-file.sack], [dnl
739 dnl File header.
740 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
741 2; dnl Layout code
742 19; dnl Nominal case size
743 0; dnl Not compressed
744 0; dnl Not weighted 
745 0; dnl No cases.
746 100.0; dnl Bias.
747 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
748 i8 0 *3;
749
750 dnl Numeric variables.
751 2; 0; 0; 0; 0x050800 *2; s8 "A";
752 2; 0; 0; 0; 0x050800 *2; s8 "B";
753 2; 0; 0; 0; 0x050800 *2; s8 "C";
754 2; 0; 0; 0; 0x050800 *2; s8 "D";
755
756 dnl Short string variables.
757 2; 3; 0; 0; 0x010300 *2; s8 "H";
758 2; 3; 0; 0; 0x010300 *2; s8 "I";
759 2; 3; 0; 0; 0x010300 *2; s8 "J";
760 2; 3; 0; 0; 0x010300 *2; s8 "K";
761
762 dnl Long string variables.
763 2; 9; 0; 0; 0x010900 *2; s8 "L";
764 2; -1; 0; 0; 0; 0; s8 "";
765 2; 10; 0; 0; 0x010a00 *2; s8 "M";
766 2; -1; 0; 0; 0; 0; s8 "";
767 2; 17; 0; 0; 0x011100 *2; s8 "N";
768 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 2;
769 2; 25; 0; 0; 0x011900 *2; s8 "O";
770 ( 2; -1; 0; 0; 0; 0; s8 "" ) * 3;
771
772 dnl Variable display parameters
773 7; 11; 4; 36;
774 1; 1; 0;
775 2; 2; 0;
776 3; 3; 0;
777 1; 4; 1;
778 2; 5; 1;
779 3; 6; 1;
780 1; 7; 2;
781 2; 8; 2;
782 3; 9; 2;
783 0; 10; 0;
784 0; 11; 1;
785 0; 12; 2;
786
787 dnl Dictionary termination record.
788 999; 0;
789 ])
790 for variant in \
791         "be 3ace75689a0b7faa9360936bbfe26055" \
792         "le 6e93f35d19a9882eb53ffb1b067ef7cd"
793 do
794   set $variant
795   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
796 ])
797   AT_DATA([sys-file.sps], [dnl
798 GET FILE='sys-file.sav'.
799 DISPLAY DICTIONARY.
800 ])
801   AT_CHECK([pspp -o pspp.csv sys-file.sps])
802   AT_CHECK([cat pspp.csv], [0], [dnl
803 Variable,Description,,Position
804 a,Format: F8.0,,1
805 ,Measure: Nominal,,
806 ,Display Alignment: Left,,
807 ,Display Width: 1,,
808 b,Format: F8.0,,2
809 ,Measure: Ordinal,,
810 ,Display Alignment: Left,,
811 ,Display Width: 2,,
812 c,Format: F8.0,,3
813 ,Measure: Scale,,
814 ,Display Alignment: Left,,
815 ,Display Width: 3,,
816 d,Format: F8.0,,4
817 ,Measure: Nominal,,
818 ,Display Alignment: Right,,
819 ,Display Width: 4,,
820 h,Format: A3,,5
821 ,Measure: Ordinal,,
822 ,Display Alignment: Right,,
823 ,Display Width: 5,,
824 i,Format: A3,,6
825 ,Measure: Scale,,
826 ,Display Alignment: Right,,
827 ,Display Width: 6,,
828 j,Format: A3,,7
829 ,Measure: Nominal,,
830 ,Display Alignment: Center,,
831 ,Display Width: 7,,
832 k,Format: A3,,8
833 ,Measure: Ordinal,,
834 ,Display Alignment: Center,,
835 ,Display Width: 8,,
836 l,Format: A9,,9
837 ,Measure: Scale,,
838 ,Display Alignment: Center,,
839 ,Display Width: 9,,
840 m,Format: A10,,10
841 ,Measure: Nominal,,
842 ,Display Alignment: Left,,
843 ,Display Width: 10,,
844 n,Format: A17,,11
845 ,Measure: Nominal,,
846 ,Display Alignment: Right,,
847 ,Display Width: 11,,
848 o,Format: A25,,12
849 ,Measure: Nominal,,
850 ,Display Alignment: Center,,
851 ,Display Width: 12,,
852 ])
853 done
854 AT_CLEANUP
855
856 AT_SETUP([long variable names])
857 AT_KEYWORDS([sack synthetic system file positive])
858 AT_DATA([sys-file.sack], [dnl
859 dnl File header.
860 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
861 2; dnl Layout code
862 4; dnl Nominal case size
863 0; dnl Not compressed
864 0; dnl Not weighted 
865 0; dnl No cases.
866 100.0; dnl Bias.
867 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
868 i8 0 *3;
869
870 dnl Numeric variables.
871 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
872 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
873 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
874 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
875
876 dnl Long variable names.
877 7; 13; 1; COUNT (
878 "LONGVARI=LongVariableName1"; i8 9;
879 "LONGVA_A=LongVariableName2"; i8 9;
880 "LONGVA_B=LongVariableName3"; i8 9;
881 "LONGVA_C=LongVariableName4";
882 );
883
884 dnl Dictionary termination record.
885 999; 0;
886 ])
887 for variant in \
888         "be eb7a8b4055a5d880a185a566048876b3" \
889         "le dd4ecd7541320b9b51746717ef20973f"
890 do
891   set $variant
892   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
893 ])
894   AT_DATA([sys-file.sps], [dnl
895 GET FILE='sys-file.sav'.
896 DISPLAY DICTIONARY.
897 ])
898   AT_CHECK([pspp -o pspp.csv sys-file.sps])
899   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
900 Variable,Description,,Position
901 LongVariableName1,Format: F8.0,,1
902 LongVariableName2,Format: F8.0,,2
903 LongVariableName3,Format: F8.0,,3
904 LongVariableName4,Format: F8.0,,4
905 ])
906 done
907 AT_CLEANUP
908
909 AT_SETUP([very long strings])
910 AT_KEYWORDS([sack synthetic system file positive])
911 AT_DATA([sys-file.sack], [dnl
912 dnl File header.
913 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
914 2; dnl Layout code
915 109; dnl Nominal case size
916 0; dnl Not compressed
917 0; dnl Not weighted 
918 1; dnl No cases.
919 100.0; dnl Bias.
920 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
921 i8 0 *3;
922
923 dnl 256-byte string.
924 2; 255; 0; 0; 0x01FF00 *2; s8 "STR256";
925 (2; -1; 0; 0; 0; 0; s8 "") * 31;
926 2; 4; 0; 0; 0x010400 *2; s8 "STR256_1";
927
928 dnl 600-byte string.
929 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600";
930 (2; -1; 0; 0; 0; 0; s8 "") * 31;
931 2; 255; 0; 0; 0x01FF00 *2; s8 "STR600_1";
932 (2; -1; 0; 0; 0; 0; s8 "") * 31;
933 2; 96; 0; 0; 0x016000 *2; s8 "STR600_2";
934 (2; -1; 0; 0; 0; 0; s8 "") * 11;
935
936 dnl Very long string record.
937 7; 14; 1; COUNT (
938 "STR256=00256"; i8 0; i8 9;
939 "STR600=00600"; i8 0; i8 9;
940 );
941
942 dnl Dictionary termination record.
943 999; 0;
944
945 dnl Data.
946 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 4;
947 "abcdefgh";
948 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#" * 9;
949 "abcdefghijklmnopqrstuvwxyzABCDEF";
950 ])
951 for variant in \
952         "be 40a4327805d8b59891084317248f5d4a" \
953         "le ced2584a43037b893b7feb068e2cb9d6"
954 do
955   set $variant
956   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
957 ])
958   AT_DATA([sys-file.sps], [dnl
959 GET FILE='sys-file.sav'.
960 DISPLAY DICTIONARY.
961 LIST.
962 ])
963   AT_CHECK([pspp -o pspp.csv sys-file.sps])
964   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
965 Variable,Description,,Position
966 str256,Format: A256,,1
967 str600,Format: A600,,2
968
969 Table: Data List
970 str256,str600
971 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@a,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#abcdefghijklmnopqrstuvwxyz
972 ])
973 done
974 AT_CLEANUP
975
976 AT_SETUP([data file and variable attributes])
977 AT_KEYWORDS([sack synthetic system file positive])
978 AT_DATA([sys-file.sack], [dnl
979 dnl File header.
980 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
981 2; dnl Layout code
982 2; dnl Nominal case size
983 0; dnl Not compressed
984 0; dnl Not weighted 
985 0; dnl 1 case.
986 100.0; dnl Bias.
987 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
988 i8 0 *3;
989
990 dnl Variables.
991 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
992 2; 0; 0; 0; 0x050800 *2; s8 "SECONDVA";
993
994 dnl Long variable names.
995 7; 13; 1; COUNT (
996 "FIRSTVAR=FirstVariable"; i8 9;
997 "SECONDVA=SecondVariable"; i8 9;
998 );
999
1000 dnl Data file attributes record.
1001 7; 17; 1; COUNT (
1002 "Attr1('Value1'"; i8 10; "''QuotedValue''"; i8 10; ")";
1003 "SecondAttr('123'"; i8 10; "'456'"; i8 10; ")";
1004 );
1005
1006 dnl Variable attributes record.
1007 7; 18; 1; COUNT (
1008 "FirstVariable:";
1009   "fred('23'"; i8 10; "'34'"; i8 10; ")";
1010   "bert('123'"; i8 10; ")";
1011 "/SecondVariable:";
1012   "xyzzy('quux'"; i8 10; ")";
1013 );
1014
1015 dnl Dictionary termination record.
1016 999; 0;
1017 ])
1018 for variant in \
1019         "be 955802de462daf810c0ecc81ee2320a1" \
1020         "le 7fc6439aedfa00615bb1fe94d6701305"
1021 do
1022   set $variant
1023   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1024 ])
1025   AT_DATA([sys-file.sps], [dnl
1026 GET FILE='sys-file.sav'.
1027 DISPLAY ATTRIBUTES.
1028 ])
1029   AT_CHECK([pspp -o pspp.csv sys-file.sps])
1030   AT_CHECK([cat pspp.csv], [0],
1031 [[Variable,Description,
1032 FirstVariable,Custom attributes:,
1033 ,bert,123
1034 ,fred[1],23
1035 ,fred[2],34
1036 SecondVariable,Custom attributes:,
1037 ,xyzzy,quux
1038
1039 Table: Custom data file attributes.
1040 Attribute,Value
1041 SecondAttr[1],123
1042 SecondAttr[2],456
1043 Attr1[1],Value1
1044 Attr1[2],'QuotedValue'
1045 ]])
1046 done
1047 AT_CLEANUP
1048
1049 AT_SETUP([compressed data])
1050 AT_KEYWORDS([sack synthetic system file positive])
1051 AT_DATA([sys-file.sack], [dnl
1052 dnl File header.
1053 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1054 2; dnl Layout code
1055 6; dnl Nominal case size
1056 1; dnl Not compressed
1057 0; dnl Not weighted 
1058 -1; dnl Unspecified number of cases.
1059 100.0; dnl Bias.
1060 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1061 i8 0 *3;
1062
1063 dnl Numeric variables.
1064 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1065 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1066
1067 dnl String variable.
1068 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1069 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1070 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1071 2; -1; 0; 0; 0; 0; s8 "";
1072
1073 dnl Dictionary termination record.
1074 999; 0;
1075
1076 dnl Compressed data.
1077 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1078 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1079 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1080 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1081
1082 ])
1083 for variant in \
1084         "be c0670e436b068f45710b98f6f7d01dc5" \
1085         "le 2e43a7f8861df4e714a192dfb3c8b2f4"
1086 do
1087   set $variant
1088   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1089 ])
1090   AT_DATA([sys-file.sps], [dnl
1091 GET FILE='sys-file.sav'.
1092 DISPLAY DICTIONARY.
1093 LIST.
1094 ])
1095   AT_CHECK([pspp -o pspp.csv sys-file.sps])
1096   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1097 Variable,Description,,Position
1098 num1,Format: F8.0,,1
1099 num2,Format: F8.0,,2
1100 str4,Format: A4,,3
1101 str8,Format: A8,,4
1102 str15,Format: A15,,5
1103
1104 Table: Data List
1105 num1,num2,str4,str8,str15
1106 -99,0,,abcdefgh,0123   @&t@
1107 .,151,jklm,nopqrstu,vwxyzABC       @&t@
1108 1,2,DEFG,HIJKLMNO,PQRSTUV
1109 ])
1110 done
1111 AT_CLEANUP
1112
1113 AT_SETUP([compressed data, zero bias])
1114 AT_KEYWORDS([sack synthetic system file positive])
1115 AT_DATA([sys-file.sack], [dnl
1116 dnl File header.
1117 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1118 2; dnl Layout code
1119 6; dnl Nominal case size
1120 1; dnl Not compressed
1121 0; dnl Not weighted 
1122 -1; dnl Unspecified number of cases.
1123 0.0; dnl Bias.
1124 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1125 i8 0 *3;
1126
1127 dnl Numeric variables.
1128 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1129 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1130
1131 dnl String variable.
1132 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1133 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1134 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1135 2; -1; 0; 0; 0; 0; s8 "";
1136
1137 dnl Dictionary termination record.
1138 999; 0;
1139
1140 dnl Compressed data.
1141 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1142 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1143 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1144 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1145
1146 ])
1147 for variant in \
1148         "be 2f0d25704ee497ae833213a3e4ff5e8b" \
1149         "le 49f68a9e1ba02a2f7e9166686a0db9d9"
1150 do
1151   set $variant
1152   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1153 ])
1154   AT_DATA([sys-file.sps], [dnl
1155 GET FILE='sys-file.sav'.
1156 DISPLAY DICTIONARY.
1157 LIST.
1158 ])
1159   AT_CHECK([pspp -o pspp.csv sys-file.sps], [0])
1160   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1161 Variable,Description,,Position
1162 num1,Format: F8.0,,1
1163 num2,Format: F8.0,,2
1164 str4,Format: A4,,3
1165 str8,Format: A8,,4
1166 str15,Format: A15,,5
1167
1168 Table: Data List
1169 num1,num2,str4,str8,str15
1170 1,100,,abcdefgh,0123   @&t@
1171 .,251,jklm,nopqrstu,vwxyzABC       @&t@
1172 101,102,DEFG,HIJKLMNO,PQRSTUV
1173 ])
1174 done
1175 AT_CLEANUP
1176
1177 AT_SETUP([compressed data, other bias])
1178 AT_KEYWORDS([sack synthetic system file positive])
1179 AT_DATA([sys-file.sack], [dnl
1180 dnl File header.
1181 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1182 2; dnl Layout code
1183 6; dnl Nominal case size
1184 1; dnl Not compressed
1185 0; dnl Not weighted 
1186 -1; dnl Unspecified number of cases.
1187 50.0; dnl Bias.
1188 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
1189 i8 0 *3;
1190
1191 dnl Numeric variables.
1192 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1193 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
1194
1195 dnl String variable.
1196 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
1197 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
1198 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
1199 2; -1; 0; 0; 0; 0; s8 "";
1200
1201 dnl Dictionary termination record.
1202 999; 0;
1203
1204 dnl Compressed data.
1205 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
1206 i8 253 253 253 254; i8 101 102 253 253; s8 "jklm"; s8 "nopqrstu";
1207 s8 "vwxyzABC"; s8 "DEFG"; s8 "HIJKLMNO";
1208 i8 254 253 252 0 0 0 0 0; s8 "PQRSTUVW";
1209
1210 ])
1211 for variant in \
1212         "be 668b85e3dee0797883e9933a096b8c18" \
1213         "le 5e7a9c4e88cd2dbc2322943da663868e"
1214 do
1215   set $variant
1216   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1217 ])
1218   AT_DATA([sys-file.sps], [dnl
1219 GET FILE='sys-file.sav'.
1220 DISPLAY DICTIONARY.
1221 LIST.
1222 ])
1223   AT_CHECK([pspp -o pspp.csv sys-file.sps], [0], 
1224     [warning: `sys-file.sav' near offset 0x5c: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format.
1225 ])
1226   AT_CHECK([grep -v Measure pspp.csv | grep -v Display], [0], [dnl
1227 "warning: `sys-file.sav' near offset 0x5c: Compression bias is not the usual value of 100, or system file uses unrecognized floating-point format."
1228
1229 Variable,Description,,Position
1230 num1,Format: F8.0,,1
1231 num2,Format: F8.0,,2
1232 str4,Format: A4,,3
1233 str8,Format: A8,,4
1234 str15,Format: A15,,5
1235
1236 Table: Data List
1237 num1,num2,str4,str8,str15
1238 -49,50,,abcdefgh,0123   @&t@
1239 .,201,jklm,nopqrstu,vwxyzABC       @&t@
1240 51,52,DEFG,HIJKLMNO,PQRSTUV
1241 ])
1242 done
1243 AT_CLEANUP
1244 \f
1245 AT_BANNER([system file reader - negative])
1246
1247 AT_SETUP([misplaced type 4 record])
1248 AT_KEYWORDS([sack synthetic system file negative])
1249 AT_DATA([sys-file.sack], [dnl
1250 dnl File header.
1251 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1252 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1253
1254 dnl Numeric variable.
1255 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1256
1257 dnl Type 4 record.
1258 >>4<<;
1259 ])
1260 for variant in \
1261         "be 6e0bb549fff1fd1af333d51b8a6e0f43" \
1262         "le 7b62734edcee2a1689c463f2866d11b8"
1263 do
1264   set $variant
1265   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1266 ])
1267   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1268 ])
1269   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1270    [error: `sys-file.sav' near offset 0xd4: Misplaced type 4 record.
1271
1272 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1273 ])
1274 done
1275 AT_CLEANUP
1276
1277 AT_SETUP([bad record type])
1278 AT_KEYWORDS([sack synthetic system file negative])
1279 AT_DATA([sys-file.sack], [dnl
1280 dnl File header.
1281 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1282 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1283
1284 dnl Numeric variable.
1285 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1286
1287 dnl Type 8 record (not a valid type).
1288 >>8<<;
1289 ])
1290 for variant in \
1291         "be dc8f078c23046ee7db74ec1003178a11" \
1292         "le dc7f111642f0629f4370630fd092eee3"
1293 do
1294   set $variant
1295   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1296 ])
1297   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1298 ])
1299   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1300    [error: `sys-file.sav' near offset 0xd4: Unrecognized record type 8.
1301
1302 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1303 ])
1304 done
1305 AT_CLEANUP
1306
1307 AT_SETUP([wrong number of variable positions])
1308 AT_KEYWORDS([sack synthetic system file negative])
1309 AT_DATA([sys-file.sack], [dnl
1310 dnl File header.
1311 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1312 2; >>2<<; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1313
1314 dnl Numeric variable.
1315 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1316
1317 dnl End of dictionary.
1318 999; 0;
1319 ])
1320 for variant in \
1321         "be c57e91aa426f61813c3ad91ea3a56dda" \
1322         "le 5d1a6c114b135b219473c8ad5bb44bda"
1323 do
1324   set $variant
1325   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1326 ])
1327   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1328 ])
1329   AT_CHECK([pspp -O format=csv sys-file.sps], [0], 
1330    [warning: `sys-file.sav' near offset 0xd8: File header claims 2 variable positions but 1 were read from file.
1331 ])
1332 done
1333 AT_CLEANUP
1334
1335 AT_SETUP([variable name may not begin with `#'])
1336 AT_KEYWORDS([sack synthetic system file negative])
1337 AT_DATA([sys-file.sack], [dnl
1338 dnl File header.
1339 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1340 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1341
1342 dnl Numeric variable.
1343 2; 0; 0; 0; 0x050800 *2; s8 >>"$UM1"<<;
1344
1345 dnl End of dictionary.
1346 999; 0;
1347 ])
1348 for variant in \
1349         "be decb7ac6defa1ab3cc7a386d1843c1ae" \
1350         "le 5279b6275633bac55d167faebccfdb14"
1351 do
1352   set $variant
1353   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1354 ])
1355   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1356 ])
1357   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1358    [error: `sys-file.sav' near offset 0xd0: Variable name begins with invalid character `$'.
1359
1360 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1361 ])
1362 done
1363 AT_CLEANUP
1364
1365 AT_SETUP([variable name may not be reserved word])
1366 AT_KEYWORDS([sack synthetic system file negative])
1367 AT_DATA([sys-file.sack], [dnl
1368 dnl File header.
1369 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1370 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1371
1372 dnl Numeric variable.
1373 2; 0; 0; 0; 0x050800 *2; s8 >>"TO"<<;
1374
1375 dnl End of dictionary.
1376 999; 0;
1377 ])
1378 for variant in \
1379         "be 57e6ad709668bbf538e2efee4af49916" \
1380         "le 523f14b611efa380bbadf7a16ea43fed"
1381 do
1382   set $variant
1383   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1384 ])
1385   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1386 ])
1387   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1388    [error: `sys-file.sav' near offset 0xd0: Invalid variable name `TO'.
1389
1390 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1391 ])
1392 done
1393 AT_CLEANUP
1394
1395 AT_SETUP([variable width must be between 0 and 255])
1396 AT_KEYWORDS([sack synthetic system file negative])
1397 AT_DATA([sys-file.sack], [dnl
1398 dnl File header.
1399 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1400 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1401
1402 dnl String variable with invalid width 256.
1403 2; 256; 0; 0; 0x050800 *2; s8 "VAR1";
1404
1405 dnl End of dictionary.
1406 999; 0;
1407 ])
1408 for variant in \
1409         "be 170bb18589ba264a0ed2d57b41fe77e1" \
1410         "le 9528b4b5936ef5630bbd3bdd60a123c3"
1411 do
1412   set $variant
1413   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1414 ])
1415   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1416 ])
1417   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1418    [error: `sys-file.sav' near offset 0xd0: Bad width 256 for variable VAR1.
1419
1420 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1421 ])
1422 done
1423 AT_CLEANUP
1424
1425 AT_SETUP([duplicate variable name])
1426 AT_KEYWORDS([sack synthetic system file negative])
1427 AT_DATA([sys-file.sack], [dnl
1428 dnl File header.
1429 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1430 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1431
1432 dnl Numeric variables.
1433 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1434 2; 0; 0; 0; 0x050800 *2; s8 "VAR1";
1435
1436 dnl End of dictionary.
1437 999; 0;
1438 ])
1439 for variant in \
1440         "be d8f5fd768ab1d641f9330a4840c71343" \
1441         "le f01e123d384cdaa7c2f7fc4791325ebf"
1442 do
1443   set $variant
1444   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1445 ])
1446   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1447 ])
1448   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1449    [error: `sys-file.sav' near offset 0xf0: Duplicate variable name `VAR1'.
1450
1451 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1452 ])
1453 done
1454 AT_CLEANUP
1455
1456 AT_SETUP([variable label indicator not 0 or 1])
1457 AT_KEYWORDS([sack synthetic system file negative])
1458 AT_DATA([sys-file.sack], [dnl
1459 dnl File header.
1460 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1461 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1462
1463 dnl Numeric variable.
1464 2; 0; >>2<<; 0; 0x050800 *2; s8 "VAR1";
1465
1466 dnl End of dictionary.
1467 999; 0;
1468 ])
1469 for variant in \
1470         "be 3c5ff8d8f146457a385ca92d3d23ca8a" \
1471         "le 37e9f956d321ae57b0bf7fe2384e892b"
1472 do
1473   set $variant
1474   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1475 ])
1476   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1477 ])
1478   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1479    [error: `sys-file.sav' near offset 0xd0: Variable label indicator field is not 0 or 1.
1480
1481 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1482 ])
1483 done
1484 AT_CLEANUP
1485
1486 AT_SETUP([invalid numeric missing value indicator])
1487 AT_KEYWORDS([sack synthetic system file negative])
1488 AT_DATA([sys-file.sack], [dnl
1489 dnl File header.
1490 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1491 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1492
1493 dnl Numeric variable.
1494 2; 0; 0; >>-1<<; 0x050800 *2; s8 "VAR1";
1495
1496 dnl End of dictionary.
1497 999; 0;
1498 ])
1499 for variant in \
1500         "be d1d0d4aedf9f053452c4b1e658ade5e2" \
1501         "le df697575499fe12921185a3d23a5d61d"
1502 do
1503   set $variant
1504   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1505 ])
1506   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1507 ])
1508   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1509    ["error: `sys-file.sav' near offset 0xd0: Numeric missing value indicator field is not -3, -2, 0, 1, 2, or 3."
1510
1511 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1512 ])
1513 done
1514 AT_CLEANUP
1515
1516 AT_SETUP([invalid string missing value indicator])
1517 AT_KEYWORDS([sack synthetic system file negative])
1518 AT_DATA([sys-file.sack], [dnl
1519 dnl File header.
1520 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1521 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1522
1523 dnl String variable.
1524 2; 8; 0; >>4<<; 0x010800 *2; s8 "VAR1";
1525
1526 dnl End of dictionary.
1527 999; 0;
1528 ])
1529 for variant in \
1530         "be f833033be7b102fae19159989f62faa6" \
1531         "le 9704ba828bb7a36ef0262838f6b7936b"
1532 do
1533   set $variant
1534   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1535 ])
1536   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1537 ])
1538   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1539    ["error: `sys-file.sav' near offset 0xd0: String missing value indicator field is not 0, 1, 2, or 3."
1540
1541 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1542 ])
1543 done
1544 AT_CLEANUP
1545
1546 AT_SETUP([missing string continuation record])
1547 AT_KEYWORDS([sack synthetic system file negative])
1548 AT_DATA([sys-file.sack], [dnl
1549 dnl File header.
1550 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1551 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1552
1553 dnl String variable.
1554 2; 10; 0; 0; 0x010a00 *2; s8 "VAR1";
1555 >>2; 0; 0; 0; 0x050800 *2; s8 "VAR2";<<
1556
1557 dnl End of dictionary.
1558 999; 0;
1559 ])
1560 for variant in \
1561         "be c8f9ad2b2acd2918055e2b78c1e0b4b8" \
1562         "le 1afab4d6aee90a6fe8d2dbf229e06409"
1563 do
1564   set $variant
1565   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1566 ])
1567   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1568 ])
1569   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1570    [error: `sys-file.sav' near offset 0xd8: Missing string continuation record.
1571
1572 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1573 ])
1574 done
1575 AT_CLEANUP
1576
1577 AT_SETUP([unknown variable format])
1578 AT_KEYWORDS([sack synthetic system file negative])
1579 AT_DATA([sys-file.sack], [dnl
1580 dnl File header.
1581 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1582 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1583
1584 dnl Numeric variable.
1585 2; 0; 0; 0; >>0xff0800<< *2; s8 "VAR1";
1586
1587 dnl End of dictionary.
1588 999; 0;
1589 ])
1590 for variant in \
1591         "be fcf94b3ff11b7e2ff50c226b609cff1e" \
1592         "le 88fc97cc80d5a170e53a7cc89e204b0d"
1593 do
1594   set $variant
1595   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1596 ])
1597   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1598 ])
1599   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1600    [error: `sys-file.sav' near offset 0xd0: Unknown variable format 255.
1601
1602 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1603 ])
1604 done
1605 AT_CLEANUP
1606
1607 AT_SETUP([invalid numeric variable format])
1608 AT_KEYWORDS([sack synthetic system file negative])
1609 AT_DATA([sys-file.sack], [dnl
1610 dnl File header.
1611 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1612 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1613
1614 dnl Numeric variable, string formats.
1615 2; 0; 0; 0; >>0x010800<<; >>0x021000<<; s8 "VAR1";
1616
1617 dnl String variable, numeric formats.
1618 2; 4; 0; 0; >>0x050800<<; >>0x110a01<<; s8 "STR1";
1619
1620 dnl String variable, wrong width formats.
1621 2; 4; 0; 0; >>0x010800<<; >>0x020400<<; s8 "STR2";
1622
1623 dnl End of dictionary.
1624 999; 0;
1625 ])
1626 for variant in \
1627         "be 0c36a39ec9118eb4a83f10a9483b5a37" \
1628         "le 1d498d60eeb2c88e0479f113fb3ffe4b"
1629 do
1630   set $variant
1631   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1632 ])
1633   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1634 ])
1635   AT_CHECK([pspp -O format=csv sys-file.sps], [0], 
1636    [warning: `sys-file.sav' near offset 0xd0: Numeric variable VAR1 has invalid print format A8.
1637
1638 warning: `sys-file.sav' near offset 0xd0: Numeric variable VAR1 has invalid write format AHEX16.
1639
1640 warning: `sys-file.sav' near offset 0xf0: String variable STR1 has invalid print format F8.0.
1641
1642 warning: `sys-file.sav' near offset 0xf0: String variable STR1 has invalid write format E10.1.
1643
1644 warning: `sys-file.sav' near offset 0x110: String variable STR2 has invalid print format A8.
1645
1646 warning: `sys-file.sav' near offset 0x110: String variable STR2 has invalid write format AHEX4.
1647 ])
1648 done
1649 AT_CLEANUP
1650
1651 AT_SETUP([weighting variable must be numeric])
1652 AT_KEYWORDS([sack synthetic system file negative])
1653 AT_DATA([sys-file.sack], [dnl
1654 dnl File header.
1655 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1656 2; 2; 1; >>2<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1657
1658 dnl Numeric variable.
1659 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1660
1661 dnl String variable.
1662 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
1663
1664 dnl End of dictionary.
1665 999; 0;
1666 ])
1667 for variant in \
1668         "be 82d30105e46c4896c24f9dcec26c4749" \
1669         "le 32e235119be70050eb78bf4186a5a046"
1670 do
1671   set $variant
1672   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1673 ])
1674   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1675 ])
1676   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1677    [error: `sys-file.sav' near offset 0xf4: Weighting variable must be numeric (not string variable `STR1').
1678
1679 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1680 ])
1681 done
1682 AT_CLEANUP
1683
1684 AT_SETUP([bad weighting variable index])
1685 AT_KEYWORDS([sack synthetic system file negative])
1686 AT_DATA([sys-file.sack], [dnl
1687 dnl File header.
1688 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1689 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1690
1691 dnl Numeric variable.
1692 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1693
1694 dnl String variable.
1695 2; 4; 0; 0; 0x010400 *2; s8 "STR1";
1696
1697 dnl End of dictionary.
1698 999; 0;
1699 ])
1700 for variant in \
1701         "be cd9af924ff20bc75834aa2c696254c97" \
1702         "le cbe0f2f514f5e95f27644d0b4314bc78"
1703 do
1704   set $variant
1705   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1706 ])
1707   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1708 ])
1709   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1710    [error: `sys-file.sav' near offset 0xf4: Variable index 3 not in valid range 1...2.
1711
1712 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1713 ])
1714 done
1715 AT_CLEANUP
1716
1717 AT_SETUP([variable index is long string contination])
1718 AT_KEYWORDS([sack synthetic system file negative])
1719 AT_DATA([sys-file.sack], [dnl
1720 dnl File header.
1721 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1722 2; 2; 1; >>3<<; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1723
1724 dnl Numeric variable.
1725 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1726
1727 dnl Long string variable.
1728 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
1729 (2; -1; 0; 0; 0; 0; s8 "");
1730
1731 dnl End of dictionary.
1732 999; 0;
1733 ])
1734 for variant in \
1735         "be 0c395354df56ea5ff374aafcc535d633" \
1736         "le d977f684ea9d4648ed40f8c6dddde9f7"
1737 do
1738   set $variant
1739   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1740 ])
1741   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1742 ])
1743   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
1744    [error: `sys-file.sav' near offset 0x114: Variable index 3 refers to long string continuation.
1745
1746 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1747 ])
1748 done
1749 AT_CLEANUP
1750
1751 AT_SETUP([multiple documents records])
1752 AT_KEYWORDS([sack synthetic system file negative])
1753 AT_DATA([sys-file.sack], [dnl
1754 dnl File header.
1755 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1756 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1757
1758 dnl Numeric variable, no label or missing values.
1759 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1760
1761 dnl Two document records.
1762 (6; 1; s80 "One line of documents") >>* 2<<;
1763
1764 dnl Dictionary termination record.
1765 999; 0;
1766
1767 dnl Data.
1768 1.0;
1769 ])
1770 for variant in \
1771         "be 18aa3348a216ed494efe28285b348fa8" \
1772         "le 19b21522bcef1dcc60af328f923f307e"
1773 do
1774   set $variant
1775   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1776 ])
1777   AT_DATA([sys-file.sps], [dnl
1778 GET FILE='sys-file.sav'.
1779 ])
1780   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1781 error: `sys-file.sav' near offset 0x12c: Multiple type 6 (document) records.
1782
1783 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1784 ])
1785 done
1786 AT_CLEANUP
1787
1788
1789 AT_SETUP([empty document record])
1790 AT_KEYWORDS([sack synthetic system file negative])
1791 AT_DATA([sys-file.sack], [dnl
1792 dnl File header.
1793 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1794 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1795
1796 dnl Numeric variable, no label or missing values.
1797 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1798
1799 dnl Empty document record.
1800 6; >>0<<;
1801
1802 dnl Dictionary termination record.
1803 999; 0;
1804
1805 dnl Data.
1806 1.0;
1807 ])
1808 for variant in \
1809         "be d8ef29c1b97f9ed226cbd938c9c49b6e" \
1810         "le f6a560c5b62e2c472429d85294f36e61"
1811 do
1812   set $variant
1813   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1814 ])
1815   AT_DATA([sys-file.sps], [dnl
1816 GET FILE='sys-file.sav'.
1817 ])
1818   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1819 error: `sys-file.sav' near offset 0xd8: Number of document lines (0) must be greater than 0.
1820
1821 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1822 ])
1823 done
1824 AT_CLEANUP
1825
1826 AT_SETUP([document contains null byte])
1827 AT_KEYWORDS([sack synthetic system file negative])
1828 AT_DATA([sys-file.sack], [dnl
1829 dnl File header.
1830 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1831 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1832
1833 dnl Numeric variable, no label or missing values.
1834 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1835
1836 dnl Document record.
1837 6; 1; >>i8 0<<; s79 "One line of documents";
1838
1839 dnl Dictionary termination record.
1840 999; 0;
1841
1842 dnl Data.
1843 1.0;
1844 ])
1845 for variant in \
1846         "be 24b5f451ae2559785c1a38358c511e39" \
1847         "le b7e9802506307c28343293144bd6d4f4"
1848 do
1849   set $variant
1850   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1851 ])
1852   AT_DATA([sys-file.sps], [dnl
1853 GET FILE='sys-file.sav'.
1854 ])
1855   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1856 error: `sys-file.sav' near offset 0x128: Document line contains null byte.
1857
1858 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1859 ])
1860 done
1861 AT_CLEANUP
1862
1863 AT_SETUP([extension record too large])
1864 AT_KEYWORDS([sack synthetic system file negative])
1865 AT_DATA([sys-file.sack], [dnl
1866 dnl File header.
1867 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1868 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1869
1870 dnl Numeric variable, no label or missing values.
1871 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1872
1873 dnl Too-large extension record.
1874 7; 3; >>0xfffff000 * 2<<;
1875 ])
1876 for variant in \
1877         "be 5a6679dc41ac349b0b73fc430937c05c" \
1878         "le d4769c7f650cfbf160e0386d0d33be04"
1879 do
1880   set $variant
1881   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1882 ])
1883   AT_DATA([sys-file.sps], [dnl
1884 GET FILE='sys-file.sav'.
1885 ])
1886   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1887 error: `sys-file.sav' near offset 0xe0: Record type 7 subtype 3 too large.
1888
1889 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1890 ])
1891 done
1892 AT_CLEANUP
1893
1894 AT_SETUP([unknown extension record])
1895 AT_KEYWORDS([sack synthetic system file negative])
1896 AT_DATA([sys-file.sack], [dnl
1897 dnl File header.
1898 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1899 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1900
1901 dnl Numeric variable, no label or missing values.
1902 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1903
1904 dnl Unknown extension record type.
1905 7; 30; 1; 1; i8 0;
1906
1907 dnl End of dictionary.
1908 999; 0;
1909 ])
1910 for variant in \
1911         "be ac8395e27677408189bcb8655e56cc0e" \
1912         "le e308bfcd51f1e3c28d7379c29271f9d6"
1913 do
1914   set $variant
1915   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1916 ])
1917   AT_DATA([sys-file.sps], [dnl
1918 GET FILE='sys-file.sav'.
1919 ])
1920   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
1921 "warning: `sys-file.sav' near offset 0xe0: Unrecognized record type 7, subtype 30.  Please send a copy of this file, and the syntax which created it to bug-gnu-pspp@gnu.org."
1922 ])
1923 done
1924 AT_CLEANUP
1925
1926 AT_SETUP([bad machine integer info size])
1927 AT_KEYWORDS([sack synthetic system file negative])
1928 AT_DATA([sys-file.sack], [dnl
1929 dnl File header.
1930 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1931 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1932
1933 dnl Numeric variable, no label or missing values.
1934 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1935
1936 dnl Machine integer info record.
1937 7; 3; 4; >>9<<; 1; 2; 3; -1; 1; 1; ENDIAN; 1252;
1938 ])
1939 for variant in \
1940         "be 21ec84826886b0a266d1360f8279d769" \
1941         "le 15dcba7b2b89b7d8a21ebcc872f515af"
1942 do
1943   set $variant
1944   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1945 ])
1946   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1947 ])
1948   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1949 "error: `sys-file.sav' near offset 0x100: Bad size (4) or count (9) field on record type 7, subtype 3."
1950
1951 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1952 ])
1953 done
1954 AT_CLEANUP
1955
1956 AT_SETUP([bad machine integer info float format])
1957 AT_KEYWORDS([sack synthetic system file negative])
1958 AT_DATA([sys-file.sack], [dnl
1959 dnl File header.
1960 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1961 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1962
1963 dnl Numeric variable, no label or missing values.
1964 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1965
1966 dnl Machine integer info record.
1967 7; 3; 4; 8; 1; 2; 3; -1; >>2<<; 1; ENDIAN; 1252;
1968 ])
1969 for variant in \
1970         "be d510ed28278649eee997fb6881a4c04f" \
1971         "le fbf1eca561a4e243b7ae844ed1677035"
1972 do
1973   set $variant
1974   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
1975 ])
1976   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
1977 ])
1978   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
1979 error: `sys-file.sav' near offset 0x100: Floating-point representation indicated by system file (2) differs from expected (1).
1980
1981 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
1982 ])
1983 done
1984 AT_CLEANUP
1985
1986 AT_SETUP([bad machine integer info endianness])
1987 AT_KEYWORDS([sack synthetic system file negative])
1988 AT_DATA([sys-file.sack], [dnl
1989 dnl File header.
1990 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
1991 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
1992
1993 dnl Numeric variable, no label or missing values.
1994 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
1995
1996 dnl Machine integer info record.
1997 7; 3; 4; 8; 1; 2; 3; -1; 1; 1; >>3<<; 1252;
1998
1999 dnl End of dictionary.
2000 999; 0;
2001 ])
2002 for variant in \
2003         "be 855123d16d5e1560b91d60753dad79ad 1" \
2004         "le d6626b4fa2e46a91f26c2fc609b2f1e0 2"
2005 do
2006   set $variant
2007   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2008 ])
2009   AT_DATA([sys-file.sps], [dnl
2010 GET FILE='sys-file.sav'.
2011 DISPLAY DICTIONARY.
2012 ])
2013   AT_CHECK_UNQUOTED([pspp -O format=csv sys-file.sps], [0], [dnl
2014 warning: \`sys-file.sav' near offset 0x100: Integer format indicated by system file (3) differs from expected ($[3]).
2015
2016 Variable,Description,,Position
2017 num1,Format: F8.0,,1
2018 ,Measure: Scale,,
2019 ,Display Alignment: Right,,
2020 ,Display Width: 8,,
2021 ])
2022 done
2023 AT_CLEANUP
2024
2025
2026 AT_SETUP([bad machine floating-point info size])
2027 AT_KEYWORDS([sack synthetic system file negative])
2028 AT_DATA([sys-file.sack], [dnl
2029 dnl File header.
2030 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2031 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2032
2033 dnl Numeric variable, no label or missing values.
2034 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2035
2036 dnl Machine floating-point info record.
2037 7; 4; 8; >>4<<; SYSMIS; HIGHEST; LOWEST; 0.0;
2038 ])
2039 for variant in \
2040         "be 29c9a173638fbb8bb1efe1176c4d670f" \
2041         "le 5cb49eb1084e5b9cd573a54705ff86a7"
2042 do
2043   set $variant
2044   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2045 ])
2046   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2047 ])
2048   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2049 error: `sys-file.sav' near offset 0xf8: Bad size (8) or count (4) on extension 4.
2050
2051 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
2052 ])
2053 done
2054 AT_CLEANUP
2055
2056 AT_SETUP([wrong special floating point values])
2057 AT_KEYWORDS([sack synthetic system file negative])
2058 AT_DATA([sys-file.sack], [dnl
2059 dnl File header.
2060 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2061 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2062
2063 dnl Numeric variable, no label or missing values.
2064 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2065
2066 dnl Machine floating-point info record.
2067 7; 4; 8; 3; >>0.0<<; >>1.0<<; >>2.0<<;
2068
2069 dnl End of dictionary.
2070 999; 0;
2071 ])
2072 for variant in \
2073         "be 1e7452d9bb0a2397bf6084a25437514e" \
2074         "le f59f9a83f723cde1611869ff6d91d325"
2075 do
2076   set $variant
2077   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2078 ])
2079   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2080 ])
2081   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2082 warning: `sys-file.sav' near offset 0xf8: File specifies unexpected value 0 as SYSMIS.
2083
2084 warning: `sys-file.sav' near offset 0xf8: File specifies unexpected value 1 as HIGHEST.
2085
2086 warning: `sys-file.sav' near offset 0xf8: File specifies unexpected value 2 as LOWEST.
2087 ])
2088 done
2089 AT_CLEANUP
2090
2091 AT_SETUP([bad mrsets name])
2092 AT_KEYWORDS([sack synthetic system file negative multiple response])
2093 AT_DATA([sys-file.sack], [dnl
2094 dnl File header.
2095 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2096 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2097
2098 dnl Numeric variable, no label or missing values.
2099 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2100
2101 dnl Multiple response sets.
2102 7; 7; 1; COUNT("a=C");
2103 7; 19; 1; COUNT("xyz=D");
2104
2105 999; 0;
2106 ])
2107 for variant in \
2108         "be 15a9bf44d0cd6186a60629b77079c5a5" \
2109         "le 161c99aca5e7a3684df096137e72ce5b"
2110 do
2111   set $variant
2112   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2113 ])
2114   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2115 ])
2116   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2117 warning: `sys-file.sav' near offset 0xe3: `a' does not begin with `$' at offset 2 in MRSETS record.
2118
2119 warning: `sys-file.sav' near offset 0xf8: `xyz' does not begin with `$' at offset 4 in MRSETS record.
2120 ])
2121 done
2122 AT_CLEANUP
2123
2124 AT_SETUP([missing space after C in mrsets])
2125 AT_KEYWORDS([sack synthetic system file negative multiple response])
2126 AT_DATA([sys-file.sack], [dnl
2127 dnl File header.
2128 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2129 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2130
2131 dnl Numeric variable, no label or missing values.
2132 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2133
2134 dnl Multiple response sets.
2135 7; 7; 1; COUNT("$a=Cx");
2136
2137 999; 0;
2138 ])
2139 for variant in \
2140         "be c5e5656ba3d74c3a967850f29ad89970" \
2141         "le 29f110509c3d6893a7d21ae2d66aad9d"
2142 do
2143   set $variant
2144   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2145 ])
2146   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2147 ])
2148   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2149 warning: `sys-file.sav' near offset 0xe5: Missing space following `C' at offset 4 in MRSETS record.
2150 ])
2151 done
2152 AT_CLEANUP
2153
2154 AT_SETUP([missing space after E in mrsets])
2155 AT_KEYWORDS([sack synthetic system file negative multiple response])
2156 AT_DATA([sys-file.sack], [dnl
2157 dnl File header.
2158 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2159 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2160
2161 dnl Numeric variable, no label or missing values.
2162 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2163
2164 dnl Multiple response sets.
2165 7; 7; 1; COUNT("$a=Ex");
2166
2167 999; 0;
2168 ])
2169 for variant in \
2170         "be a9e1dc63e2524882a5e3d2949a2da9d4" \
2171         "le ac709ca1928f65f47a8c8efdd9454b50"
2172 do
2173   set $variant
2174   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2175 ])
2176   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2177 ])
2178   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2179 warning: `sys-file.sav' near offset 0xe5: Missing space following `E' at offset 4 in MRSETS record.
2180 ])
2181 done
2182 AT_CLEANUP
2183
2184 AT_SETUP([unexpected label source in mrsets])
2185 AT_KEYWORDS([sack synthetic system file negative multiple response])
2186 AT_DATA([sys-file.sack], [dnl
2187 dnl File header.
2188 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2189 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2190
2191 dnl Numeric variable, no label or missing values.
2192 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2193
2194 dnl Multiple response sets.
2195 7; 7; 1; COUNT("$a=E 2");
2196
2197 999; 0;
2198 ])
2199 for variant in \
2200         "be 8c710e85a0a1609d0d03dec80aaf5f94" \
2201         "le 4682440b82f22d4bd2ac56afb7fa3152"
2202 do
2203   set $variant
2204   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2205 ])
2206   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2207 ])
2208   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2209 warning: `sys-file.sav' near offset 0xe6: Unexpected label source value `2' following `E' at offset 7 in MRSETS record.
2210
2211 warning: `sys-file.sav' near offset 0xe6: Expecting digit at offset 7 in MRSETS record.
2212 ])
2213 done
2214 AT_CLEANUP
2215
2216 AT_SETUP([bad type character in mrsets])
2217 AT_KEYWORDS([sack synthetic system file negative multiple response])
2218 AT_DATA([sys-file.sack], [dnl
2219 dnl File header.
2220 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2221 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2222
2223 dnl Numeric variable, no label or missing values.
2224 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2225
2226 dnl Multiple response sets.
2227 7; 7; 1; COUNT("$a=");
2228
2229 999; 0;
2230 ])
2231 for variant in \
2232         "be fc5e5200d8f56b9a5a713e4a95313a3b" \
2233         "le 578a61e8a06b20216612f566c2050879"
2234 do
2235   set $variant
2236   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2237 ])
2238   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2239 ])
2240   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2241 "warning: `sys-file.sav' near offset 0xe3: Missing `C', `D', or `E' at offset 3 in MRSETS record."
2242 ])
2243 done
2244 AT_CLEANUP
2245
2246 AT_SETUP([bad counted string length in mrsets])
2247 AT_KEYWORDS([sack synthetic system file negative multiple response])
2248 AT_DATA([sys-file.sack], [dnl
2249 dnl File header.
2250 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2251 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2252
2253 dnl Numeric variable, no label or missing values.
2254 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2255
2256 dnl Multiple response sets.
2257 7; 7; 1; COUNT("$a=Dx");
2258
2259 999; 0;
2260 ])
2261 for variant in \
2262         "be 23d0e2f65c7c5f93bbedcc0f2b260c69" \
2263         "le c3860c1d80e08842264948056e72c0db"
2264 do
2265   set $variant
2266   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2267 ])
2268   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2269 ])
2270   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2271 warning: `sys-file.sav' near offset 0xe5: Expecting digit at offset 4 in MRSETS record.
2272 ])
2273 done
2274 AT_CLEANUP
2275
2276 AT_SETUP([missing space in counted string in mrsets])
2277 AT_KEYWORDS([sack synthetic system file negative multiple response])
2278 AT_DATA([sys-file.sack], [dnl
2279 dnl File header.
2280 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2281 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2282
2283 dnl Numeric variable, no label or missing values.
2284 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2285
2286 dnl Multiple response sets.
2287 7; 7; 1; COUNT("$a=D1x");
2288
2289 999; 0;
2290 ])
2291 for variant in \
2292         "be c9ce001723763e0698878b7e43a887e8" \
2293         "le e258a1e4491d5a1d1e7d2272ef631a22"
2294 do
2295   set $variant
2296   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2297 ])
2298   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2299 ])
2300   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2301 warning: `sys-file.sav' near offset 0xe6: Expecting space at offset 5 in MRSETS record.
2302 ])
2303 done
2304 AT_CLEANUP
2305
2306 AT_SETUP([counted string too long in mrsets])
2307 AT_KEYWORDS([sack synthetic system file negative multiple response])
2308 AT_DATA([sys-file.sack], [dnl
2309 dnl File header.
2310 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2311 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2312
2313 dnl Numeric variable, no label or missing values.
2314 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2315
2316 dnl Multiple response sets.
2317 7; 7; 1; COUNT("$a=D4 abc");
2318
2319 999; 0;
2320 ])
2321 for variant in \
2322         "be 196d1266fa0e8e315769dcbe3130e3df" \
2323         "le 23df1ba7b77a26da8ce1c2cfbcaadce0"
2324 do
2325   set $variant
2326   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2327 ])
2328   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2329 ])
2330   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2331 warning: `sys-file.sav' near offset 0xe9: 4-byte string starting at offset 6 exceeds record length 9.
2332 ])
2333 done
2334 AT_CLEANUP
2335
2336 AT_SETUP([missing space after counted string in mrsets])
2337 AT_KEYWORDS([sack synthetic system file negative multiple response])
2338 AT_DATA([sys-file.sack], [dnl
2339 dnl File header.
2340 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2341 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2342
2343 dnl Numeric variable, no label or missing values.
2344 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2345
2346 dnl Multiple response sets.
2347 7; 7; 1; COUNT("$a=D3 abcx");
2348
2349 999; 0;
2350 ])
2351 for variant in \
2352         "be 86314bb0bbdfad48c10af8b8d8106d6e" \
2353         "le 2b8d05ff501ca78e51f7110ce88a2364"
2354 do
2355   set $variant
2356   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2357 ])
2358   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2359 ])
2360   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2361 warning: `sys-file.sav' near offset 0xea: Expecting space at offset 9 following 3-byte string.
2362 ])
2363 done
2364 AT_CLEANUP
2365
2366 AT_SETUP([missing newline after variable name in mrsets])
2367 AT_KEYWORDS([sack synthetic system file negative multiple response])
2368 AT_DATA([sys-file.sack], [dnl
2369 dnl File header.
2370 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2371 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2372
2373 dnl Numeric variable, no label or missing values.
2374 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2375
2376 dnl Multiple response sets.
2377 7; 7; 1; COUNT("$a=C 0  NUM1");
2378
2379 999; 0;
2380 ])
2381 for variant in \
2382         "be cea939cf3e6a5f88cb45e8fa871c5e13" \
2383         "le 52135afec082f50f37eafacadbb2cd65"
2384 do
2385   set $variant
2386   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2387 ])
2388   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2389 ])
2390   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2391 warning: `sys-file.sav' near offset 0xec: Missing new-line parsing variable names at offset 14 in MRSETS record.
2392
2393 warning: `sys-file.sav' near offset 0xec: MRSET $a has only 1 variables.
2394 ])
2395 done
2396 AT_CLEANUP
2397
2398 AT_SETUP([duplicate variable name in mrsets])
2399 AT_KEYWORDS([sack synthetic system file negative multiple response])
2400 AT_DATA([sys-file.sack], [dnl
2401 dnl File header.
2402 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2403 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2404
2405 dnl Numeric variable, no label or missing values.
2406 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2407
2408 dnl Multiple response sets.
2409 7; 7; 1; COUNT("$a=C 0  NUM1 NUM1"; i8 10);
2410
2411 999; 0;
2412 ])
2413 for variant in \
2414         "be 4b1b5fa2dc22cf0afdd35422290b0a29" \
2415         "le e4304b57976440a036f25f8dd8ac1404"
2416 do
2417   set $variant
2418   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2419 ])
2420   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2421 ])
2422   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2423 warning: `sys-file.sav' near offset 0xf2: Duplicate variable name NUM1 at offset 18 in MRSETS record.
2424
2425 warning: `sys-file.sav' near offset 0xf2: MRSET $a has only 1 variables.
2426 ])
2427 done
2428 AT_CLEANUP
2429
2430 AT_SETUP([mixed variable types in mrsets])
2431 AT_KEYWORDS([sack synthetic system file negative multiple response])
2432 AT_DATA([sys-file.sack], [dnl
2433 dnl File header.
2434 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2435 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2436
2437 dnl Variables.
2438 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2439 2; 8; 0; 0; 0x010800 *2; s8 "STR1";
2440
2441 dnl Multiple response sets.
2442 7; 7; 1; COUNT("$a=C 0  NUM1 STR1"; i8 10);
2443
2444 999; 0;
2445 ])
2446 for variant in \
2447         "be 0f130e967e4097823f85b8711eb20727" \
2448         "le 4dc987b4303fd115f1cae9be3963acc9"
2449 do
2450   set $variant
2451   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2452 ])
2453   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2454 ])
2455   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2456 warning: `sys-file.sav' near offset 0x112: MRSET $a contains both string and numeric variables.
2457
2458 warning: `sys-file.sav' near offset 0x112: MRSET $a has only 1 variables.
2459 ])
2460 done
2461 AT_CLEANUP
2462
2463 AT_SETUP([missing newline after variable name in mrsets])
2464 AT_KEYWORDS([sack synthetic system file negative multiple response])
2465 AT_DATA([sys-file.sack], [dnl
2466 dnl File header.
2467 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2468 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2469
2470 dnl Numeric variable, no label or missing values.
2471 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2472
2473 dnl Multiple response sets.
2474 7; 7; 1; COUNT("$a=C 0  NUM1"; i8 10);
2475
2476 999; 0;
2477 ])
2478 for variant in \
2479         "be 3a891e0a467afb3d622629c70f329ada" \
2480         "le 432998ec08370510411af4f5207c015e"
2481 do
2482   set $variant
2483   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2484 ])
2485   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2486 ])
2487   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2488 warning: `sys-file.sav' near offset 0xed: MRSET $a has only 1 variables.
2489 ])
2490 done
2491 AT_CLEANUP
2492
2493 AT_SETUP([only one variable in mrset])
2494 AT_KEYWORDS([sack synthetic system file negative multiple response])
2495 AT_DATA([sys-file.sack], [dnl
2496 dnl File header.
2497 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2498 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2499
2500 dnl Numeric variable, no label or missing values.
2501 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2502
2503 dnl Multiple response sets.
2504 7; 7; 1; COUNT("$a=C 0  NUM1"; i8 10);
2505
2506 999; 0;
2507 ])
2508 for variant in \
2509         "be 3a891e0a467afb3d622629c70f329ada" \
2510         "le 432998ec08370510411af4f5207c015e"
2511 do
2512   set $variant
2513   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2514 ])
2515   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2516 ])
2517   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2518 warning: `sys-file.sav' near offset 0xed: MRSET $a has only 1 variables.
2519 ])
2520 done
2521 AT_CLEANUP
2522
2523 AT_SETUP([wrong display parameter size])
2524 AT_KEYWORDS([sack synthetic system file negative])
2525 AT_DATA([sys-file.sack], [dnl
2526 dnl File header.
2527 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2528 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2529
2530 dnl Numeric variable, no label or missing values.
2531 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2532
2533 dnl Display parameters record.
2534 7; 11; >>8<<; 2; 1.0; 1.0;
2535
2536 dnl End of dictionary.
2537 999; 0;
2538 ])
2539 for variant in \
2540         "be 7c0f1ae47ae11e37d435c4abaceca226" \
2541         "le c29d05a1f8f15ed2201f31f8b787aaa0"
2542 do
2543   set $variant
2544   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2545 ])
2546   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2547 ])
2548   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2549 warning: `sys-file.sav' near offset 0xe0: Bad size 8 on extension 11.
2550 ])
2551 done
2552 AT_CLEANUP
2553
2554 AT_SETUP([wrong display parameter count])
2555 AT_KEYWORDS([sack synthetic system file negative])
2556 AT_DATA([sys-file.sack], [dnl
2557 dnl File header.
2558 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2559 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2560
2561 dnl Numeric variable, no label or missing values.
2562 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2563
2564 dnl Display parameters record.
2565 7; 11; 4; >>4<<; 1; 1; 2; 2;
2566
2567 dnl End of dictionary.
2568 999; 0;
2569 ])
2570 for variant in \
2571         "be 372b57e73c69b05047b60bf6c596e2a1" \
2572         "le 2a550d8c5ceae4de7ced77df66e49d0f"
2573 do
2574   set $variant
2575   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2576 ])
2577   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2578 ])
2579   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2580 warning: `sys-file.sav' near offset 0xe0: Extension 11 has bad count 4 (for 1 variables).
2581 ])
2582 done
2583 AT_CLEANUP
2584
2585 AT_SETUP([wrong display measurement level])
2586 AT_KEYWORDS([sack synthetic system file negative])
2587 AT_DATA([sys-file.sack], [dnl
2588 dnl File header.
2589 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2590 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2591
2592 dnl Numeric variable, no label or missing values.
2593 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2594
2595 dnl Display parameters record.
2596 7; 11; 4; 2; >>4<<; 0;
2597
2598 dnl End of dictionary.
2599 999; 0;
2600 ])
2601 for variant in \
2602         "be d43e7616b03743339f37292dec6c2204" \
2603         "le 821533c29a070cefdd8f07f4e1741d2a"
2604 do
2605   set $variant
2606   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2607 ])
2608   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2609 ])
2610   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2611 warning: `sys-file.sav' near offset 0xe8: Invalid variable display parameters for variable 0 (NUM1).  Default parameters substituted.
2612 ])
2613 done
2614 AT_CLEANUP
2615
2616 AT_SETUP([wrong display alignment])
2617 AT_KEYWORDS([sack synthetic system file negative])
2618 AT_DATA([sys-file.sack], [dnl
2619 dnl File header.
2620 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2621 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2622
2623 dnl Numeric variable, no label or missing values.
2624 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2625
2626 dnl Display parameters record.
2627 7; 11; 4; 2; 1; >>-1<<;
2628
2629 dnl End of dictionary.
2630 999; 0;
2631 ])
2632 for variant in \
2633         "be c54bc48b5767e2ec3a9ef31df790cb7c" \
2634         "le a4d8b14af64221abe83adb417d110e10"
2635 do
2636   set $variant
2637   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2638 ])
2639   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
2640 ])
2641   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2642 warning: `sys-file.sav' near offset 0xe8: Invalid variable display parameters for variable 0 (NUM1).  Default parameters substituted.
2643 ])
2644 done
2645 AT_CLEANUP
2646
2647 AT_SETUP([bad variable name in variable/value pair])
2648 AT_KEYWORDS([sack synthetic system file negative])
2649 AT_DATA([sys-file.sack], [dnl
2650 dnl File header.
2651 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2652 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2653
2654 dnl Numeric variables.
2655 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2656
2657 dnl Long variable names.
2658 7; 13; 1; COUNT (>>"xyzzy"<<);
2659
2660 dnl Dictionary termination record.
2661 999; 0;
2662 ])
2663 for variant in \
2664         "be b67b6e3c1900e5a9cc691055008f0447" \
2665         "le 26cc52e601f830f9087a0ea2bd9527df"
2666 do
2667   set $variant
2668   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2669 ])
2670   AT_DATA([sys-file.sps], [dnl
2671 GET FILE='sys-file.sav'.
2672 ])
2673   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2674 warning: `sys-file.sav' near offset 0xe5: Dictionary record refers to unknown variable xyzzy.
2675 ])
2676 done
2677 AT_CLEANUP
2678
2679 AT_SETUP([duplicate long variable name])
2680 AT_KEYWORDS([sack synthetic system file negative])
2681 AT_DATA([sys-file.sack], [dnl
2682 dnl File header.
2683 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2684 2; 4; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2685
2686 dnl Numeric variables.
2687 2; 0; 0; 0; 0x050800 *2; s8 "LONGVARI";
2688 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_A";
2689 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_B";
2690 2; 0; 0; 0; 0x050800 *2; s8 "LONGVA_C";
2691
2692 dnl Long variable names.
2693 7; 13; 1; COUNT (
2694 "LONGVARI=_Invalid"; i8 9;
2695 "LONGVA_A=LongVariableName"; i8 9;
2696 "LONGVA_B=LONGVARIABLENAME"; i8 9;
2697 );
2698
2699 dnl Dictionary termination record.
2700 999; 0;
2701 ])
2702 for variant in \
2703         "be 9b4b4daa00084d984efb8f889bcb727c" \
2704         "le c1b1470d5cd615106e9ae507c9948d8e"
2705 do
2706   set $variant
2707   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2708 ])
2709   AT_DATA([sys-file.sps], [dnl
2710 GET FILE='sys-file.sav'.
2711 ])
2712   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2713 warning: `sys-file.sav' near offset 0x186: Long variable mapping from LONGVARI to invalid variable name `_Invalid'.
2714
2715 warning: `sys-file.sav' near offset 0x186: Duplicate long variable name `LONGVARIABLENAME'.
2716 ])
2717 done
2718 AT_CLEANUP
2719
2720 AT_SETUP([bad very long string length])
2721 AT_KEYWORDS([sack synthetic system file negative])
2722 AT_DATA([sys-file.sack], [dnl
2723 dnl File header.
2724 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2725 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2726
2727 dnl Numeric variable.
2728 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2729
2730 dnl Very long string map.
2731 7; 14; 1; COUNT (
2732 "NUM1=00000"; i8 0; i8 9;
2733 "NUM1=00255"; i8 0; i8 9;
2734 "NUM1=00256"; i8 0; i8 9;
2735 );
2736
2737 dnl Dictionary termination record.
2738 999; 0;
2739 ])
2740 for variant in \
2741         "be 1309d8d9fb24bcf08952dce9b0f39a94" \
2742         "le 94a39de88f8034001b3e467c4cc04d0f"
2743 do
2744   set $variant
2745   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2746 ])
2747   AT_DATA([sys-file.sps], [dnl
2748 GET FILE='sys-file.sav'.
2749 ])
2750   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2751 warning: `sys-file.sav' near offset 0x104: NUM1 listed as string of invalid length 00000 in very long string record.
2752
2753 "warning: `sys-file.sav' near offset 0x104: NUM1 listed in very long string record with width 00255, which requires only one segment."
2754
2755 error: `sys-file.sav' near offset 0x104: Very long string NUM1 overflows dictionary.
2756
2757 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
2758 ])
2759 done
2760 AT_CLEANUP
2761
2762 AT_SETUP([bad very long string segment width])
2763 AT_KEYWORDS([sack synthetic system file negative])
2764 AT_DATA([sys-file.sack], [dnl
2765 dnl File header.
2766 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2767 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2768
2769 dnl Variables.
2770 2; 255; 0; 0; 0x01ff00 *2; s8 "STR1";
2771 (2; -1; 0; 0; 0; 0; s8 "") * 31;
2772 2; >>9<<; 0; 0; 0x010900 *2; s8 "STR1_A";
2773 >>2; -1; 0; 0; 0; 0; s8 "";<<
2774
2775 dnl Very long string map.
2776 7; 14; 1; COUNT (
2777 "STR1=00256"; i8 0; i8 9;
2778 );
2779
2780 dnl Dictionary termination record.
2781 999; 0;
2782 ])
2783 for variant in \
2784         "be 1d09a44a46859e6eda28e053dd4b7a8b" \
2785         "le 63b9ac0b3953f3e0d5ee248ebe257794"
2786 do
2787   set $variant
2788   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2789 ])
2790   AT_DATA([sys-file.sps], [dnl
2791 GET FILE='sys-file.sav'.
2792 ])
2793   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2794 error: `sys-file.sav' near offset 0x50c: Very long string with width 256 has segment 1 of width 9 (expected 4).
2795
2796 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
2797 ])
2798 done
2799 AT_CLEANUP
2800
2801 AT_SETUP([too many value labels])
2802 dnl Skip the test if multiplying a small number by INT32_MAX would not
2803 dnl cause an overflow in size_t.
2804 AT_SKIP_IF([test $SIZEOF_SIZE_T -gt 4])
2805 AT_KEYWORDS([sack synthetic system file negative])
2806 AT_DATA([sys-file.sack], [dnl
2807 dnl File header.
2808 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2809 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2810
2811 dnl Numeric variable.
2812 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2813 3; >>0x7fffffff<<;
2814 ])
2815 for variant in \
2816         "be 975b2668dde395ddf619977958b37412" \
2817         "le 0c14aa278cfc2a4b801f91c14321f03b"
2818 do
2819   set $variant
2820   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2821 ])
2822   AT_DATA([sys-file.sps], [dnl
2823 GET FILE='sys-file.sav'.
2824 ])
2825   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2826 error: `sys-file.sav' near offset 0xd8: Invalid number of labels 2147483647.
2827
2828 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
2829 ])
2830 done
2831 AT_CLEANUP
2832
2833 AT_SETUP([missing type 4 record])
2834 AT_KEYWORDS([sack synthetic system file negative])
2835 AT_DATA([sys-file.sack], [dnl
2836 dnl File header.
2837 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2838 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2839
2840 dnl Numeric variable.
2841 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2842
2843 dnl Value label with missing type 4 record.
2844 3; 1; 1.0; i8 3; s7 "one";
2845
2846 dnl End of dictionary.
2847 >>999; 0<<;
2848 ])
2849 for variant in \
2850         "be 5e1286ac92e3f25ff98492bc5019d608" \
2851         "le b33c12f776bbcaa43aa3bfdd4799e0c0"
2852 do
2853   set $variant
2854   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2855 ])
2856   AT_DATA([sys-file.sps], [dnl
2857 GET FILE='sys-file.sav'.
2858 ])
2859   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2860 error: `sys-file.sav' near offset 0xec: Variable index record (type 4) does not immediately follow value label record (type 3) as it should.
2861
2862 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
2863 ])
2864 done
2865 AT_CLEANUP
2866
2867 AT_SETUP([value label with no associated variables])
2868 AT_KEYWORDS([sack synthetic system file negative])
2869 AT_DATA([sys-file.sack], [dnl
2870 dnl File header.
2871 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2872 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2873
2874 dnl Numeric variable.
2875 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2876
2877 dnl Value label with no variables.
2878 3; 1; 1.0; i8 3; s7 "one"; 4; >>0<<;
2879 ])
2880 for variant in \
2881         "be b0dcec30a936cbcad21c4f3d6fe10fcf" \
2882         "le 3b9fdfce5c8c248048232fd6eac018e3"
2883 do
2884   set $variant
2885   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2886 ])
2887   AT_DATA([sys-file.sps], [dnl
2888 GET FILE='sys-file.sav'.
2889 ])
2890   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2891 error: `sys-file.sav' near offset 0xf0: Number of variables associated with a value label (0) is not between 1 and the number of variables (1).
2892
2893 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
2894 ])
2895 done
2896 AT_CLEANUP
2897
2898 AT_SETUP([type 4 record names long string variable])
2899 AT_KEYWORDS([sack synthetic system file negative])
2900 AT_DATA([sys-file.sack], [dnl
2901 dnl File header.
2902 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2903 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2904
2905 dnl Long string variable.
2906 2; 9; 0; 0; 0x010900 *2; s8 "STR1";
2907 2; -1; 0; 0; 0; 0; s8 "";
2908
2909 dnl Value label that names long string variable.
2910 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 1; >>1<<;
2911 ])
2912 for variant in \
2913         "be 14053a4f09de4c7c4c55281534dd66f4" \
2914         "le 8a61cc994c659fd66307d2f0fd64ce20"
2915 do
2916   set $variant
2917   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2918 ])
2919   AT_DATA([sys-file.sps], [dnl
2920 GET FILE='sys-file.sav'.
2921 ])
2922   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2923 error: `sys-file.sav' near offset 0x114: Value labels may not be added to long string variables (e.g. STR1) using records types 3 and 4.
2924
2925 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
2926 ])
2927 done
2928 AT_CLEANUP
2929
2930 AT_SETUP([variables for value label must all be same type])
2931 AT_KEYWORDS([sack synthetic system file negative])
2932 AT_DATA([sys-file.sack], [dnl
2933 dnl File header.
2934 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2935 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2936
2937 dnl Variables.
2938 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
2939 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2940
2941 dnl Value label that names numeric and string variables.
2942 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 2<<;
2943 ])
2944 for variant in \
2945         "be 7577c456726a88f52bbef63a8b47bf1a" \
2946         "le 3ba5c6af9ad0ae5cc88f9f63e726e414"
2947 do
2948   set $variant
2949   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2950 ])
2951   AT_DATA([sys-file.sps], [dnl
2952 GET FILE='sys-file.sav'.
2953 ])
2954   AT_CHECK([pspp -O format=csv sys-file.sps], [1], [dnl
2955 "error: `sys-file.sav' near offset 0x118: Variables associated with value label are not all of identical type.  Variable STR1 is string, but variable NUM1 is numeric."
2956
2957 sys-file.sps:1: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
2958 ])
2959 done
2960 AT_CLEANUP
2961
2962 AT_SETUP([duplicate value labels type])
2963 AT_KEYWORDS([sack synthetic system file negative])
2964 AT_DATA([sys-file.sack], [dnl
2965 dnl File header.
2966 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
2967 2; 2; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
2968
2969 dnl Variables.
2970 2; 6; 0; 0; 0x010600 *2; s8 "STR1";
2971 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
2972
2973 dnl Duplicate value labels.
2974 3; 1; s8 "xyzzy"; i8 3; s7 "one"; 4; 2; >>1; 1<<;
2975 3; 1; 1.0; i8 3; s7 "one"; 4; 2; >>2; 2<<;
2976
2977 dnl End of dictionary.
2978 999; 0;
2979 ])
2980 for variant in \
2981         "be ef0f5b2ebddb5a3bfcda16c93a2508f4" \
2982         "le c00e27abd9a6c06bf29a108d7220435a"
2983 do
2984   set $variant
2985   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
2986 ])
2987   AT_DATA([sys-file.sps], [dnl
2988 GET FILE='sys-file.sav'.
2989 ])
2990   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
2991 warning: `sys-file.sav' near offset 0x118: Duplicate value label for `xyzzy ' on STR1.
2992
2993 warning: `sys-file.sav' near offset 0x140: Duplicate value label for 1 on NUM1.
2994 ])
2995 done
2996 AT_CLEANUP
2997
2998 AT_SETUP([missing attribute value])
2999 AT_KEYWORDS([sack synthetic system file negative])
3000 AT_DATA([sys-file.sack], [dnl
3001 dnl File header.
3002 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3003 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3004
3005 dnl Variables.
3006 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3007
3008 dnl Data file attributes record.
3009 7; 17; 1; COUNT (
3010 "Attr1("
3011 );
3012
3013 dnl Variable attributes record.
3014 7; 18; 1; COUNT (
3015 "FIRSTVAR:";
3016   "fred('23'"; i8 10
3017 );
3018
3019 dnl Dictionary termination record.
3020 999; 0;
3021 ])
3022 for variant in \
3023         "be 0fc71f5e3cdb6b7f2dd73d011d4885c2" \
3024         "le e519b44715400156a2bfe648eb5cff34"
3025 do
3026   set $variant
3027   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3028 ])
3029   AT_DATA([sys-file.sps], [dnl
3030 GET FILE='sys-file.sav'.
3031 ])
3032   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3033 warning: `sys-file.sav' near offset 0xe6: Error parsing attribute value Attr1[[1]].
3034
3035 warning: `sys-file.sav' near offset 0x109: Error parsing attribute value fred[[2]].
3036 ])
3037 done
3038 AT_CLEANUP
3039
3040 AT_SETUP([unquoted attribute value])
3041 AT_KEYWORDS([sack synthetic system file negative])
3042 AT_DATA([sys-file.sack], [dnl
3043 dnl File header.
3044 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3045 2; 1; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3046
3047 dnl Variables.
3048 2; 0; 0; 0; 0x050800 *2; s8 "FIRSTVAR";
3049
3050 dnl Data file attributes record.
3051 7; 17; 1; COUNT (
3052 "Attr1(value"; i8 10;
3053 ")"
3054 );
3055
3056 dnl Variable attributes record.
3057 7; 18; 1; COUNT (
3058 "FIRSTVAR:";
3059   "fred(23"; i8 10; ")"
3060 );
3061
3062 dnl Dictionary termination record.
3063 999; 0;
3064 ])
3065 for variant in \
3066         "be 33dba37c2247e63c04bb74a7b472293d" \
3067         "le 041025a9d9d9e21a7fabd90ba7341934"
3068 do
3069   set $variant
3070   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3071 ])
3072   AT_DATA([sys-file.sps], [dnl
3073 GET FILE='sys-file.sav'.
3074 ])
3075   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3076 warning: `sys-file.sav' near offset 0xed: Attribute value Attr1[[1]] is not quoted: value.
3077
3078 warning: `sys-file.sav' near offset 0x10f: Attribute value fred[[1]] is not quoted: 23.
3079 ])
3080 done
3081 AT_CLEANUP
3082
3083 AT_SETUP([bad variable name in long string value label])
3084 AT_KEYWORDS([sack synthetic system file negative])
3085 AT_DATA([sys-file.sack], [dnl
3086 dnl File header.
3087 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3088 2; 3; 1; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3089
3090 dnl Variables.
3091 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3092 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3093 2; -1; 0; 0; 0; 0; s8 "";
3094
3095 7; 21; 1; COUNT (
3096 dnl No variable named STR9.
3097 COUNT(>>"STR9"<<); 9;
3098 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3099
3100 dnl NUM1 is numeric.
3101 COUNT(>>"NUM1"<<); 0;
3102 1; COUNT("xyz"); COUNT("value label for 1.0");
3103
3104 dnl Wrong width for STR14.
3105 COUNT("STR14"); >>9<<;
3106 1; COUNT("RSTUVWXYZ"); COUNT("value label for `RSTUVWXYZ'");
3107
3108 dnl Wrong width for value.
3109 COUNT("STR14"); 14;
3110 1; COUNT(>>"RSTUVWXYZ"<<); COUNT("value label for `RSTUVWXYZ'");
3111
3112 dnl Duplicate value label.
3113 COUNT("STR14"); 14; 2;
3114 COUNT("abcdefghijklmn"); COUNT("value label for `abcdefghijklmn'");
3115 >>COUNT("abcdefghijklmn"); COUNT("another value label for `abcdefghijklmn'")<<;
3116 );
3117
3118 dnl Dictionary termination record.
3119 999; 0;
3120 ])
3121 for variant in \
3122         "be cf2e883dadb00e2c6404c09ea0a4e388" \
3123         "le 89c340faf0a7e4a8c834f9687684c091"
3124 do
3125   set $variant
3126   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3127 ])
3128   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3129 ])
3130   AT_CHECK([pspp -O format=csv sys-file.sps], [0], [dnl
3131 warning: `sys-file.sav' near offset 0x130: Ignoring long string value record for unknown variable STR9.
3132
3133 warning: `sys-file.sav' near offset 0x16c: Ignoring long string value record for numeric variable NUM1.
3134
3135 warning: `sys-file.sav' near offset 0x19b: Ignoring long string value record for variable STR14 because the record's width (9) does not match the variable's width (14).
3136
3137 "warning: `sys-file.sav' near offset 0x1dc: Ignoring long string value 0 for variable STR14, with width 14, that has bad value width 9."
3138
3139 warning: `sys-file.sav' near offset 0x289: Duplicate value label for `abcdefghijklmn' on STR14.
3140 ])
3141 done
3142 AT_CLEANUP
3143
3144 AT_SETUP([fewer data records than indicated by file header])
3145 AT_KEYWORDS([sack synthetic system file negative])
3146 AT_DATA([sys-file.sack], [dnl
3147 dnl File header.
3148 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3149 2; 2; 0; 0; >>5<<; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3150
3151 dnl Numeric variables.
3152 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3153 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3154
3155 dnl Data.
3156 999; 0;
3157 1.0; 2.0;
3158 3.0; 4.0;
3159 5.0; 6.0;
3160 7.0; 8.0;
3161 dnl Missing record here.
3162 ])
3163 for variant in \
3164         "be 6ee097c3934055d0c4564641636f4b5a" \
3165         "le ae03fe1b888091d6938b5a436d44ac60"
3166 do
3167   set $variant
3168   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3169 ])
3170   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3171 LIST.
3172 ])
3173   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
3174    [error: Error reading case from file `sys-file.sav'.
3175
3176 Table: Data List
3177 num1,num2
3178 1,2
3179 3,4
3180 5,6
3181 7,8
3182
3183 sys-file.sps:2: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
3184 ])
3185 done
3186 AT_CLEANUP
3187
3188 AT_SETUP([partial data record between variables])
3189 AT_KEYWORDS([sack synthetic system file negative])
3190 AT_DATA([sys-file.sack], [dnl
3191 dnl File header.
3192 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3193 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3194
3195 dnl Numeric variables.
3196 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3197 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3198
3199 dnl Data.
3200 999; 0;
3201 1.0; 2.0;
3202 3.0;
3203 ])
3204 for variant in \
3205         "be 4bcc085d7d8f0f09c6a4ba8064ffe61c" \
3206         "le 7387fc5edd2740aff92c30ca688d6d9b"
3207 do
3208   set $variant
3209   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3210 ])
3211   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3212 LIST.
3213 ])
3214   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
3215    [error: `sys-file.sav' near offset 0x110: File ends in partial case.
3216
3217 Table: Data List
3218 num1,num2
3219 1,2
3220
3221 sys-file.sps:2: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
3222 ])
3223 done
3224 AT_CLEANUP
3225
3226 AT_SETUP([partial data record within long string])
3227 AT_KEYWORDS([sack synthetic system file negative])
3228 AT_DATA([sys-file.sack], [dnl
3229 dnl File header.
3230 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3231 2; 2; 0; 0; -1; 100.0; "01 Jan 11"; "20:53:52"; s64 ""; i8 0 *3;
3232
3233 dnl Numeric variables.
3234 2; 14; 0; 0; 0x010e00 *2; s8 "STR14";
3235 2; -1; 0; 0; 0; 0; s8 "";
3236
3237 dnl Data.
3238 999; 0;
3239 s14 "one data item";
3240 s8 "partial";
3241 ])
3242 for variant in \
3243         "be 4a9e84f9e679afb7bb71acd0bb7eab89" \
3244         "le 30752606f14ee2deec2854e8e6de4b3b"
3245 do
3246   set $variant
3247   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3248 ])
3249   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3250 LIST.
3251 ])
3252   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
3253    [error: `sys-file.sav' near offset 0x10e: Unexpected end of file.
3254
3255 Table: Data List
3256 str14
3257 one data item @&t@
3258
3259 sys-file.sps:2: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
3260 ])
3261 done
3262 AT_CLEANUP
3263
3264 AT_SETUP([partial compressed data record])
3265 AT_KEYWORDS([sack synthetic system file positive])
3266 AT_DATA([sys-file.sack], [dnl
3267 dnl File header.
3268 "$FL2"; s60 "$(#) SPSS DATA FILE PSPP synthetic test file";
3269 2; dnl Layout code
3270 6; dnl Nominal case size
3271 1; dnl Compressed
3272 0; dnl Not weighted 
3273 -1; dnl Unspecified number of cases.
3274 100.0; dnl Bias.
3275 "01 Jan 11"; "20:53:52"; s64 "PSPP synthetic test file";
3276 i8 0 *3;
3277
3278 dnl Numeric variables.
3279 2; 0; 0; 0; 0x050800 *2; s8 "NUM1";
3280 2; 0; 0; 0; 0x050800 *2; s8 "NUM2";
3281
3282 dnl String variable.
3283 2; 4; 0; 0; 0x010400 *2; s8 "STR4";
3284 2; 8; 0; 0; 0x010800 *2; s8 "STR8";
3285 2; 15; 0; 0; 0x010f00 *2; s8 "STR15";
3286 2; -1; 0; 0; 0; 0; s8 "";
3287
3288 dnl Dictionary termination record.
3289 999; 0;
3290
3291 dnl Compressed data.
3292 i8 1 100 254 253 254 253; i8 255 251; "abcdefgh"; s8 "0123";
3293 ])
3294 for variant in \
3295         "be ef01b16e2e397d979a3a7d20725ebe6d" \
3296         "le 51f7a61e9bc68992469d16c55d6ecd88"
3297 do
3298   set $variant
3299   AT_CHECK_UNQUOTED([sack --$[1] sys-file.sack > sys-file.sav], [0], [], [$[2]
3300 ])
3301   AT_DATA([sys-file.sps], [GET FILE='sys-file.sav'.
3302 LIST.
3303 ])
3304   AT_CHECK([pspp -O format=csv sys-file.sps], [1], 
3305    [error: `sys-file.sav' near offset 0x190: File ends in partial case.
3306
3307 Table: Data List
3308 num1,num2,str4,str8,str15
3309 -99,0,,abcdefgh,0123   @&t@
3310
3311 sys-file.sps:2: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
3312 ])
3313 done
3314 AT_CLEANUP
3315