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