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