960004e6f351c71f3e823ba531b6ea6394c3418b
[pspp] / tests / language / stats / ctables.at
1 AT_BANNER([CTABLES])
2
3 dnl Features not yet tested:
4 dnl - Summary functions:
5 dnl   * WEIGHT and adjustment weights.
6 dnl   * details of missing value handling in summaries.
7 dnl
8 dnl Not for v1:
9 dnl - Multiple response sets
10 dnl - MRSETS subcommand.
11 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
12 dnl - SIGTEST
13 dnl - COMPARETEST
14 dnl - Summary functions:
15 dnl   * .LCL and .UCL suffixes.
16 dnl   * .SE suffixes.
17 dnl - Summary functions:
18 dnl   * )CILEVEL in summary label specification
19 dnl - CATEGORIES:
20 dnl   * Data-dependent sorting.
21
22 AT_SETUP([CTABLES parsing])
23 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
24 AT_DATA([ctables.sps],
25 [[GET 'nhtsa.sav'.
26 CTABLES
27     /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
28     /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
29     /FORMAT UNITS=CM EMPTY="(-)"
30     /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
31     /VLABELS VARIABLES=qn17 DISPLAY=NAME
32     /VLABELS VARIABLES=qns3a DISPLAY=LABEL
33     /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
34     /VLABELS VARIABLES=qn20 DISPLAY=NONE
35     /MRSETS COUNTDUPLICATES=NO
36     /MRSETS COUNTDUPLICATES=YES
37     /SMISSING VARIABLE
38     /SMISSING LISTWISE
39     /WEIGHT VARIABLE=qns3a
40     /HIDESMALLCOUNTS
41     /HIDESMALLCOUNTS COUNT=10
42     /TABLE qnsa1
43     /SLABELS POSITION=COLUMN VISIBLE=YES
44     /SLABELS VISIBLE=NO POSITION=ROW
45     /SLABELS POSITION=LAYER
46     /CLABELS AUTO
47     /CLABELS ROWLABELS=OPPOSITE
48     /CRITERIA CILEVEL=50
49     /CATEGORIES VARIABLES=qn1 qn17
50                 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
51                 POSITION=BEFORE EMPTY=INCLUDE.
52 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
53 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
54 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
55 ]])
56 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
57          Custom Tables
58 Count
59 ╭───────────────────┬────┬────╮
60 │                   │ RDD│CELL│
61 ├───────────────────┼────┼────┤
62 │Sa1. SAMPLE SOURCE:│5392│1607│
63 ╰───────────────────┴────┴────╯
64
65        Custom Tables
66 RDD
67 ╭───────────────────┬─────╮
68 │                   │Count│
69 ├───────────────────┼─────┤
70 │Sa1. SAMPLE SOURCE:│ 5392│
71 ╰───────────────────┴─────╯
72
73           Custom Tables
74 ╭────────────────────────┬─────╮
75 │                        │Count│
76 ├────────────────────────┼─────┤
77 │Sa1. SAMPLE SOURCE: RDD │ 5392│
78 │                    CELL│ 1607│
79 ╰────────────────────────┴─────╯
80
81           Custom Tables
82 ╭────────────────────────┬─────╮
83 │                        │Count│
84 ├────────────────────────┼─────┤
85 │Sa1. SAMPLE SOURCE: RDD │ 5392│
86 │                    CELL│ 1607│
87 ╰────────────────────────┴─────╯
88 ])
89 AT_CLEANUP
90
91 AT_SETUP([CTABLES parsing - negative])
92 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
93 AT_DATA([ctables.sps],
94 [[GET 'nhtsa.sav'.
95 CTABLES.
96 CTABLES /FORMAT MINCOLWIDTH='foo'.
97 CTABLES /TABLE qn1 [**].
98 CTABLES /TABLE qn1 [NOTAFUNCTION].
99 CTABLES /TABLE (qn1.
100 CTABLES /TABLE **.
101 CTABLES /TABLE NOTAVAR.
102 STRING string(A8).
103 CTABLES /TABLE string[S].
104 CTABLES /TABLE qn1 [PTILE 101].
105 CTABLES /TABLE qn1 [MEAN F0.1].
106 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
107 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
108 CTABLES /TABLE qn1 [MEAN TOTALS].
109 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
110 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
111 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
112 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
113 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
114 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
115 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
116 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
117 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
118 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
119 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
120 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
121 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
122 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
123 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
124 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
125 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
126 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
127 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
128 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
129 CTABLES /PCOMPUTE &k=EXPR([LO **]).
130 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
131 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
132 CTABLES /PCOMPUTE &k=EXPR([1**]).
133 CTABLES /PCOMPUTE &k=EXPR((1x)).
134 CTABLES /PCOMPUTE **k.
135 CTABLES /PCOMPUTE &1.
136 CTABLES /PCOMPUTE &k**.
137 CTABLES /PCOMPUTE &k=**.
138 CTABLES /PCOMPUTE &k=EXPR**.
139 CTABLES /PCOMPUTE &k=EXPR(1x).
140 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
141 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
142 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
143 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
144 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
145 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
146 CTABLES /FORMAT EMPTY=**.
147 CTABLES /FORMAT MISSING=**.
148 CTABLES /FORMAT **.
149 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
150 CTABLES /VLABELS **.
151 CTABLES /VLABELS VARIABLES=NOTAVAR.
152 CTABLES /VLABELS VARIABLES=qn1 **.
153 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
154 CTABLES /MRSETS **.
155 CTABLES /MRSETS COUNTDUPLICATES=**.
156 CTABLES /SMISSING **.
157 CTABLES /WEIGHT **.
158 CTABLES /WEIGHT VARIABLE=NOTAVAR.
159 CTABLES /HIDESMALLCOUNTS COUNT=1.
160 CTABLES /QUUX.
161 CTABLES /HIDESMALLCOUNTS COUNT=2.
162 CTABLES /TABLE qn1**.
163 CTABLES /TABLE qn1 /SLABELS POSITION=**.
164 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
165 CTABLES /TABLE qn1 /SLABELS **.
166 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
167 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
168 CTABLES /TABLE qn1 /CLABELS **.
169 CTABLES /TABLE qn1 /CRITERIA **.
170 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
171 CTABLES /TABLE qn1 /TITLES **.
172 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
173 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
174 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
175 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
176 CTABLES /TABLE qn1 /SIGTEST **.
177 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
178 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
179 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
180 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
181 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
182 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
183 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
184 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
185 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
186 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
187 CTABLES /TABLE qn1 /COMPARETEST **.
188 CTABLES /TABLE qn1 / **.
189 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
190 CTABLES /TABLE qn20 > qnd1.
191 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
192 NUMERIC datetime (DATETIME17.0).
193 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
194 ]])
195 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
196 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
197
198 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
199 negative number for MINCOLWIDTH.
200
201 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
202 identifier.
203
204 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
205 summary function name.
206
207 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
208
209 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
210 identifier.
211
212 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
213
214 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
215 scale variable.
216    10 | CTABLES /TABLE string[S].
217       |                ^~~~~~~~~
218
219 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
220 between 0 and 100 for PTILE.
221
222 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
223 requires a width between 1 and 40.
224
225 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
226 format NEGPAREN requires width 2 or greater.
227
228 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
229 format NEGPAREN requires width greater than decimals.
230
231 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
232 scale variables.
233    15 | CTABLES /TABLE qn1 [MEAN TOTALS].
234       |                     ^~~~
235
236 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
237    15 | CTABLES /TABLE qn1 [MEAN TOTALS].
238       |                ^~~
239
240 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
241
242 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
243 scale variables.
244    16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
245       |                     ^~~~
246
247 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
248    16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
249       |                ^~~
250
251 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
252
253 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
254
255 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
256
257 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
258
259 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
260
261 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
262
263 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
264 identifier.
265
266 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
267    23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
268       |                                               ^~
269
270 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
271 between 0 and 100 for PTILE.
272
273 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
274 `@:}@'.
275
276 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
277 `@{:@'.
278
279 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
280 or EXCLUDE.
281
282 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
283 NO.
284
285 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
286
287 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
288 or AFTER.
289
290 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
291 or EXCLUDE.
292
293 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
294 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
295
296 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
297 LABEL, POSITION, or EMPTY.
298
299 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
300 integer for SUBTOTAL.
301
302 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
303
304 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
305
306 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
307
308 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
309
310 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
311
312 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
313
314 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
315
316 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
317
318 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
319
320 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
321
322 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
323
324 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
325
326 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
327 the previous definition.
328    47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
329       |                               ^~~~~~~~~~~~~~~~~~~
330
331 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
332    47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
333       |          ^~~~~~~~~~~~~~~~~~~
334
335 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
336 `/'.
337
338 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
339 Expecting summary function name.
340
341 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
342 between 0 and 100 for PTILE.
343
344 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
345
346 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
347 NO.
348
349 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
350 FORMAT, or HIDESOURCECATS.
351
352 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
353
354 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
355
356 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
357 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
358
359 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
360 MAXCOLWIDTH.
361
362 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
363 VARIABLES.
364
365 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
366
367 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
368 DISPLAY.
369
370 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
371 DEFAULT, NAME, LABEL, BOTH, or NONE.
372
373 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
374 COUNTDUPLICATES.
375
376 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
377 NO.
378
379 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
380 VARIABLE or LISTWISE.
381
382 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
383 VARIABLE.
384
385 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
386
387 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
388 greater for HIDESMALLCOUNTS COUNT.
389
390 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
391 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
392 HIDESMALLCOUNTS, or TABLE.
393
394 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
395 `/'.
396
397 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
398
399 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
400 ROW, or LAYER.
401
402 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
403 NO.
404
405 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
406 POSITION or VISIBLE.
407
408 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
409 OPPOSITE or LAYER.
410
411 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
412 OPPOSITE or LAYER.
413
414 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
415 ROWLABELS, or COLLABELS.
416
417 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
418 CILEVEL.
419
420 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
421 in @<:@0,100@:}@ for CILEVEL.
422
423 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
424 CAPTION, CORNER, or TITLE.
425
426 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
427 CHISQUARE.
428
429 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
430 in @<:@0,1@:}@ for ALPHA.
431
432 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
433 NO.
434
435 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
436 ALLVISIBLE or SUBTOTALS.
437
438 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
439 ALPHA, INCLUDEMRSETS, or CATEGORIES.
440
441 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
442 MEAN.
443
444 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
445 in (0,1) for ALPHA.
446
447 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
448 for ALPHA.
449
450 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
451 BONFERRONI, BH, or NONE.
452
453 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
454 NO.
455
456 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
457 or TESTEDCATS.
458
459 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
460 ALLVISIBLE or SUBTOTALS.
461
462 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
463 NO.
464
465 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
466 SIMPLE.
467
468 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
469 NO.
470
471 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
472 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
473 SHOWSIG.
474
475 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
476 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
477
478 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
479 specified.
480
481 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
482    97 | CTABLES /TABLE qn20 > qnd1.
483       |                ^~~~~~~~~~~
484
485 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
486    97 | CTABLES /TABLE qn20 > qnd1.
487       |                ^~~~
488
489 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
490    97 | CTABLES /TABLE qn20 > qnd1.
491       |                       ^~~~
492
493 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
494 categorical variables at the innermost nesting level.
495    98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
496       |                ^~~~~~~~~~~~~~~~~~~~
497
498 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
499 summary.
500    98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
501       |                ^~~
502
503 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
504 specification as format DATETIME: Day (123) must be between 1 and 31..
505   100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
506       |                                                    ^~~~~
507 ]])
508 AT_CLEANUP
509
510 AT_SETUP([CTABLES parsing - more negative])
511 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
512 AT_DATA([ctables.sps],
513 [[GET 'nhtsa.sav'.
514 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
515 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
516 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
517
518 STRING string(A8).
519 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
520 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
521
522 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
523
524 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
525 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
526 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
527 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
528
529 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
530 CTABLES /PCOMPUTE &x=EXPR([**]).
531 CTABLES /PCOMPUTE &x=EXPR(**).
532
533 CTABLES /TABLE.
534
535 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT]. 
536 ]])
537 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
538 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
539 category not included in the category list.
540     2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
541 VARIABLES=qn1 [&pc].
542       |
543 ^~~
544
545 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
546     2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
547 VARIABLES=qn1 [&pc].
548       |                            ^~~~~~~~
549
550 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
551 list of categories here.
552     2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
553 VARIABLES=qn1 [&pc].
554       |
555 ^~~~
556
557 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
558 category not included in the category list.
559     3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
560 [&pc].
561       |
562 ^~~
563
564 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
565     3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
566 [&pc].
567       |                            ^~~~~
568
569 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
570 variable's CATEGORIES specification.
571
572 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
573 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
574 subtotals by position, e.g. SUBTOTAL[1].
575     4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
576 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
577       |
578 ^~~~~~~~~~~~~~~~~~~~~~~~
579
580 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
581 position.
582     4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
583 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
584       |                            ^~~~~~~~
585
586 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
587 applied only to string variables, but this subcommand tries to apply it to
588 numeric variable QN1.
589     7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
590       |                                               ^~~~~~~~
591
592 ctables.sps:8.53: error: CTABLES: This category specification may be applied
593 only to numeric variables, but this subcommand tries to apply it to string
594 variable string.
595     8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
596       |                                                     ^
597
598 ctables.sps:10: error: CTABLES: ROWLABELS=OPPOSITE is not allowed with sorting
599 based on a summary function.
600
601 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
602 moved to be categorical, but qnd1 is a scale variable.
603
604 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
605 moved to have the same width, but QN1 has width 0 and string has width 8.
606
607 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
608 moved to have the same value labels, but QN1 and QNSA1 have different value
609 labels.
610
611 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
612 moved to have the same category specifications, but QN105BA and QN105BB have
613 different category specifications.
614
615 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
616 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'.  To disable
617 this warning, insert parentheses.
618    17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
619       |                           ^~~~~~~
620
621 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
622 `/'.
623
624 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
625
626 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
627
628 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
629 variable must be specified.
630
631 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
632
633 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
634 summary.
635    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
636       |                                                  ^~~~~
637
638 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
639 summary.
640    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
641       |                ^~~~~
642
643 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
644 summary.
645    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
646       |                                 ^~~~~
647
648 ctables.sps:23.33-23.37: note: CTABLES: This is a scale variable, so it always
649 has a summary even if the syntax does not explicitly specify one.
650    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
651       |                                 ^~~~~
652 ]])
653 AT_CLEANUP
654
655 AT_SETUP([CTABLES one categorical variable])
656 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
657 AT_DATA([ctables.sps],
658 [[GET 'nhtsa.sav'.
659 CTABLES /TABLE qn1.
660 CTABLES /TABLE BY qn1.
661 CTABLES /TABLE BY BY qn1.
662 ]])
663 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
664                                   Custom Tables
665 ╭────────────────────────────────────────────────────────────────────────┬─────╮
666 │                                                                        │Count│
667 ├────────────────────────────────────────────────────────────────────────┼─────┤
668 │ 1. How often do you usually drive a car or other  Every day            │ 4667│
669 │motor vehicle?                                     Several days a week  │ 1274│
670 │                                                   Once a week or less  │  361│
671 │                                                   Only certain times a │  130│
672 │                                                   year                 │     │
673 │                                                   Never                │  540│
674 ╰────────────────────────────────────────────────────────────────────────┴─────╯
675
676                                   Custom Tables
677 ╭──────────────────────────────────────────────────────────────────────────────╮
678 │        1. How often do you usually drive a car or other motor vehicle?       │
679 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
680 │         │  Several days a  │  Once a week or  │  Only certain times a  │     │
681 │Every day│       week       │       less       │          year          │Never│
682 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
683 │  Count  │       Count      │       Count      │          Count         │Count│
684 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
685 │     4667│              1274│               361│                     130│  540│
686 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
687
688 Custom Tables
689 Every day
690 ╭─────╮
691 │Count│
692 ├─────┤
693 │ 4667│
694 ╰─────╯
695 ])
696 AT_CLEANUP
697
698 AT_SETUP([CTABLES one string variable])
699 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
700 AT_DATA([ctables.sps],
701 [[GET 'nhtsa.sav'.
702 STRING licensed(A8).
703 MISSING VALUES licensed('DontKnow', 'Refused').
704 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
705 CTABLES /TABLE licensed.
706 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
707 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
708 * Notice that the string matching is case-sensitive.
709 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
710 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
711 CTABLES
712     /PCOMPUTE &notyes=EXPR(['No']+['DontKnow']+['Refused'])
713     /PPROPERTIES &notyes LABEL='Not Yes' HIDESOURCECATS=YES
714     /TABLE licensed
715     /CATEGORIES VARIABLES=licensed ['Yes', &notyes, 'No', 'DontKnow', 'Refused'].
716 CTABLES
717     /PCOMPUTE &notyes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
718     /PPROPERTIES &notyes LABEL='Not Yes' HIDESOURCECATS=YES
719     /TABLE licensed
720     /CATEGORIES VARIABLES=licensed ['Yes', &notyes, 'DontKnow' THRU 'No', 'Refused'].
721 ]])
722 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
723     Custom Tables
724 ╭────────────┬─────╮
725 │            │Count│
726 ├────────────┼─────┤
727 │licensed No │  572│
728 │         Yes│ 6379│
729 ╰────────────┴─────╯
730
731           Custom Tables
732 ╭─────────────────┬─────┬───────╮
733 │                 │Count│Valid N│
734 ├─────────────────┼─────┼───────┤
735 │licensed DontKnow│    4│       │
736 │         No      │  572│       │
737 │         Refused │   44│       │
738 │         Yes     │ 6379│       │
739 │         Total   │ 6999│   6951│
740 ╰─────────────────┴─────┴───────╯
741
742      Custom Tables
743 ╭──────────────┬─────╮
744 │              │Count│
745 ├──────────────┼─────┤
746 │licensed Yes  │ 6379│
747 │         No   │  572│
748 │         Total│ 6951│
749 ╰──────────────┴─────╯
750
751      Custom Tables
752 ╭──────────────┬─────╮
753 │              │Count│
754 ├──────────────┼─────┤
755 │licensed Yes  │ 6379│
756 │         no   │    0│
757 │         Total│ 6379│
758 ╰──────────────┴─────╯
759
760       Custom Tables
761 ╭────────────────┬─────╮
762 │                │Count│
763 ├────────────────┼─────┤
764 │licensed No     │  572│
765 │         Refused│   44│
766 │         Yes    │ 6379│
767 │         Total  │ 6995│
768 ╰────────────────┴─────╯
769
770       Custom Tables
771 ╭────────────────┬─────╮
772 │                │Count│
773 ├────────────────┼─────┤
774 │licensed Yes    │ 6379│
775 │         Not Yes│  620│
776 ╰────────────────┴─────╯
777
778       Custom Tables
779 ╭────────────────┬─────╮
780 │                │Count│
781 ├────────────────┼─────┤
782 │licensed Yes    │ 6379│
783 │         Not Yes│  620│
784 ╰────────────────┴─────╯
785 ])
786 AT_CLEANUP
787
788 AT_SETUP([CTABLES one scale variable])
789 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
790 AT_DATA([ctables.sps],
791 [[GET 'nhtsa.sav'.
792 DESCRIPTIVES qnd1.
793 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
794 CTABLES /TABLE BY qnd1.
795 CTABLES /TABLE BY BY qnd1.
796 ]])
797 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
798                        Descriptive Statistics
799 ╭──────────────────────────┬────┬─────┬───────┬───────┬───────────╮
800 │                          │  N │ Mean│Std Dev│Minimum│  Maximum  │
801 ├──────────────────────────┼────┼─────┼───────┼───────┼───────────┤
802 │D1. AGE: What is your age?│6930│48.26│  19.01│     16│86 or older│
803 │Valid N (listwise)        │6999│     │       │       │           │
804 │Missing N (listwise)      │  69│     │       │       │           │
805 ╰──────────────────────────┴────┴─────┴───────┴───────┴───────────╯
806
807                                   Custom Tables
808 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
809 │                      │     │       │       │    │     Std    │       │       │
810 │                      │Count│Valid N│Total N│Mean│  Deviation │Minimum│Maximum│
811 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
812 │D1. AGE: What is your │ 6999│   6930│   6999│  48│          19│     16│     86│
813 │age?                  │     │       │       │    │            │       │       │
814 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
815
816         Custom Tables
817 ╭──────────────────────────╮
818 │D1. AGE: What is your age?│
819 ├──────────────────────────┤
820 │           Mean           │
821 ├──────────────────────────┤
822 │                        48│
823 ╰──────────────────────────╯
824
825 Custom Tables
826 D1. AGE: What is your age?
827 ╭────╮
828 │Mean│
829 ├────┤
830 │  48│
831 ╰────╯
832 ])
833 AT_CLEANUP
834
835 AT_SETUP([CTABLES simple stacking])
836 AT_KEYWORDS([stack stacked])
837 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
838 AT_DATA([ctables.sps],
839 [[GET 'nhtsa.sav'.
840 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
841 ]])
842 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
843                                   Custom Tables
844 ╭───────────────────────────────────────────────────────────────┬──────────────╮
845 │                                                               │ S3a. GENDER: │
846 │                                                               ├──────┬───────┤
847 │                                                               │ Male │ Female│
848 │                                                               ├──────┼───────┤
849 │                                                               │Column│ Column│
850 │                                                               │   %  │   %   │
851 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
852 │105b. How likely is it that drivers who have had   Almost      │   10%│    11%│
853 │too much to drink to drive safely will A. Get      certain     │      │       │
854 │stopped by the police?                             Very likely │   21%│    22%│
855 │                                                   Somewhat    │   38%│    42%│
856 │                                                   likely      │      │       │
857 │                                                   Somewhat    │   21%│    18%│
858 │                                                   unlikely    │      │       │
859 │                                                   Very        │   10%│     8%│
860 │                                                   unlikely    │      │       │
861 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
862 │105b. How likely is it that drivers who have had   Almost      │   14%│    18%│
863 │too much to drink to drive safely will B. Have an  certain     │      │       │
864 │accident?                                          Very likely │   36%│    45%│
865 │                                                   Somewhat    │   39%│    32%│
866 │                                                   likely      │      │       │
867 │                                                   Somewhat    │    9%│     4%│
868 │                                                   unlikely    │      │       │
869 │                                                   Very        │    3%│     2%│
870 │                                                   unlikely    │      │       │
871 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
872 │105b. How likely is it that drivers who have had   Almost      │   18%│    16%│
873 │too much to drink to drive safely will C. Be       certain     │      │       │
874 │convicted for drunk driving?                       Very likely │   32%│    28%│
875 │                                                   Somewhat    │   27%│    32%│
876 │                                                   likely      │      │       │
877 │                                                   Somewhat    │   15%│    15%│
878 │                                                   unlikely    │      │       │
879 │                                                   Very        │    9%│     9%│
880 │                                                   unlikely    │      │       │
881 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
882 │105b. How likely is it that drivers who have had   Almost      │   16%│    16%│
883 │too much to drink to drive safely will D. Be       certain     │      │       │
884 │arrested for drunk driving?                        Very likely │   26%│    27%│
885 │                                                   Somewhat    │   32%│    35%│
886 │                                                   likely      │      │       │
887 │                                                   Somewhat    │   17%│    15%│
888 │                                                   unlikely    │      │       │
889 │                                                   Very        │    9%│     7%│
890 │                                                   unlikely    │      │       │
891 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
892 ])
893 AT_CLEANUP
894
895 AT_SETUP([CTABLES show or hide empty categories])
896 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
897 AT_DATA([ctables.sps],
898 [[GET 'nhtsa.sav'.
899 IF (qn105ba = 2) qn105ba = 1.
900 IF (qns3a = 1) qns3a = 2.
901 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
902 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
903     /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
904 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
905     /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
906 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
907     /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
908 ]])
909 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
910                                   Custom Tables
911 ╭──────────────────────────────────────────────────────────────┬───────────────╮
912 │                                                              │  S3a. GENDER: │
913 │                                                              ├───────┬───────┤
914 │                                                              │  Male │ Female│
915 │                                                              ├───────┼───────┤
916 │                                                              │ Column│ Column│
917 │                                                              │   %   │   %   │
918 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
919 │105b. How likely is it that drivers who have had   Almost     │      .│    32%│
920 │too much to drink to drive safely will A. Get      certain    │       │       │
921 │stopped by the police?                             Very likely│      .│     0%│
922 │                                                   Somewhat   │      .│    40%│
923 │                                                   likely     │       │       │
924 │                                                   Somewhat   │      .│    19%│
925 │                                                   unlikely   │       │       │
926 │                                                   Very       │      .│     9%│
927 │                                                   unlikely   │       │       │
928 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
929
930                                   Custom Tables
931 ╭──────────────────────────────────────────────────────────────┬───────────────╮
932 │                                                              │  S3a. GENDER: │
933 │                                                              ├───────┬───────┤
934 │                                                              │  Male │ Female│
935 │                                                              ├───────┼───────┤
936 │                                                              │ Column│ Column│
937 │                                                              │   %   │   %   │
938 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
939 │105b. How likely is it that drivers who have had   Almost     │      .│    32%│
940 │too much to drink to drive safely will A. Get      certain    │       │       │
941 │stopped by the police?                             Somewhat   │      .│    40%│
942 │                                                   likely     │       │       │
943 │                                                   Somewhat   │      .│    19%│
944 │                                                   unlikely   │       │       │
945 │                                                   Very       │      .│     9%│
946 │                                                   unlikely   │       │       │
947 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
948
949                                   Custom Tables
950 ╭────────────────────────────────────────────────────────────────────┬─────────╮
951 │                                                                    │   S3a.  │
952 │                                                                    │ GENDER: │
953 │                                                                    ├─────────┤
954 │                                                                    │  Female │
955 │                                                                    ├─────────┤
956 │                                                                    │ Column %│
957 ├────────────────────────────────────────────────────────────────────┼─────────┤
958 │105b. How likely is it that drivers who have had too    Almost      │      32%│
959 │much to drink to drive safely will A. Get stopped by    certain     │         │
960 │the police?                                             Very likely │       0%│
961 │                                                        Somewhat    │      40%│
962 │                                                        likely      │         │
963 │                                                        Somewhat    │      19%│
964 │                                                        unlikely    │         │
965 │                                                        Very        │       9%│
966 │                                                        unlikely    │         │
967 ╰────────────────────────────────────────────────────────────────────┴─────────╯
968
969                                   Custom Tables
970 ╭────────────────────────────────────────────────────────────────────┬─────────╮
971 │                                                                    │   S3a.  │
972 │                                                                    │ GENDER: │
973 │                                                                    ├─────────┤
974 │                                                                    │  Female │
975 │                                                                    ├─────────┤
976 │                                                                    │ Column %│
977 ├────────────────────────────────────────────────────────────────────┼─────────┤
978 │105b. How likely is it that drivers who have had too    Almost      │      32%│
979 │much to drink to drive safely will A. Get stopped by    certain     │         │
980 │the police?                                             Somewhat    │      40%│
981 │                                                        likely      │         │
982 │                                                        Somewhat    │      19%│
983 │                                                        unlikely    │         │
984 │                                                        Very        │       9%│
985 │                                                        unlikely    │         │
986 ╰────────────────────────────────────────────────────────────────────┴─────────╯
987 ])
988 AT_CLEANUP
989
990 AT_SETUP([CTABLES sorting categories])
991 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
992 AT_DATA([ctables.sps],
993 [[GET 'nhtsa.sav'.
994 IF (QND5A=6) QND5A=-1.
995 IF (QND5A=5) QND5A=-2.
996 CTABLES /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=A
997         /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=D
998         /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=A
999         /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=D.
1000 ]])
1001 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1002                                   Custom Tables
1003 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1004 │                                                                        │Count│
1005 ├────────────────────────────────────────────────────────────────────────┼─────┤
1006 │D5a. What would you say is your primary ethnic  -2.00                   │   52│
1007 │background?                                     -1.00                   │   78│
1008 │                                                Cuban                   │   20│
1009 │                                                Mexican                 │  311│
1010 │                                                Spanish                 │   48│
1011 │                                                South American          │   34│
1012 │                                                Central American        │    0│
1013 │                                                Puerto Rican, OR        │    0│
1014 │                                                Something else          │   68│
1015 │                                                Multiple - cannot choose│    7│
1016 │                                                one                     │     │
1017 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1018
1019                                   Custom Tables
1020 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1021 │                                                                        │Count│
1022 ├────────────────────────────────────────────────────────────────────────┼─────┤
1023 │D5a. What would you say is your primary ethnic  Multiple - cannot choose│    7│
1024 │background?                                     one                     │     │
1025 │                                                Something else          │   68│
1026 │                                                Puerto Rican, OR        │    0│
1027 │                                                Central American        │    0│
1028 │                                                South American          │   34│
1029 │                                                Spanish                 │   48│
1030 │                                                Mexican                 │  311│
1031 │                                                Cuban                   │   20│
1032 │                                                -1.00                   │   78│
1033 │                                                -2.00                   │   52│
1034 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1035
1036                                   Custom Tables
1037 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1038 │                                                                        │Count│
1039 ├────────────────────────────────────────────────────────────────────────┼─────┤
1040 │D5a. What would you say is your primary ethnic  Central American        │    0│
1041 │background?                                     Cuban                   │   20│
1042 │                                                Mexican                 │  311│
1043 │                                                Multiple - cannot choose│    7│
1044 │                                                one                     │     │
1045 │                                                Puerto Rican, OR        │    0│
1046 │                                                Something else          │   68│
1047 │                                                South American          │   34│
1048 │                                                Spanish                 │   48│
1049 │                                                -2.00                   │   52│
1050 │                                                -1.00                   │   78│
1051 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1052
1053                                   Custom Tables
1054 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1055 │                                                                        │Count│
1056 ├────────────────────────────────────────────────────────────────────────┼─────┤
1057 │D5a. What would you say is your primary ethnic  Spanish                 │   48│
1058 │background?                                     South American          │   34│
1059 │                                                Something else          │   68│
1060 │                                                Puerto Rican, OR        │    0│
1061 │                                                Multiple - cannot choose│    7│
1062 │                                                one                     │     │
1063 │                                                Mexican                 │  311│
1064 │                                                Cuban                   │   20│
1065 │                                                Central American        │    0│
1066 │                                                -1.00                   │   78│
1067 │                                                -2.00                   │   52│
1068 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1069 ])
1070 AT_CLEANUP
1071
1072 AT_SETUP([CTABLES simple nesting])
1073 AT_KEYWORDS([nest nested])
1074 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1075 AT_DATA([ctables.sps],
1076 [[GET 'nhtsa.sav'.
1077 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1078   /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1079 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1080   /CATEGORIES VARIABLES=qns3a TOTAL=YES
1081   /CLABELS ROW=OPPOSITE.
1082 ]])
1083 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1084                                   Custom Tables
1085 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1086 │                                                                 │     │ Table│
1087 │                                                                 │Count│   %  │
1088 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1089 │105b. How likely is it that drivers    Almost     S3a.     Male  │  297│    4%│
1090 │who have had too much to drink to      certain    GENDER:  Female│  403│    6%│
1091 │drive safely will A. Get stopped by                        Total │  700│   10%│
1092 │the police?                           ╶──────────────────────────┼─────┼──────┤
1093 │                                       Very       S3a.     Male  │  660│   10%│
1094 │                                       likely     GENDER:  Female│  842│   12%│
1095 │                                                           Total │ 1502│   22%│
1096 │                                      ╶──────────────────────────┼─────┼──────┤
1097 │                                       Somewhat   S3a.     Male  │ 1174│   17%│
1098 │                                       likely     GENDER:  Female│ 1589│   23%│
1099 │                                                           Total │ 2763│   40%│
1100 │                                      ╶──────────────────────────┼─────┼──────┤
1101 │                                       Somewhat   S3a.     Male  │  640│    9%│
1102 │                                       unlikely   GENDER:  Female│  667│   10%│
1103 │                                                           Total │ 1307│   19%│
1104 │                                      ╶──────────────────────────┼─────┼──────┤
1105 │                                       Very       S3a.     Male  │  311│    5%│
1106 │                                       unlikely   GENDER:  Female│  298│    4%│
1107 │                                                           Total │  609│    9%│
1108 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1109 │105b. How likely is it that drivers    Almost     S3a.     Male  │  429│    6%│
1110 │who have had too much to drink to      certain    GENDER:  Female│  671│   10%│
1111 │drive safely will B. Have an accident?                     Total │ 1100│   16%│
1112 │                                      ╶──────────────────────────┼─────┼──────┤
1113 │                                       Very       S3a.     Male  │ 1104│   16%│
1114 │                                       likely     GENDER:  Female│ 1715│   25%│
1115 │                                                           Total │ 2819│   41%│
1116 │                                      ╶──────────────────────────┼─────┼──────┤
1117 │                                       Somewhat   S3a.     Male  │ 1203│   17%│
1118 │                                       likely     GENDER:  Female│ 1214│   18%│
1119 │                                                           Total │ 2417│   35%│
1120 │                                      ╶──────────────────────────┼─────┼──────┤
1121 │                                       Somewhat   S3a.     Male  │  262│    4%│
1122 │                                       unlikely   GENDER:  Female│  168│    2%│
1123 │                                                           Total │  430│    6%│
1124 │                                      ╶──────────────────────────┼─────┼──────┤
1125 │                                       Very       S3a.     Male  │   81│    1%│
1126 │                                       unlikely   GENDER:  Female│   59│    1%│
1127 │                                                           Total │  140│    2%│
1128 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1129 │105b. How likely is it that drivers    Almost     S3a.     Male  │  539│    8%│
1130 │who have had too much to drink to      certain    GENDER:  Female│  610│    9%│
1131 │drive safely will C. Be convicted for                      Total │ 1149│   17%│
1132 │drunk driving?                        ╶──────────────────────────┼─────┼──────┤
1133 │                                       Very       S3a.     Male  │  988│   14%│
1134 │                                       likely     GENDER:  Female│ 1049│   15%│
1135 │                                                           Total │ 2037│   30%│
1136 │                                      ╶──────────────────────────┼─────┼──────┤
1137 │                                       Somewhat   S3a.     Male  │  822│   12%│
1138 │                                       likely     GENDER:  Female│ 1210│   18%│
1139 │                                                           Total │ 2032│   30%│
1140 │                                      ╶──────────────────────────┼─────┼──────┤
1141 │                                       Somewhat   S3a.     Male  │  446│    7%│
1142 │                                       unlikely   GENDER:  Female│  548│    8%│
1143 │                                                           Total │  994│   15%│
1144 │                                      ╶──────────────────────────┼─────┼──────┤
1145 │                                       Very       S3a.     Male  │  268│    4%│
1146 │                                       unlikely   GENDER:  Female│  354│    5%│
1147 │                                                           Total │  622│    9%│
1148 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1149 │105b. How likely is it that drivers    Almost     S3a.     Male  │  498│    7%│
1150 │who have had too much to drink to      certain    GENDER:  Female│  603│    9%│
1151 │drive safely will D. Be arrested for                       Total │ 1101│   16%│
1152 │drunk driving?                        ╶──────────────────────────┼─────┼──────┤
1153 │                                       Very       S3a.     Male  │  805│   12%│
1154 │                                       likely     GENDER:  Female│ 1029│   15%│
1155 │                                                           Total │ 1834│   27%│
1156 │                                      ╶──────────────────────────┼─────┼──────┤
1157 │                                       Somewhat   S3a.     Male  │  975│   14%│
1158 │                                       likely     GENDER:  Female│ 1332│   19%│
1159 │                                                           Total │ 2307│   34%│
1160 │                                      ╶──────────────────────────┼─────┼──────┤
1161 │                                       Somewhat   S3a.     Male  │  535│    8%│
1162 │                                       unlikely   GENDER:  Female│  560│    8%│
1163 │                                                           Total │ 1095│   16%│
1164 │                                      ╶──────────────────────────┼─────┼──────┤
1165 │                                       Very       S3a.     Male  │  270│    4%│
1166 │                                       unlikely   GENDER:  Female│  279│    4%│
1167 │                                                           Total │  549│    8%│
1168 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1169
1170                                   Custom Tables
1171 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1172 │                                 │ Almost │ Very │ Somewhat│ Somewhat│  Very  │
1173 │                                 │ certain│likely│  likely │ unlikely│unlikely│
1174 │                                 ├────────┼──────┼─────────┼─────────┼────────┤
1175 │                                 │        │ Table│         │         │        │
1176 │                                 │ Table %│   %  │ Table % │ Table % │ Table %│
1177 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1178 │S3a.    Male   105b. How likely  │      4%│   10%│      17%│       9%│      5%│
1179 │GENDER:        is it that drivers│        │      │         │         │        │
1180 │               who have had too  │        │      │         │         │        │
1181 │               much to drink to  │        │      │         │         │        │
1182 │               drive safely will │        │      │         │         │        │
1183 │               A. Get stopped by │        │      │         │         │        │
1184 │               the police?       │        │      │         │         │        │
1185 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1186 │        Female 105b. How likely  │      6%│   12%│      23%│      10%│      4%│
1187 │               is it that drivers│        │      │         │         │        │
1188 │               who have had too  │        │      │         │         │        │
1189 │               much to drink to  │        │      │         │         │        │
1190 │               drive safely will │        │      │         │         │        │
1191 │               A. Get stopped by │        │      │         │         │        │
1192 │               the police?       │        │      │         │         │        │
1193 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1194 │        Total  105b. How likely  │     10%│   22%│      40%│      19%│      9%│
1195 │               is it that drivers│        │      │         │         │        │
1196 │               who have had too  │        │      │         │         │        │
1197 │               much to drink to  │        │      │         │         │        │
1198 │               drive safely will │        │      │         │         │        │
1199 │               A. Get stopped by │        │      │         │         │        │
1200 │               the police?       │        │      │         │         │        │
1201 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1202 │S3a.    Male   105b. How likely  │      6%│   16%│      17%│       4%│      1%│
1203 │GENDER:        is it that drivers│        │      │         │         │        │
1204 │               who have had too  │        │      │         │         │        │
1205 │               much to drink to  │        │      │         │         │        │
1206 │               drive safely will │        │      │         │         │        │
1207 │               B. Have an        │        │      │         │         │        │
1208 │               accident?         │        │      │         │         │        │
1209 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1210 │        Female 105b. How likely  │     10%│   25%│      18%│       2%│      1%│
1211 │               is it that drivers│        │      │         │         │        │
1212 │               who have had too  │        │      │         │         │        │
1213 │               much to drink to  │        │      │         │         │        │
1214 │               drive safely will │        │      │         │         │        │
1215 │               B. Have an        │        │      │         │         │        │
1216 │               accident?         │        │      │         │         │        │
1217 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1218 │        Total  105b. How likely  │     16%│   41%│      35%│       6%│      2%│
1219 │               is it that drivers│        │      │         │         │        │
1220 │               who have had too  │        │      │         │         │        │
1221 │               much to drink to  │        │      │         │         │        │
1222 │               drive safely will │        │      │         │         │        │
1223 │               B. Have an        │        │      │         │         │        │
1224 │               accident?         │        │      │         │         │        │
1225 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1226 │S3a.    Male   105b. How likely  │      8%│   14%│      12%│       7%│      4%│
1227 │GENDER:        is it that drivers│        │      │         │         │        │
1228 │               who have had too  │        │      │         │         │        │
1229 │               much to drink to  │        │      │         │         │        │
1230 │               drive safely will │        │      │         │         │        │
1231 │               C. Be convicted   │        │      │         │         │        │
1232 │               for drunk driving?│        │      │         │         │        │
1233 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1234 │        Female 105b. How likely  │      9%│   15%│      18%│       8%│      5%│
1235 │               is it that drivers│        │      │         │         │        │
1236 │               who have had too  │        │      │         │         │        │
1237 │               much to drink to  │        │      │         │         │        │
1238 │               drive safely will │        │      │         │         │        │
1239 │               C. Be convicted   │        │      │         │         │        │
1240 │               for drunk driving?│        │      │         │         │        │
1241 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1242 │        Total  105b. How likely  │     17%│   30%│      30%│      15%│      9%│
1243 │               is it that drivers│        │      │         │         │        │
1244 │               who have had too  │        │      │         │         │        │
1245 │               much to drink to  │        │      │         │         │        │
1246 │               drive safely will │        │      │         │         │        │
1247 │               C. Be convicted   │        │      │         │         │        │
1248 │               for drunk driving?│        │      │         │         │        │
1249 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1250 │S3a.    Male   105b. How likely  │      7%│   12%│      14%│       8%│      4%│
1251 │GENDER:        is it that drivers│        │      │         │         │        │
1252 │               who have had too  │        │      │         │         │        │
1253 │               much to drink to  │        │      │         │         │        │
1254 │               drive safely will │        │      │         │         │        │
1255 │               D. Be arrested for│        │      │         │         │        │
1256 │               drunk driving?    │        │      │         │         │        │
1257 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1258 │        Female 105b. How likely  │      9%│   15%│      19%│       8%│      4%│
1259 │               is it that drivers│        │      │         │         │        │
1260 │               who have had too  │        │      │         │         │        │
1261 │               much to drink to  │        │      │         │         │        │
1262 │               drive safely will │        │      │         │         │        │
1263 │               D. Be arrested for│        │      │         │         │        │
1264 │               drunk driving?    │        │      │         │         │        │
1265 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1266 │        Total  105b. How likely  │     16%│   27%│      34%│      16%│      8%│
1267 │               is it that drivers│        │      │         │         │        │
1268 │               who have had too  │        │      │         │         │        │
1269 │               much to drink to  │        │      │         │         │        │
1270 │               drive safely will │        │      │         │         │        │
1271 │               D. Be arrested for│        │      │         │         │        │
1272 │               drunk driving?    │        │      │         │         │        │
1273 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1274 ])
1275 AT_CLEANUP
1276
1277 AT_SETUP([CTABLES nesting and scale variables])
1278 AT_KEYWORDS([nest nested])
1279 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1280 AT_DATA([ctables.sps],
1281 [[GET 'nhtsa.sav'.
1282 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1283 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1284 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1285   /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1286 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1287 ]])
1288 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1289                                   Custom Tables
1290 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1291 │                                                                 │S3a. GENDER:│
1292 │                                                                 ├─────┬──────┤
1293 │                                                                 │ Male│Female│
1294 │                                                                 ├─────┼──────┤
1295 │                                                                 │ Mean│ Mean │
1296 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1297 │D1. AGE: What   1. How often do you usually drive Every day      │   46│    46│
1298 │is your age?   a car or other motor vehicle?      Several days a │   51│    59│
1299 │                                                  week           │     │      │
1300 │                                                  Once a week or │   44│    54│
1301 │                                                  less           │     │      │
1302 │                                                  Only certain   │   34│    41│
1303 │                                                  times a year   │     │      │
1304 │                                                  Never          │   39│    55│
1305 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1306
1307                                   Custom Tables
1308 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1309 │                                                         │Minimum│Maximum│Mean│
1310 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1311 │D1. AGE: S3a.     Male   26. During the last 12       Yes│     16│     86│  42│
1312 │What is  GENDER:         months, has there been a        │       │       │    │
1313 │your                     time when you felt you          │       │       │    │
1314 │age?                     should cut down on your      No │     16│     86│  46│
1315 │                         drinking?                       │       │       │    │
1316 │                 ╶───────────────────────────────────────┼───────┼───────┼────┤
1317 │                  Female 26. During the last 12       Yes│     16│     86│  43│
1318 │                         months, has there been a        │       │       │    │
1319 │                         time when you felt you          │       │       │    │
1320 │                         should cut down on your      No │     16│     86│  48│
1321 │                         drinking?                       │       │       │    │
1322 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1323 │D1. AGE: S3a.     Male   27. During the last 12       Yes│     16│     86│  38│
1324 │What is  GENDER:         months, has there been a        │       │       │    │
1325 │your                     time when people criticized  No │     16│     86│  46│
1326 │age?                     your drinking?                  │       │       │    │
1327 │                 ╶───────────────────────────────────────┼───────┼───────┼────┤
1328 │                  Female 27. During the last 12       Yes│     17│     69│  37│
1329 │                         months, has there been a        │       │       │    │
1330 │                         time when people criticized  No │     16│     86│  48│
1331 │                         your drinking?                  │       │       │    │
1332 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1333
1334                                   Custom Tables
1335 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1336 │                             │S1. Including yourself, how many members of this│
1337 │                             │         household are age 16 or older?         │
1338 │                             ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1339 │                             │      │      │      │      │      │      │ 6 or │
1340 │                             │ None │   1  │   2  │   3  │   4  │   5  │ more │
1341 │                             ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1342 │                             │Column│Column│Column│Column│Column│Column│Column│
1343 │                             │   %  │   %  │   %  │   %  │   %  │   %  │   %  │
1344 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1345 │Sa1.    RDD 105b.    Almost  │     .│  9.5%│  8.2%│ 12.4%│  9.9%│ 20.0%│ 23.8%│
1346 │SAMPLE      How      certain │      │      │      │      │      │      │      │
1347 │SOURCE:     likely           │      │      │      │      │      │      │      │
1348 │            is it    Very    │     .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1349 │            that     likely  │      │      │      │      │      │      │      │
1350 │            drivers          │      │      │      │      │      │      │      │
1351 │            who have         │      │      │      │      │      │      │      │
1352 │            had too  Somewhat│     .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1353 │            much to  likely  │      │      │      │      │      │      │      │
1354 │            drink to         │      │      │      │      │      │      │      │
1355 │            drive            │      │      │      │      │      │      │      │
1356 │            safely   Somewhat│     .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│  9.5%│
1357 │            will A.  unlikely│      │      │      │      │      │      │      │
1358 │            Get              │      │      │      │      │      │      │      │
1359 │            stopped  Very    │     .│  9.2%│  9.7%│  8.2%│  9.4%│  7.3%│  9.5%│
1360 │            by the   unlikely│      │      │      │      │      │      │      │
1361 │            police?          │      │      │      │      │      │      │      │
1362 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1363
1364                                   Custom Tables
1365 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1366 │                                                              │    │    Std   │
1367 │                                                              │Mean│ Deviation│
1368 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1369 │Age    16 to 25 20. On how many of the thirty days in this    │ 5.2│       6.0│
1370 │group           typical month did you have one or more        │    │          │
1371 │                alcoholic beverages to drink?                 │    │          │
1372 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1373 │       26 to 35 20. On how many of the thirty days in this    │ 4.7│       5.9│
1374 │                typical month did you have one or more        │    │          │
1375 │                alcoholic beverages to drink?                 │    │          │
1376 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1377 │       36 to 45 20. On how many of the thirty days in this    │ 5.5│       6.8│
1378 │                typical month did you have one or more        │    │          │
1379 │                alcoholic beverages to drink?                 │    │          │
1380 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1381 │       46 to 55 20. On how many of the thirty days in this    │ 5.8│       7.7│
1382 │                typical month did you have one or more        │    │          │
1383 │                alcoholic beverages to drink?                 │    │          │
1384 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1385 │       56 to 65 20. On how many of the thirty days in this    │ 6.3│       8.2│
1386 │                typical month did you have one or more        │    │          │
1387 │                alcoholic beverages to drink?                 │    │          │
1388 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1389 │       66 or    20. On how many of the thirty days in this    │ 7.1│       9.2│
1390 │       older    typical month did you have one or more        │    │          │
1391 │                alcoholic beverages to drink?                 │    │          │
1392 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1393 ])
1394 AT_CLEANUP
1395
1396
1397 AT_SETUP([CTABLES SLABELS])
1398 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1399 AT_DATA([ctables.sps],
1400 [[GET 'nhtsa.sav'.
1401 CTABLES /TABLE qn1 [COUNT COLPCT].
1402 CTABLES /TABLE qn1 [COUNT COLPCT]
1403     /SLABELS POSITION=ROW.
1404 CTABLES /TABLE qn1 [COUNT COLPCT]
1405     /SLABELS POSITION=ROW VISIBLE=NO.
1406 ]])
1407 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1408                                   Custom Tables
1409 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1410 │                                                                │     │ Column│
1411 │                                                                │Count│   %   │
1412 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1413 │ 1. How often do you usually drive a car or  Every day          │ 4667│  66.9%│
1414 │other motor vehicle?                         Several days a week│ 1274│  18.3%│
1415 │                                             Once a week or less│  361│   5.2%│
1416 │                                             Only certain times │  130│   1.9%│
1417 │                                             a year             │     │       │
1418 │                                             Never              │  540│   7.7%│
1419 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1420
1421                                   Custom Tables
1422 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1423 │ 1. How often do you usually drive a car or  Every day           Count  │ 4667│
1424 │other motor vehicle?                                             Column │66.9%│
1425 │                                                                 %      │     │
1426 │                                            ╶───────────────────────────┼─────┤
1427 │                                             Several days a week Count  │ 1274│
1428 │                                                                 Column │18.3%│
1429 │                                                                 %      │     │
1430 │                                            ╶───────────────────────────┼─────┤
1431 │                                             Once a week or less Count  │  361│
1432 │                                                                 Column │ 5.2%│
1433 │                                                                 %      │     │
1434 │                                            ╶───────────────────────────┼─────┤
1435 │                                             Only certain times  Count  │  130│
1436 │                                             a year              Column │ 1.9%│
1437 │                                                                 %      │     │
1438 │                                            ╶───────────────────────────┼─────┤
1439 │                                             Never               Count  │  540│
1440 │                                                                 Column │ 7.7%│
1441 │                                                                 %      │     │
1442 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1443
1444                                   Custom Tables
1445 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1446 │ 1. How often do you usually drive a car or other  Every day            │ 4667│
1447 │motor vehicle?                                                          │66.9%│
1448 │                                                   Several days a week  │ 1274│
1449 │                                                                        │18.3%│
1450 │                                                   Once a week or less  │  361│
1451 │                                                                        │ 5.2%│
1452 │                                                   Only certain times a │  130│
1453 │                                                   year                 │ 1.9%│
1454 │                                                   Never                │  540│
1455 │                                                                        │ 7.7%│
1456 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1457 ])
1458 AT_CLEANUP
1459
1460 AT_SETUP([CTABLES simple totals])
1461 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1462 AT_DATA([ctables.sps],
1463 [[GET 'nhtsa.sav'.
1464 CTABLES /TABLE=qn17
1465     /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1466 DESCRIPTIVES qn18/STATISTICS=MEAN.
1467 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1468     /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1469 ]])
1470 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1471                                   Custom Tables
1472 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1473 │                                                                        │Count│
1474 ├────────────────────────────────────────────────────────────────────────┼─────┤
1475 │17. When you drink alcoholic beverages, which ONE of  OR, something else│    2│
1476 │the following beverages do you drink MOST OFTEN?      Beer              │ 1073│
1477 │                                                      Light beer        │  620│
1478 │                                                      Wine              │ 1418│
1479 │                                                      Wine coolers      │  137│
1480 │                                                      Hard liquor or    │  888│
1481 │                                                      mixed drinks      │     │
1482 │                                                      Flavored malt     │   83│
1483 │                                                      drinks            │     │
1484 │                                                      Number responding │ 4221│
1485 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1486
1487                              Descriptive Statistics
1488 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1489 │                                                                    │  N │Mean│
1490 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1491 │18. When you drink ANSWERFROM(QN17R1), about how many               │4218│4.62│
1492 │ANSWERFROM(QN17R2) do you usually drink per sitting?                │    │    │
1493 │Valid N (listwise)                                                  │6999│    │
1494 │Missing N (listwise)                                                │2781│    │
1495 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1496
1497                                   Custom Tables
1498 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1499 │                                                      │    │     │ Valid│Total│
1500 │                                                      │Mean│Count│   N  │  N  │
1501 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1502 │Region NE       18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│   949│ 1409│
1503 │                about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1504 │                you usually drink per sitting?        │    │     │      │     │
1505 │      ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1506 │       MW       18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│  1027│ 1654│
1507 │                about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1508 │                you usually drink per sitting?        │    │     │      │     │
1509 │      ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1510 │       S        18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│  1287│ 2390│
1511 │                about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1512 │                you usually drink per sitting?        │    │     │      │     │
1513 │      ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1514 │       W        18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│   955│ 1546│
1515 │                about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1516 │                you usually drink per sitting?        │    │     │      │     │
1517 │      ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1518 │       All      18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│  4218│ 6999│
1519 │       regions  about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1520 │                you usually drink per sitting?        │    │     │      │     │
1521 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1522 ])
1523 AT_CLEANUP
1524
1525 AT_SETUP([CTABLES subtotals])
1526 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1527 AT_DATA([ctables.sps],
1528 [[GET 'nhtsa.sav'.
1529 CTABLES /TABLE=qn105ba BY qns1
1530     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1531 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1532     /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1533 CTABLES /TABLE=qn105ba BY qns1
1534     /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1535     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1536 ]])
1537 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1538                                                       Custom Tables
1539 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1540 │                                                         │ S1. Including yourself, how many members of this household │
1541 │                                                         │                    are age 16 or older?                    │
1542 │                                                         ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1543 │                                                         │   1   │   2   │ Subtotal│   3   │    4   │   5  │ Subtotal │
1544 │                                                         ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1545 │                                                         │ Count │ Count │  Count  │ Count │  Count │ Count│   Count  │
1546 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1547 │105b. How likely is it that drivers who have  Almost     │    147│    246│      393│     62│      19│    11│        92│
1548 │had too much to drink to drive safely will A. certain    │       │       │         │       │        │      │          │
1549 │Get stopped by the police?                    Very likely│    384│    552│      936│    120│      51│    14│       185│
1550 │                                              Somewhat   │    590│   1249│     1839│    193│      72│    20│       285│
1551 │                                              likely     │       │       │         │       │        │      │          │
1552 │                                              Somewhat   │    278│    647│      925│     84│      32│     6│       122│
1553 │                                              unlikely   │       │       │         │       │        │      │          │
1554 │                                              Very       │    141│    290│      431│     41│      18│     4│        63│
1555 │                                              unlikely   │       │       │         │       │        │      │          │
1556 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1557
1558                                                       Custom Tables
1559 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1560 │                                                        │  S1. Including yourself, how many members of this household │
1561 │                                                        │                     are age 16 or older?                    │
1562 │                                                        ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1563 │                                                        │        │        │        │        │       │        │  6 or  │
1564 │                                                        │  None  │    1   │    2   │    3   │   4   │    5   │  more  │
1565 │                                                        ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1566 │                                                        │        │        │        │        │ Column│        │        │
1567 │                                                        │Column %│Column %│Column %│Column %│   %   │Column %│Column %│
1568 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1569 │105b. How likely is it that drivers who have Almost     │       .│    9.5%│    8.2%│   12.4%│   9.9%│   20.0%│   23.8%│
1570 │had too much to drink to drive safely will   certain    │        │        │        │        │       │        │        │
1571 │A. Get stopped by the police?                Very likely│       .│   24.9%│   18.5%│   24.0%│  26.6%│   25.5%│   33.3%│
1572 │                                             Somewhat   │       .│   38.3%│   41.9%│   38.6%│  37.5%│   36.4%│   23.8%│
1573 │                                             likely     │        │        │        │        │       │        │        │
1574 │                                             Subtotal   │        │   72.8%│   68.6%│   75.0%│  74.0%│   81.8%│   81.0%│
1575 │                                             Somewhat   │       .│   18.1%│   21.7%│   16.8%│  16.7%│   10.9%│    9.5%│
1576 │                                             unlikely   │        │        │        │        │       │        │        │
1577 │                                             Very       │       .│    9.2%│    9.7%│    8.2%│   9.4%│    7.3%│    9.5%│
1578 │                                             unlikely   │        │        │        │        │       │        │        │
1579 │                                             Subtotal   │        │   27.2%│   31.4%│   25.0%│  26.0%│   18.2%│   19.0%│
1580 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1581
1582                                                       Custom Tables
1583 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1584 │                                                         │ S1. Including yourself, how many members of this household │
1585 │                                                         │                    are age 16 or older?                    │
1586 │                                                         ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1587 │                                                         │   1   │   2   │ Subtotal│   3   │    4   │   5  │ Subtotal │
1588 │                                                         ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1589 │                                                         │ Count │ Count │  Count  │ Count │  Count │ Count│   Count  │
1590 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1591 │105b. How likely is it that drivers who have  Almost     │    147│    246│      393│     62│      19│    11│        92│
1592 │had too much to drink to drive safely will A. certain    │       │       │         │       │        │      │          │
1593 │Get stopped by the police?                    Very likely│    384│    552│      936│    120│      51│    14│       185│
1594 │                                              Somewhat   │    590│   1249│     1839│    193│      72│    20│       285│
1595 │                                              likely     │       │       │         │       │        │      │          │
1596 │                                              Subtotal   │   1121│   2047│     3168│    375│     142│    45│       562│
1597 │                                              Somewhat   │    278│    647│      925│     84│      32│     6│       122│
1598 │                                              unlikely   │       │       │         │       │        │      │          │
1599 │                                              Very       │    141│    290│      431│     41│      18│     4│        63│
1600 │                                              unlikely   │       │       │         │       │        │      │          │
1601 │                                              Subtotal   │    419│    937│     1356│    125│      50│    10│       185│
1602 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1603 ])
1604 AT_CLEANUP
1605
1606 AT_SETUP([CTABLES PCOMPUTE])
1607 AT_KEYWORDS([postcompute])
1608 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1609 AT_DATA([ctables.sps],
1610 [[GET 'nhtsa.sav'.
1611 CTABLES
1612     /PCOMPUTE &x=EXPR([3] + [4])
1613     /PCOMPUTE &y=EXPR([4] + [5])
1614     /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1615     /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]'
1616     /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1617     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1618
1619 * Adding HIDESOURCECATS=YES for one PPROPERTIES.
1620 CTABLES
1621     /PCOMPUTE &x=EXPR([3] + [4])
1622     /PCOMPUTE &y=EXPR([4] + [5])
1623     /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1624     /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]' HIDESOURCECATS=YES
1625     /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1626     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1627 ]])
1628 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1629                                                                 Custom Tables
1630 ╭───────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1631 │                   │                    S1. Including yourself, how many members of this household are age 16 or older?                   │
1632 │                   ├───────────┬───────────┬───────────┬───────────┬──────────┬──────────┬────────────┬──────────┬───────────┬────────────┤
1633 │                   │     1     │     2     │  Subtotal │     3     │     4    │     5    │     3+4    │    4+5   │  Subtotal │    Total   │
1634 │                   ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼─────┬────┼─────┬────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1635 │                   │     │     │     │     │     │     │     │     │     │ Row│     │ Row│      │     │     │ Row│     │     │     │      │
1636 │                   │Count│Row %│Count│Row %│Count│Row %│Count│Row %│Count│  % │Count│  % │ Count│Row %│Count│  % │Count│Row %│Count│ Row %│
1637 ├───────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼────┼─────┼────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1638 │105b. How  Almost  │  147│30.3%│  246│50.7%│  393│81.0%│   62│12.8%│   19│3.9%│   11│2.3%│ 81.00│16.7%│   30│6.2%│   92│19.0%│  485│100.0%│
1639 │likely is  certain │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1640 │it that            │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1641 │drivers    Very    │  384│34.3%│  552│49.2%│  936│83.5%│  120│10.7%│   51│4.5%│   14│1.2%│171.00│15.3%│   65│5.8%│  185│16.5%│ 1121│100.0%│
1642 │who have   likely  │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1643 │had too            │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1644 │much to    Somewhat│  590│27.8%│ 1249│58.8%│ 1839│86.6%│  193│ 9.1%│   72│3.4%│   20│ .9%│265.00│12.5%│   92│4.3%│  285│13.4%│ 2124│100.0%│
1645 │drink to   likely  │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1646 │drive              │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1647 │safely     Somewhat│  278│26.6%│  647│61.8%│  925│88.3%│   84│ 8.0%│   32│3.1%│    6│ .6%│116.00│11.1%│   38│3.6%│  122│11.7%│ 1047│100.0%│
1648 │will A.    unlikely│     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1649 │Get                │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1650 │stopped by Very    │  141│28.5%│  290│58.7%│  431│87.2%│   41│ 8.3%│   18│3.6%│    4│ .8%│ 59.00│11.9%│   22│4.5%│   63│12.8%│  494│100.0%│
1651 │the        unlikely│     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1652 │police?            │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1653 ╰───────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴────┴─────┴────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1654
1655                                                                 Custom Tables
1656 ╭─────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────╮
1657 │                                         │         S1. Including yourself, how many members of this household are age 16 or older?        │
1658 │                                         ├───────────┬───────────┬───────────┬───────────┬────────────┬──────────┬───────────┬────────────┤
1659 │                                         │     1     │     2     │  Subtotal │     3     │     3+4    │    4+5   │  Subtotal │    Total   │
1660 │                                         ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1661 │                                         │     │     │     │     │     │     │     │     │      │     │     │ Row│     │     │     │      │
1662 │                                         │Count│Row %│Count│Row %│Count│Row %│Count│Row %│ Count│Row %│Count│  % │Count│Row %│Count│ Row %│
1663 ├─────────────────────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1664 │105b. How likely is it that    Almost    │  147│30.3%│  246│50.7%│  393│81.0%│   62│12.8%│ 81.00│16.7%│   30│6.2%│   92│19.0%│  485│100.0%│
1665 │drivers who have had too much  certain   │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1666 │to drink to drive safely will  Very      │  384│34.3%│  552│49.2%│  936│83.5%│  120│10.7%│171.00│15.3%│   65│5.8%│  185│16.5%│ 1121│100.0%│
1667 │A. Get stopped by the police?  likely    │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1668 │                               Somewhat  │  590│27.8%│ 1249│58.8%│ 1839│86.6%│  193│ 9.1%│265.00│12.5%│   92│4.3%│  285│13.4%│ 2124│100.0%│
1669 │                               likely    │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1670 │                               Somewhat  │  278│26.6%│  647│61.8%│  925│88.3%│   84│ 8.0%│116.00│11.1%│   38│3.6%│  122│11.7%│ 1047│100.0%│
1671 │                               unlikely  │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1672 │                               Very      │  141│28.5%│  290│58.7%│  431│87.2%│   41│ 8.3%│ 59.00│11.9%│   22│4.5%│   63│12.8%│  494│100.0%│
1673 │                               unlikely  │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1674 ╰─────────────────────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1675 ])
1676 AT_CLEANUP
1677
1678 AT_SETUP([CTABLES PCOMPUTE - OTHERNM and MISSING])
1679 AT_KEYWORDS([postcompute])
1680 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1681 AT_DATA([ctables.sps],
1682 [[GET 'nhtsa.sav'.
1683 CTABLES
1684     /PCOMPUTE &x=EXPR(OTHERNM)
1685     /PCOMPUTE &y=EXPR(MISSING)
1686     /PPROPERTIES &x LABEL='Drivers'
1687     /PPROPERTIES &y LABEL='Missing Values 2'
1688     /TABLE=qn1 BY qns3a
1689     /CATEGORIES VARIABLES=qn1 [OTHERNM, 5, &x, SUBTOTAL='Valid Values', MISSING, SUBTOTAL='Missing Values', &y]
1690 ]])
1691 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1692                                               Custom Tables
1693 ╭──────────────────────────────────────────────────────────────────────────────────────────┬────────────╮
1694 │                                                                                          │S3a. GENDER:│
1695 │                                                                                          ├─────┬──────┤
1696 │                                                                                          │ Male│Female│
1697 │                                                                                          ├─────┼──────┤
1698 │                                                                                          │Count│ Count│
1699 ├──────────────────────────────────────────────────────────────────────────────────────────┼─────┼──────┤
1700 │ 1. How often do you usually drive a car or other motor vehicle? Every day                │ 2305│  2362│
1701 │                                                                 Several days a week      │  440│   834│
1702 │                                                                 Once a week or less      │  125│   236│
1703 │                                                                 Only certain times a year│   58│    72│
1704 │                                                                 Never                    │  192│   348│
1705 │                                                                 Drivers                  │ 2928│  3504│
1706 │                                                                 Valid Values             │ 3120│  3852│
1707 │                                                                 Don't know               │    3│     5│
1708 │                                                                 Refused                  │    9│    10│
1709 │                                                                 Missing Values           │   12│    15│
1710 │                                                                 Missing Values 2         │   12│    15│
1711 ╰──────────────────────────────────────────────────────────────────────────────────────────┴─────┴──────╯
1712 ])
1713 AT_CLEANUP
1714
1715 AT_SETUP([CTABLES PCOMPUTE - THRU])
1716 AT_KEYWORDS([postcompute])
1717 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1718 AT_DATA([ctables.sps],
1719 [[GET 'nhtsa.sav'.
1720 CTABLES
1721     /PCOMPUTE &x=EXPR([1 THRU 2])
1722     /PCOMPUTE &y=EXPR([3 THRU 4])
1723     /PCOMPUTE &z=EXPR([5] + MISSING)
1724     /PPROPERTIES &x LABEL='Frequent Drivers'
1725     /PPROPERTIES &y LABEL='Infrequent Drivers'
1726     /PPROPERTIES &z LABEL='Not Drivers or Missing'
1727     /TABLE=qn1 BY qns3a
1728     /CATEGORIES VARIABLES=qn1 [1 THRU 2, &x, 3 THRU 4, &y, SUBTOTAL='Drivers', 5, MISSING, &z]
1729 ]])
1730 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1731                                               Custom Tables
1732 ╭──────────────────────────────────────────────────────────────────────────────────────────┬────────────╮
1733 │                                                                                          │S3a. GENDER:│
1734 │                                                                                          ├─────┬──────┤
1735 │                                                                                          │ Male│Female│
1736 │                                                                                          ├─────┼──────┤
1737 │                                                                                          │Count│ Count│
1738 ├──────────────────────────────────────────────────────────────────────────────────────────┼─────┼──────┤
1739 │ 1. How often do you usually drive a car or other motor vehicle? Every day                │ 2305│  2362│
1740 │                                                                 Several days a week      │  440│   834│
1741 │                                                                 Frequent Drivers         │ 2745│  3196│
1742 │                                                                 Once a week or less      │  125│   236│
1743 │                                                                 Only certain times a year│   58│    72│
1744 │                                                                 Infrequent Drivers       │  183│   308│
1745 │                                                                 Drivers                  │ 2928│  3504│
1746 │                                                                 Never                    │  192│   348│
1747 │                                                                 Don't know               │    3│     5│
1748 │                                                                 Refused                  │    9│    10│
1749 │                                                                 Not Drivers or Missing   │  204│   363│
1750 ╰──────────────────────────────────────────────────────────────────────────────────────────┴─────┴──────╯
1751 ])
1752 AT_CLEANUP
1753
1754 dnl I'm not sure that this is the correct behavior (see
1755 dnl https://mail.gnu.org/archive/html/pspp-users/2022-07/msg00002.html)
1756 dnl but at least this test will notify us if the behavior changes.
1757 AT_SETUP([CTABLES intersecting PCOMPUTEs])
1758 AT_KEYWORDS([PCOMPUTE postcompute])
1759 AT_DATA([ctables.sps],
1760 [[DATA LIST LIST NOTABLE/x y z.
1761 WEIGHT by z.
1762 FORMATS ALL (F1.0).
1763 VARIABLE LEVEL x y (NOMINAL).
1764 BEGIN DATA.
1765 1 4 5
1766 1 5 2
1767 1 6 9
1768 2 4 2
1769 2 5 3
1770 2 6 4
1771 3 4 1
1772 3 5 6
1773 3 6 1
1774 END DATA.
1775
1776 CTABLES
1777     /PCOMPUTE &a = EXPR([1] + [2])
1778     /PCOMPUTE &b = EXPR([2] + [3])
1779     /PCOMPUTE &c = EXPR([4] * [5])
1780     /PCOMPUTE &d = EXPR([5] * [6])
1781     /TABLE x BY y
1782     /CATEGORIES VARIABLES=x [1, &a, 2, &b, 3]
1783     /CATEGORIES VARIABLES=y [4, &c, 5, &d, 6].
1784 ]])
1785 AT_CHECK([pspp ctables.sps -O box=unicode], [0],
1786 [[                   Custom Tables
1787 ╭───────────┬─────────────────────────────────────╮
1788 │           │                  y                  │
1789 │           ├─────┬─────────┬─────┬─────────┬─────┤
1790 │           │  4  │[4] * [5]│  5  │[5] * [6]│  6  │
1791 │           ├─────┼─────────┼─────┼─────────┼─────┤
1792 │           │Count│  Count  │Count│  Count  │Count│
1793 ├───────────┼─────┼─────────┼─────┼─────────┼─────┤
1794 │x 1        │    5│       10│    2│       18│    9│
1795 │  [1] + [2]│    7│        .│    5│        .│   13│
1796 │  2        │    2│        6│    3│       12│    4│
1797 │  [2] + [3]│    3│        .│    9│        .│    5│
1798 │  3        │    1│        6│    6│        6│    1│
1799 ╰───────────┴─────┴─────────┴─────┴─────────┴─────╯
1800 ]])
1801 AT_CLEANUP
1802
1803 AT_SETUP([CTABLES string and date and time])
1804
1805 weight=1
1806 for gender in F M; do
1807     for month in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do
1808         for wkday in Sun Mon Tue Wed Thu Fri Sat Sun; do
1809             printf "$weight $gender $month $wkday\n"
1810             weight=$(expr \( $weight + 3 \) % 7 + 2)
1811         done
1812     done
1813 done > ctables.txt
1814
1815 AT_DATA([ctables.sps],
1816 [[DATA LIST LIST NOTABLE FILE='ctables.txt'
1817     /w (F5.0) gender (A1) fmon (MONTH3) fday (WKDAY3).
1818 WEIGHT by w.
1819 VARIABLE LEVEL w (SCALE).
1820 VARIABLE LEVEL gender fmon fday (NOMINAL).
1821 VARIABLE LABEL
1822   gender 'Gender'
1823   fmon 'Favorite month'
1824   fday 'Favorite day of the week'.
1825 VALUE LABELS /gender 'M' 'Male' 'F' 'Female'.
1826 CTABLES
1827     /PCOMPUTE &q2 = EXPR(['APR' THRU 'June'])
1828     /PPROPERTIES &q2 LABEL='Q2'
1829     /PCOMPUTE &weekend = EXPR(['sun'] + ['Sat'])
1830     /PPROPERTIES &weekend LABEL='Weekend'
1831     /TABLE fmon BY gender > fday
1832     /CATEGORIES VARIABLES=fmon ['JAN', 'FEB', 'Mar', SUBTOTAL="Q1",
1833                                 4 THRU 6, &q2,
1834                                 'JUL' THRU 'sep', SUBTOTAL="Q3",
1835                                 OTHERNM, SUBTOTAL='Q4']
1836     /CATEGORIES VARIABLES=gender ['M', 'F']
1837     /CATEGORIES VARIABLE=fday ['Sun', 2 THRU 6, 'Sat', &weekend] TOTAL=YES
1838     /SLABELS VISIBLE=NO.
1839 ]])
1840 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1841                                               Custom Tables
1842 ╭──────────────────┬───────────────────────────────────────────────────────────────────────────────────╮
1843 │                  │                                       Gender                                      │
1844 │                  ├─────────────────────────────────────────┬─────────────────────────────────────────┤
1845 │                  │                   Male                  │                  Female                 │
1846 │                  ├─────────────────────────────────────────┼─────────────────────────────────────────┤
1847 │                  │         Favorite day of the week        │         Favorite day of the week        │
1848 │                  ├───┬───┬───┬───┬───┬───┬───┬───────┬─────┼───┬───┬───┬───┬───┬───┬───┬───────┬─────┤
1849 │                  │SUN│MON│TUE│WED│THU│FRI│SAT│Weekend│Total│SUN│MON│TUE│WED│THU│FRI│SAT│Weekend│Total│
1850 ├──────────────────┼───┼───┼───┼───┼───┼───┼───┼───────┼─────┼───┼───┼───┼───┼───┼───┼───┼───────┼─────┤
1851 │Favorite month JAN│ 10│  3│  8│  6│  4│  2│  7│     17│   40│  9│  6│  4│  2│  7│  5│  3│     12│   36│
1852 │               FEB│  6│  8│  6│  4│  2│  7│  5│     11│   38│ 12│  4│  2│  7│  5│  3│  8│     20│   41│
1853 │               MAR│ 16│  6│  4│  2│  7│  5│  3│     19│   43│  8│  2│  7│  5│  3│  8│  6│     14│   39│
1854 │               Q1 │ 32│ 17│ 18│ 12│ 13│ 14│ 15│       │     │ 29│ 12│ 13│ 14│ 15│ 16│ 17│       │     │
1855 │               APR│ 12│  4│  2│  7│  5│  3│  8│     20│   41│  4│  7│  5│  3│  8│  6│  4│      8│   37│
1856 │               MAY│  8│  2│  7│  5│  3│  8│  6│     14│   39│ 14│  5│  3│  8│  6│  4│  2│     16│   42│
1857 │               JUN│  4│  7│  5│  3│  8│  6│  4│      8│   37│ 10│  3│  8│  6│  4│  2│  7│     17│   40│
1858 │               Q2 │ 24│ 13│ 14│ 15│ 16│ 17│ 18│      .│     │ 28│ 15│ 16│ 17│ 18│ 12│ 13│      .│     │
1859 │               JUL│ 14│  5│  3│  8│  6│  4│  2│     16│   42│  6│  8│  6│  4│  2│  7│  5│     11│   38│
1860 │               AUG│ 10│  3│  8│  6│  4│  2│  7│     17│   40│ 16│  6│  4│  2│  7│  5│  3│     19│   43│
1861 │               SEP│  6│  8│  6│  4│  2│  7│  5│     11│   38│ 12│  4│  2│  7│  5│  3│  8│     20│   41│
1862 │               Q3 │ 54│ 29│ 31│ 33│ 28│ 30│ 32│       │     │ 62│ 33│ 28│ 30│ 32│ 27│ 29│       │     │
1863 │               OCT│ 16│  6│  4│  2│  7│  5│  3│     19│   43│  8│  2│  7│  5│  3│  8│  6│     14│   39│
1864 │               NOV│ 12│  4│  2│  7│  5│  3│  8│     20│   41│  4│  7│  5│  3│  8│  6│  4│      8│   37│
1865 │               DEC│  8│  2│  7│  5│  3│  8│  6│     14│   39│ 14│  5│  3│  8│  6│  4│  2│     16│   42│
1866 │               Q4 │ 36│ 12│ 13│ 14│ 15│ 16│ 17│       │     │ 26│ 14│ 15│ 16│ 17│ 18│ 12│       │     │
1867 ╰──────────────────┴───┴───┴───┴───┴───┴───┴───┴───────┴─────┴───┴───┴───┴───┴───┴───┴───┴───────┴─────╯
1868 ])
1869 AT_CLEANUP
1870
1871 AT_SETUP([CTABLES CLABELS])
1872 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1873 AT_DATA([ctables.sps],
1874 [[GET 'nhtsa.sav'.
1875 CTABLES /TABLE AgeGroup BY qns3a.
1876 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1877 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1878 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
1879 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
1880 ]])
1881 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
1882              Custom Tables
1883 ╭───────────────────────┬────────────╮
1884 │                       │S3a. GENDER:│
1885 │                       ├─────┬──────┤
1886 │                       │ Male│Female│
1887 │                       ├─────┼──────┤
1888 │                       │Count│ Count│
1889 ├───────────────────────┼─────┼──────┤
1890 │Age group 15 or younger│    0│     0│
1891 │          16 to 25     │  594│   505│
1892 │          26 to 35     │  476│   491│
1893 │          36 to 45     │  489│   548│
1894 │          46 to 55     │  526│   649│
1895 │          56 to 65     │  516│   731│
1896 │          66 or older  │  531│   943│
1897 ╰───────────────────────┴─────┴──────╯
1898
1899                                                       Custom Tables
1900 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1901 │       │                                                 S3a. GENDER:                                                 │
1902 │       ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1903 │       │                         Male                         │                         Female                        │
1904 │       ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1905 │       │  15 or  │ 16 to │ 26 to│ 36 to│ 46 to│ 56 to │ 66 or │   15 or  │ 16 to│ 26 to │ 36 to│ 46 to│ 56 to│  66 or │
1906 │       │ younger │   25  │  35  │  45  │  55  │   65  │ older │  younger │  25  │   35  │  45  │  55  │  65  │  older │
1907 │       ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1908 │       │  Count  │ Count │ Count│ Count│ Count│ Count │ Count │   Count  │ Count│ Count │ Count│ Count│ Count│  Count │
1909 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1910 │Age    │        0│    594│   476│   489│   526│    516│    531│         0│   505│    491│   548│   649│   731│     943│
1911 │group  │         │       │      │      │      │       │       │          │      │       │      │      │      │        │
1912 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1913
1914                 Custom Tables
1915 ╭──────────────────────────────┬────────────╮
1916 │                              │S3a. GENDER:│
1917 │                              ├────────────┤
1918 │                              │    Count   │
1919 ├──────────────────────────────┼────────────┤
1920 │Age group 15 or younger Male  │           0│
1921 │                        Female│           0│
1922 │         ╶────────────────────┼────────────┤
1923 │          16 to 25      Male  │         594│
1924 │                        Female│         505│
1925 │         ╶────────────────────┼────────────┤
1926 │          26 to 35      Male  │         476│
1927 │                        Female│         491│
1928 │         ╶────────────────────┼────────────┤
1929 │          36 to 45      Male  │         489│
1930 │                        Female│         548│
1931 │         ╶────────────────────┼────────────┤
1932 │          46 to 55      Male  │         526│
1933 │                        Female│         649│
1934 │         ╶────────────────────┼────────────┤
1935 │          56 to 65      Male  │         516│
1936 │                        Female│         731│
1937 │         ╶────────────────────┼────────────┤
1938 │          66 or older   Male  │         531│
1939 │                        Female│         943│
1940 ╰──────────────────────────────┴────────────╯
1941
1942       Custom Tables
1943 15 or younger
1944 ╭─────────┬────────────╮
1945 │         │S3a. GENDER:│
1946 │         ├─────┬──────┤
1947 │         │ Male│Female│
1948 │         ├─────┼──────┤
1949 │         │Count│ Count│
1950 ├─────────┼─────┼──────┤
1951 │Age group│    0│     0│
1952 ╰─────────┴─────┴──────╯
1953
1954       Custom Tables
1955 16 to 25
1956 ╭─────────┬────────────╮
1957 │         │S3a. GENDER:│
1958 │         ├─────┬──────┤
1959 │         │ Male│Female│
1960 │         ├─────┼──────┤
1961 │         │Count│ Count│
1962 ├─────────┼─────┼──────┤
1963 │Age group│  594│   505│
1964 ╰─────────┴─────┴──────╯
1965
1966       Custom Tables
1967 26 to 35
1968 ╭─────────┬────────────╮
1969 │         │S3a. GENDER:│
1970 │         ├─────┬──────┤
1971 │         │ Male│Female│
1972 │         ├─────┼──────┤
1973 │         │Count│ Count│
1974 ├─────────┼─────┼──────┤
1975 │Age group│  476│   491│
1976 ╰─────────┴─────┴──────╯
1977
1978       Custom Tables
1979 36 to 45
1980 ╭─────────┬────────────╮
1981 │         │S3a. GENDER:│
1982 │         ├─────┬──────┤
1983 │         │ Male│Female│
1984 │         ├─────┼──────┤
1985 │         │Count│ Count│
1986 ├─────────┼─────┼──────┤
1987 │Age group│  489│   548│
1988 ╰─────────┴─────┴──────╯
1989
1990       Custom Tables
1991 46 to 55
1992 ╭─────────┬────────────╮
1993 │         │S3a. GENDER:│
1994 │         ├─────┬──────┤
1995 │         │ Male│Female│
1996 │         ├─────┼──────┤
1997 │         │Count│ Count│
1998 ├─────────┼─────┼──────┤
1999 │Age group│  526│   649│
2000 ╰─────────┴─────┴──────╯
2001
2002       Custom Tables
2003 56 to 65
2004 ╭─────────┬────────────╮
2005 │         │S3a. GENDER:│
2006 │         ├─────┬──────┤
2007 │         │ Male│Female│
2008 │         ├─────┼──────┤
2009 │         │Count│ Count│
2010 ├─────────┼─────┼──────┤
2011 │Age group│  516│   731│
2012 ╰─────────┴─────┴──────╯
2013
2014       Custom Tables
2015 66 or older
2016 ╭─────────┬────────────╮
2017 │         │S3a. GENDER:│
2018 │         ├─────┬──────┤
2019 │         │ Male│Female│
2020 │         ├─────┼──────┤
2021 │         │Count│ Count│
2022 ├─────────┼─────┼──────┤
2023 │Age group│  531│   943│
2024 ╰─────────┴─────┴──────╯
2025
2026              Custom Tables
2027 Male
2028 ╭───────────────────────┬────────────╮
2029 │                       │S3a. GENDER:│
2030 │                       ├────────────┤
2031 │                       │    Count   │
2032 ├───────────────────────┼────────────┤
2033 │Age group 15 or younger│           0│
2034 │          16 to 25     │         594│
2035 │          26 to 35     │         476│
2036 │          36 to 45     │         489│
2037 │          46 to 55     │         526│
2038 │          56 to 65     │         516│
2039 │          66 or older  │         531│
2040 ╰───────────────────────┴────────────╯
2041
2042              Custom Tables
2043 Female
2044 ╭───────────────────────┬────────────╮
2045 │                       │S3a. GENDER:│
2046 │                       ├────────────┤
2047 │                       │    Count   │
2048 ├───────────────────────┼────────────┤
2049 │Age group 15 or younger│           0│
2050 │          16 to 25     │         505│
2051 │          26 to 35     │         491│
2052 │          36 to 45     │         548│
2053 │          46 to 55     │         649│
2054 │          56 to 65     │         731│
2055 │          66 or older  │         943│
2056 ╰───────────────────────┴────────────╯
2057 ])
2058 AT_CLEANUP
2059
2060 AT_SETUP([CTABLES missing values])
2061 AT_DATA([ctables.sps],
2062 [[DATA LIST LIST NOTABLE/x y.
2063 BEGIN DATA.
2064 1 1
2065 1 2
2066 1 3
2067 1 4
2068 1 5
2069 1 .
2070 2 1
2071 2 2
2072 2 3
2073 2 4
2074 2 5
2075 2 .
2076 3 1
2077 3 2
2078 3 3
2079 3 4
2080 3 5
2081 3 .
2082 4 1
2083 4 2
2084 4 3
2085 4 4
2086 4 5
2087 4 .
2088 5 1
2089 5 2
2090 5 3
2091 5 4
2092 5 5
2093 5 .
2094 . 1
2095 . 2
2096 . 3
2097 . 4
2098 . 5
2099 . .
2100 END DATA.
2101 MISSING VALUES x (1, 2) y (2, 3).
2102 VARIABLE LEVEL ALL (NOMINAL).
2103
2104 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
2105                  TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
2106     /CATEGORIES VARIABLES=ALL TOTAL=YES.
2107 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
2108                  TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
2109     /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
2110 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2111                       TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2112     /CATEGORIES VARIABLES=ALL TOTAL=YES
2113     /SLABELS POSITION=ROW.
2114 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2115                       TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2116     /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
2117     /SLABELS POSITION=ROW.
2118 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2119                       TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2120     /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES 
2121     /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES 
2122     /SLABELS POSITION=ROW.
2123 ]])
2124 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2125                                Custom Tables
2126 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
2127 │       │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
2128 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
2129 │x 3.00 │    6│   33.3%│           33.3%│           16.7%│       │       │
2130 │  4.00 │    6│   33.3%│           33.3%│           16.7%│       │       │
2131 │  5.00 │    6│   33.3%│           33.3%│           16.7%│       │       │
2132 │  Total│   18│  100.0%│          100.0%│          100.0%│     18│     36│
2133 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
2134 dnl Note that Column Total N % doesn't add up to 100 because missing
2135 dnl values are included in the total but not shown as a category and this
2136 dnl is expected behavior.
2137
2138                                Custom Tables
2139 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
2140 │       │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
2141 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
2142 │x 1.00 │    6│   20.0%│             .0%│           16.7%│       │       │
2143 │  2.00 │    6│   20.0%│             .0%│           16.7%│       │       │
2144 │  3.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
2145 │  4.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
2146 │  5.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
2147 │  Total│   30│  100.0%│          100.0%│          100.0%│     18│     36│
2148 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
2149 dnl Note that Column Total N % doesn't add up to 100 because system-missing
2150 dnl values are included in the total but not shown as a category and this
2151 dnl is expected behavior.
2152
2153                      Custom Tables
2154 ╭────────────────────────┬───────────────────────────╮
2155 │                        │             y             │
2156 │                        ├──────┬──────┬──────┬──────┤
2157 │                        │ 1.00 │ 4.00 │ 5.00 │ Total│
2158 ├────────────────────────┼──────┼──────┼──────┼──────┤
2159 │x 3.00  Count           │     1│     1│     1│     3│
2160 │        Column %        │ 33.3%│ 33.3%│ 33.3%│     .│
2161 │        Column Valid N %│ 33.3%│ 33.3%│ 33.3%│     .│
2162 │        Column Total N %│ 33.3%│ 33.3%│ 33.3%│     .│
2163 │        Row %           │ 33.3%│ 33.3%│ 33.3%│100.0%│
2164 │        Row Valid N %   │ 33.3%│ 33.3%│ 33.3%│100.0%│
2165 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│100.0%│
2166 │        Valid N         │      │      │      │     3│
2167 │        Total N         │      │      │      │     6│
2168 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2169 │  4.00  Count           │     1│     1│     1│     3│
2170 │        Column %        │ 33.3%│ 33.3%│ 33.3%│     .│
2171 │        Column Valid N %│ 33.3%│ 33.3%│ 33.3%│     .│
2172 │        Column Total N %│ 33.3%│ 33.3%│ 33.3%│     .│
2173 │        Row %           │ 33.3%│ 33.3%│ 33.3%│100.0%│
2174 │        Row Valid N %   │ 33.3%│ 33.3%│ 33.3%│100.0%│
2175 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│100.0%│
2176 │        Valid N         │      │      │      │     3│
2177 │        Total N         │      │      │      │     6│
2178 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2179 │  5.00  Count           │     1│     1│     1│     3│
2180 │        Column %        │ 33.3%│ 33.3%│ 33.3%│     .│
2181 │        Column Valid N %│ 33.3%│ 33.3%│ 33.3%│     .│
2182 │        Column Total N %│ 33.3%│ 33.3%│ 33.3%│     .│
2183 │        Row %           │ 33.3%│ 33.3%│ 33.3%│100.0%│
2184 │        Row Valid N %   │ 33.3%│ 33.3%│ 33.3%│100.0%│
2185 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│100.0%│
2186 │        Valid N         │      │      │      │     3│
2187 │        Total N         │      │      │      │     6│
2188 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2189 │  Total Count           │     3│     3│     3│     9│
2190 │        Column %        │100.0%│100.0%│100.0%│     .│
2191 │        Column Valid N %│100.0%│100.0%│100.0%│     .│
2192 │        Column Total N %│100.0%│100.0%│100.0%│     .│
2193 │        Row %           │     .│     .│     .│     .│
2194 │        Row Valid N %   │     .│     .│     .│     .│
2195 │        Row Total N %   │     .│     .│     .│     .│
2196 │        Valid N         │     3│     3│     3│     9│
2197 │        Total N         │     3│     3│     3│    18│
2198 ╰────────────────────────┴──────┴──────┴──────┴──────╯
2199
2200                             Custom Tables
2201 ╭────────────────────────┬─────────────────────────────────────────╮
2202 │                        │                    y                    │
2203 │                        ├──────┬──────┬──────┬──────┬──────┬──────┤
2204 │                        │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2205 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2206 │x 1.00  Count           │     1│     1│     1│     1│     1│     5│
2207 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2208 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2209 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2210 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2211 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2212 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2213 │        Valid N         │      │      │      │      │      │     3│
2214 │        Total N         │      │      │      │      │      │     6│
2215 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2216 │  2.00  Count           │     1│     1│     1│     1│     1│     5│
2217 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2218 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2219 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2220 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2221 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2222 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2223 │        Valid N         │      │      │      │      │      │     3│
2224 │        Total N         │      │      │      │      │      │     6│
2225 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2226 │  3.00  Count           │     1│     1│     1│     1│     1│     5│
2227 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2228 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2229 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2230 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2231 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2232 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2233 │        Valid N         │      │      │      │      │      │     3│
2234 │        Total N         │      │      │      │      │      │     6│
2235 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2236 │  4.00  Count           │     1│     1│     1│     1│     1│     5│
2237 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2238 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2239 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2240 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2241 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2242 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2243 │        Valid N         │      │      │      │      │      │     3│
2244 │        Total N         │      │      │      │      │      │     6│
2245 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2246 │  5.00  Count           │     1│     1│     1│     1│     1│     5│
2247 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2248 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2249 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2250 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2251 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2252 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2253 │        Valid N         │      │      │      │      │      │     3│
2254 │        Total N         │      │      │      │      │      │     6│
2255 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2256 │  Total Count           │     5│     5│     5│     5│     5│    25│
2257 │        Column %        │100.0%│100.0%│100.0%│100.0%│100.0%│     .│
2258 │        Column Valid N %│100.0%│     .│     .│100.0%│100.0%│     .│
2259 │        Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│     .│
2260 │        Row %           │     .│     .│     .│     .│     .│     .│
2261 │        Row Valid N %   │     .│     .│     .│     .│     .│     .│
2262 │        Row Total N %   │     .│     .│     .│     .│     .│     .│
2263 │        Valid N         │     5│     0│     0│     5│     5│    15│
2264 │        Total N         │     5│     5│     5│     5│     5│    30│
2265 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
2266
2267                         Custom Tables
2268 ╭────────────────────────┬──────────────────────────────────╮
2269 │                        │                 y                │
2270 │                        ├──────┬──────┬──────┬──────┬──────┤
2271 │                        │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2272 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
2273 │x 1.00  Count           │     1│     1│     1│     1│     4│
2274 │        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2275 │        Column Valid N %│ 25.0%│     .│ 25.0%│ 25.0%│     .│
2276 │        Column Total N %│ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2277 │        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2278 │        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
2279 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2280 │        Valid N         │      │      │      │      │     3│
2281 │        Total N         │      │      │      │      │     6│
2282 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2283 │  2.00  Count           │     1│     1│     1│     1│     4│
2284 │        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2285 │        Column Valid N %│ 25.0%│     .│ 25.0%│ 25.0%│     .│
2286 │        Column Total N %│ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2287 │        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2288 │        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
2289 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2290 │        Valid N         │      │      │      │      │     3│
2291 │        Total N         │      │      │      │      │     6│
2292 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2293 │  3.00  Count           │     1│     1│     1│     1│     4│
2294 │        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2295 │        Column Valid N %│ 25.0%│     .│ 25.0%│ 25.0%│     .│
2296 │        Column Total N %│ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2297 │        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2298 │        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
2299 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2300 │        Valid N         │      │      │      │      │     3│
2301 │        Total N         │      │      │      │      │     6│
2302 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2303 │  4.00  Count           │     1│     1│     1│     1│     4│
2304 │        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2305 │        Column Valid N %│ 25.0%│     .│ 25.0%│ 25.0%│     .│
2306 │        Column Total N %│ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2307 │        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2308 │        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
2309 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2310 │        Valid N         │      │      │      │      │     3│
2311 │        Total N         │      │      │      │      │     6│
2312 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2313 │  Total Count           │     4│     4│     4│     4│    16│
2314 │        Column %        │100.0%│100.0%│100.0%│100.0%│     .│
2315 │        Column Valid N %│100.0%│     .│100.0%│100.0%│     .│
2316 │        Column Total N %│100.0%│100.0%│100.0%│100.0%│     .│
2317 │        Row %           │     .│     .│     .│     .│     .│
2318 │        Row Valid N %   │     .│     .│     .│     .│     .│
2319 │        Row Total N %   │     .│     .│     .│     .│     .│
2320 │        Valid N         │     4│     0│     4│     4│    12│
2321 │        Total N         │     4│     4│     4│     4│    24│
2322 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2323 ])
2324 AT_CLEANUP
2325
2326 AT_SETUP([CTABLES SMISSING=LISTWISE])
2327 AT_KEYWORDS([SMISSING LISTWISE])
2328 AT_DATA([ctables.sps],
2329 [[DATA LIST LIST NOTABLE/x y z.
2330 BEGIN DATA.
2331 1  . 40
2332 1 10 50
2333 1 20 60
2334 1  .  .
2335 1 30  .
2336 END DATA.
2337 VARIABLE LEVEL x (NOMINAL).
2338
2339 CTABLES /TABLE (y + z) > x.
2340 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2341
2342 * The following doesn't come out as listwise because the tables are
2343 separate, not linked by an > operator.
2344 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2345 ]])
2346 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2347   Custom Tables
2348 ╭────────┬─────╮
2349 │        │ Mean│
2350 ├────────┼─────┤
2351 │y x 1.00│20.00│
2352 ├────────┼─────┤
2353 │z x 1.00│50.00│
2354 ╰────────┴─────╯
2355
2356   Custom Tables
2357 ╭────────┬─────╮
2358 │        │ Mean│
2359 ├────────┼─────┤
2360 │y x 1.00│15.00│
2361 ├────────┼─────┤
2362 │z x 1.00│55.00│
2363 ╰────────┴─────╯
2364
2365   Custom Tables
2366 ╭────────┬─────╮
2367 │        │ Mean│
2368 ├────────┼─────┤
2369 │y x 1.00│20.00│
2370 ├────────┼─────┤
2371 │z x 1.00│50.00│
2372 ╰────────┴─────╯
2373 ])
2374 AT_CLEANUP
2375
2376 AT_SETUP([CTABLES VLABELS - variables on different axes])
2377 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2378 AT_DATA([ctables.sps],
2379 [[GET 'nhtsa.sav'.
2380 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
2381 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME    /TABLE qnd5a BY qns3a.
2382 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL   /TABLE qnd5a BY qns3a.
2383 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH    /TABLE qnd5a BY qns3a.
2384 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE    /TABLE qnd5a BY qns3a.
2385 ]])
2386 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2387                                  Custom Tables
2388 ╭────────────────────────────────────────────────────────────────┬────────────╮
2389 │                                                                │S3a. GENDER:│
2390 │                                                                ├─────┬──────┤
2391 │                                                                │ Male│Female│
2392 │                                                                ├─────┼──────┤
2393 │                                                                │Count│ Count│
2394 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2395 │D5a. What would you say is your primary    Cuban                │   13│     7│
2396 │ethnic background?                         Mexican              │  175│   136│
2397 │                                           Spanish              │   20│    28│
2398 │                                           South American       │   21│    13│
2399 │                                           Central American     │   27│    25│
2400 │                                           Puerto Rican, OR     │   37│    41│
2401 │                                           Something else       │   35│    33│
2402 │                                           Multiple - cannot    │    2│     5│
2403 │                                           choose one           │     │      │
2404 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2405
2406                   Custom Tables
2407 ╭──────────────────────────────────┬────────────╮
2408 │                                  │    QNS3A   │
2409 │                                  ├─────┬──────┤
2410 │                                  │ Male│Female│
2411 │                                  ├─────┼──────┤
2412 │                                  │Count│ Count│
2413 ├──────────────────────────────────┼─────┼──────┤
2414 │QND5A Cuban                       │   13│     7│
2415 │      Mexican                     │  175│   136│
2416 │      Spanish                     │   20│    28│
2417 │      South American              │   21│    13│
2418 │      Central American            │   27│    25│
2419 │      Puerto Rican, OR            │   37│    41│
2420 │      Something else              │   35│    33│
2421 │      Multiple - cannot choose one│    2│     5│
2422 ╰──────────────────────────────────┴─────┴──────╯
2423
2424                                  Custom Tables
2425 ╭────────────────────────────────────────────────────────────────┬────────────╮
2426 │                                                                │S3a. GENDER:│
2427 │                                                                ├─────┬──────┤
2428 │                                                                │ Male│Female│
2429 │                                                                ├─────┼──────┤
2430 │                                                                │Count│ Count│
2431 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2432 │D5a. What would you say is your primary    Cuban                │   13│     7│
2433 │ethnic background?                         Mexican              │  175│   136│
2434 │                                           Spanish              │   20│    28│
2435 │                                           South American       │   21│    13│
2436 │                                           Central American     │   27│    25│
2437 │                                           Puerto Rican, OR     │   37│    41│
2438 │                                           Something else       │   35│    33│
2439 │                                           Multiple - cannot    │    2│     5│
2440 │                                           choose one           │     │      │
2441 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2442
2443                                  Custom Tables
2444 ╭────────────────────────────────────────────────────────────┬────────────────╮
2445 │                                                            │   QNS3A S3a.   │
2446 │                                                            │     GENDER:    │
2447 │                                                            ├───────┬────────┤
2448 │                                                            │  Male │ Female │
2449 │                                                            ├───────┼────────┤
2450 │                                                            │ Count │  Count │
2451 ├────────────────────────────────────────────────────────────┼───────┼────────┤
2452 │QND5A D5a. What would you say is your    Cuban              │     13│       7│
2453 │primary ethnic background?               Mexican            │    175│     136│
2454 │                                         Spanish            │     20│      28│
2455 │                                         South American     │     21│      13│
2456 │                                         Central American   │     27│      25│
2457 │                                         Puerto Rican, OR   │     37│      41│
2458 │                                         Something else     │     35│      33│
2459 │                                         Multiple - cannot  │      2│       5│
2460 │                                         choose one         │       │        │
2461 ╰────────────────────────────────────────────────────────────┴───────┴────────╯
2462
2463                Custom Tables
2464 ╭────────────────────────────┬─────┬──────╮
2465 │                            │ Male│Female│
2466 │                            ├─────┼──────┤
2467 │                            │Count│ Count│
2468 ├────────────────────────────┼─────┼──────┤
2469 │Cuban                       │   13│     7│
2470 │Mexican                     │  175│   136│
2471 │Spanish                     │   20│    28│
2472 │South American              │   21│    13│
2473 │Central American            │   27│    25│
2474 │Puerto Rican, OR            │   37│    41│
2475 │Something else              │   35│    33│
2476 │Multiple - cannot choose one│    2│     5│
2477 ╰────────────────────────────┴─────┴──────╯
2478 ])
2479 AT_CLEANUP
2480
2481 AT_SETUP([CTABLES VLABELS - stacked variables])
2482 AT_KEYWORDS([stack stacking])
2483 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2484 AT_DATA([ctables.sps],
2485 [[GET 'nhtsa.sav'.
2486 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a + qns3a.
2487 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a + qns3a.
2488 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a + qns3a.
2489 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2490 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2491 ]])
2492 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2493                                  Custom Tables
2494 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2495 │                                                                       │Count│
2496 ├───────────────────────────────────────────────────────────────────────┼─────┤
2497 │D5a. What would you say is your primary ethnic  Cuban                  │   20│
2498 │background?                                     Mexican                │  311│
2499 │                                                Spanish                │   48│
2500 │                                                South American         │   34│
2501 │                                                Central American       │   52│
2502 │                                                Puerto Rican, OR       │   78│
2503 │                                                Something else         │   68│
2504 │                                                Multiple - cannot      │    7│
2505 │                                                choose one             │     │
2506 ├───────────────────────────────────────────────────────────────────────┼─────┤
2507 │QNS3A                                           Male                   │ 3132│
2508 │                                                Female                 │ 3867│
2509 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2510
2511                   Custom Tables
2512 ╭─────────────────────────────────────────┬─────╮
2513 │                                         │Count│
2514 ├─────────────────────────────────────────┼─────┤
2515 │QND5A        Cuban                       │   20│
2516 │             Mexican                     │  311│
2517 │             Spanish                     │   48│
2518 │             South American              │   34│
2519 │             Central American            │   52│
2520 │             Puerto Rican, OR            │   78│
2521 │             Something else              │   68│
2522 │             Multiple - cannot choose one│    7│
2523 ├─────────────────────────────────────────┼─────┤
2524 │S3a. GENDER: Male                        │ 3132│
2525 │             Female                      │ 3867│
2526 ╰─────────────────────────────────────────┴─────╯
2527
2528                                  Custom Tables
2529 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2530 │                                                                       │Count│
2531 ├───────────────────────────────────────────────────────────────────────┼─────┤
2532 │D5a. What would you say is your primary ethnic  Cuban                  │   20│
2533 │background?                                     Mexican                │  311│
2534 │                                                Spanish                │   48│
2535 │                                                South American         │   34│
2536 │                                                Central American       │   52│
2537 │                                                Puerto Rican, OR       │   78│
2538 │                                                Something else         │   68│
2539 │                                                Multiple - cannot      │    7│
2540 │                                                choose one             │     │
2541 ├───────────────────────────────────────────────────────────────────────┼─────┤
2542 │Male                                                                   │ 3132│
2543 ├───────────────────────────────────────────────────────────────────────┼─────┤
2544 │Female                                                                 │ 3867│
2545 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2546
2547             Custom Tables
2548 ╭─────────────────────────────┬─────╮
2549 │                             │Count│
2550 ├─────────────────────────────┼─────┤
2551 │Cuban                        │   20│
2552 ├─────────────────────────────┼─────┤
2553 │Mexican                      │  311│
2554 ├─────────────────────────────┼─────┤
2555 │Spanish                      │   48│
2556 ├─────────────────────────────┼─────┤
2557 │South American               │   34│
2558 ├─────────────────────────────┼─────┤
2559 │Central American             │   52│
2560 ├─────────────────────────────┼─────┤
2561 │Puerto Rican, OR             │   78│
2562 ├─────────────────────────────┼─────┤
2563 │Something else               │   68│
2564 ├─────────────────────────────┼─────┤
2565 │Multiple - cannot choose one │    7│
2566 ├─────────────────────────────┼─────┤
2567 │S3a. GENDER:     Male        │ 3132│
2568 │                 Female      │ 3867│
2569 ╰─────────────────────────────┴─────╯
2570
2571             Custom Tables
2572 ╭────────────────────────────┬─────╮
2573 │                            │Count│
2574 ├────────────────────────────┼─────┤
2575 │Cuban                       │   20│
2576 │Mexican                     │  311│
2577 │Spanish                     │   48│
2578 │South American              │   34│
2579 │Central American            │   52│
2580 │Puerto Rican, OR            │   78│
2581 │Something else              │   68│
2582 │Multiple - cannot choose one│    7│
2583 │Male                        │ 3132│
2584 │Female                      │ 3867│
2585 ╰────────────────────────────┴─────╯
2586 ])
2587 AT_CLEANUP
2588
2589 AT_SETUP([CTABLES VLABELS - nested variables])
2590 AT_KEYWORDS([nest nesting])
2591 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2592 AT_DATA([ctables.sps],
2593 [[GET 'nhtsa.sav'.
2594 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a > qns3a.
2595 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a > qns3a.
2596 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a > qns3a.
2597 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2598 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2599 ]])
2600 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2601                                  Custom Tables
2602 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2603 │                                                                       │Count│
2604 ├───────────────────────────────────────────────────────────────────────┼─────┤
2605 │D5a. What would you say is your       Cuban                QNS3A Male  │   13│
2606 │primary ethnic background?                                       Female│    7│
2607 │                                     ╶─────────────────────────────────┼─────┤
2608 │                                      Mexican              QNS3A Male  │  175│
2609 │                                                                 Female│  136│
2610 │                                     ╶─────────────────────────────────┼─────┤
2611 │                                      Spanish              QNS3A Male  │   20│
2612 │                                                                 Female│   28│
2613 │                                     ╶─────────────────────────────────┼─────┤
2614 │                                      South American       QNS3A Male  │   21│
2615 │                                                                 Female│   13│
2616 │                                     ╶─────────────────────────────────┼─────┤
2617 │                                      Central American     QNS3A Male  │   27│
2618 │                                                                 Female│   25│
2619 │                                     ╶─────────────────────────────────┼─────┤
2620 │                                      Puerto Rican, OR     QNS3A Male  │   37│
2621 │                                                                 Female│   41│
2622 │                                     ╶─────────────────────────────────┼─────┤
2623 │                                      Something else       QNS3A Male  │   35│
2624 │                                                                 Female│   33│
2625 │                                     ╶─────────────────────────────────┼─────┤
2626 │                                      Multiple - cannot    QNS3A Male  │    2│
2627 │                                      choose one                 Female│    5│
2628 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2629
2630                          Custom Tables
2631 ╭──────────────────────────────────────────────────────┬─────╮
2632 │                                                      │Count│
2633 ├──────────────────────────────────────────────────────┼─────┤
2634 │QND5A Cuban                        S3a. GENDER: Male  │   13│
2635 │                                                Female│    7│
2636 │     ╶────────────────────────────────────────────────┼─────┤
2637 │      Mexican                      S3a. GENDER: Male  │  175│
2638 │                                                Female│  136│
2639 │     ╶────────────────────────────────────────────────┼─────┤
2640 │      Spanish                      S3a. GENDER: Male  │   20│
2641 │                                                Female│   28│
2642 │     ╶────────────────────────────────────────────────┼─────┤
2643 │      South American               S3a. GENDER: Male  │   21│
2644 │                                                Female│   13│
2645 │     ╶────────────────────────────────────────────────┼─────┤
2646 │      Central American             S3a. GENDER: Male  │   27│
2647 │                                                Female│   25│
2648 │     ╶────────────────────────────────────────────────┼─────┤
2649 │      Puerto Rican, OR             S3a. GENDER: Male  │   37│
2650 │                                                Female│   41│
2651 │     ╶────────────────────────────────────────────────┼─────┤
2652 │      Something else               S3a. GENDER: Male  │   35│
2653 │                                                Female│   33│
2654 │     ╶────────────────────────────────────────────────┼─────┤
2655 │      Multiple - cannot choose one S3a. GENDER: Male  │    2│
2656 │                                                Female│    5│
2657 ╰──────────────────────────────────────────────────────┴─────╯
2658
2659                                  Custom Tables
2660 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2661 │                                                                       │Count│
2662 ├───────────────────────────────────────────────────────────────────────┼─────┤
2663 │D5a. What would you say is your primary    Cuban                 Male  │   13│
2664 │ethnic background?                                               Female│    7│
2665 │                                          ╶────────────────────────────┼─────┤
2666 │                                           Mexican               Male  │  175│
2667 │                                                                 Female│  136│
2668 │                                          ╶────────────────────────────┼─────┤
2669 │                                           Spanish               Male  │   20│
2670 │                                                                 Female│   28│
2671 │                                          ╶────────────────────────────┼─────┤
2672 │                                           South American        Male  │   21│
2673 │                                                                 Female│   13│
2674 │                                          ╶────────────────────────────┼─────┤
2675 │                                           Central American      Male  │   27│
2676 │                                                                 Female│   25│
2677 │                                          ╶────────────────────────────┼─────┤
2678 │                                           Puerto Rican, OR      Male  │   37│
2679 │                                                                 Female│   41│
2680 │                                          ╶────────────────────────────┼─────┤
2681 │                                           Something else        Male  │   35│
2682 │                                                                 Female│   33│
2683 │                                          ╶────────────────────────────┼─────┤
2684 │                                           Multiple - cannot     Male  │    2│
2685 │                                           choose one            Female│    5│
2686 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2687
2688                       Custom Tables
2689 ╭────────────────────────────────────────────────┬─────╮
2690 │                                                │Count│
2691 ├────────────────────────────────────────────────┼─────┤
2692 │Cuban                        S3a. GENDER: Male  │   13│
2693 │                                          Female│    7│
2694 ├────────────────────────────────────────────────┼─────┤
2695 │Mexican                      S3a. GENDER: Male  │  175│
2696 │                                          Female│  136│
2697 ├────────────────────────────────────────────────┼─────┤
2698 │Spanish                      S3a. GENDER: Male  │   20│
2699 │                                          Female│   28│
2700 ├────────────────────────────────────────────────┼─────┤
2701 │South American               S3a. GENDER: Male  │   21│
2702 │                                          Female│   13│
2703 ├────────────────────────────────────────────────┼─────┤
2704 │Central American             S3a. GENDER: Male  │   27│
2705 │                                          Female│   25│
2706 ├────────────────────────────────────────────────┼─────┤
2707 │Puerto Rican, OR             S3a. GENDER: Male  │   37│
2708 │                                          Female│   41│
2709 ├────────────────────────────────────────────────┼─────┤
2710 │Something else               S3a. GENDER: Male  │   35│
2711 │                                          Female│   33│
2712 ├────────────────────────────────────────────────┼─────┤
2713 │Multiple - cannot choose one S3a. GENDER: Male  │    2│
2714 │                                          Female│    5│
2715 ╰────────────────────────────────────────────────┴─────╯
2716
2717                Custom Tables
2718 ╭───────────────────────────────────┬─────╮
2719 │                                   │Count│
2720 ├───────────────────────────────────┼─────┤
2721 │Cuban                        Male  │   13│
2722 │                             Female│    7│
2723 ├───────────────────────────────────┼─────┤
2724 │Mexican                      Male  │  175│
2725 │                             Female│  136│
2726 ├───────────────────────────────────┼─────┤
2727 │Spanish                      Male  │   20│
2728 │                             Female│   28│
2729 ├───────────────────────────────────┼─────┤
2730 │South American               Male  │   21│
2731 │                             Female│   13│
2732 ├───────────────────────────────────┼─────┤
2733 │Central American             Male  │   27│
2734 │                             Female│   25│
2735 ├───────────────────────────────────┼─────┤
2736 │Puerto Rican, OR             Male  │   37│
2737 │                             Female│   41│
2738 ├───────────────────────────────────┼─────┤
2739 │Something else               Male  │   35│
2740 │                             Female│   33│
2741 ├───────────────────────────────────┼─────┤
2742 │Multiple - cannot choose one Male  │    2│
2743 │                             Female│    5│
2744 ╰───────────────────────────────────┴─────╯
2745 ])
2746 AT_CLEANUP
2747
2748 AT_SETUP([CTABLES FORMAT EMPTY])
2749 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2750 AT_DATA([ctables.sps],
2751 [[GET 'nhtsa.sav'.
2752 CTABLES /FORMAT EMPTY=ZERO /TABLE qnd5a BY qnd5.
2753 CTABLES /FORMAT EMPTY=BLANK /TABLE qnd5a BY qnd5.
2754 CTABLES /FORMAT EMPTY='n/a' /TABLE qnd5a BY qnd5.
2755 ]])
2756 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2757                                  Custom Tables
2758 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2759 │                                             │   D5. ETHNICITY: Are you of   │
2760 │                                             │  Hispanic or Latino origin or │
2761 │                                             │            descent?           │
2762 │                                             ├───────────────┬───────────────┤
2763 │                                             │      Yes      │       No      │
2764 │                                             ├───────────────┼───────────────┤
2765 │                                             │     Count     │     Count     │
2766 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2767 │D5a. What would you say is   Cuban           │             20│              0│
2768 │your primary ethnic          Mexican         │            311│              0│
2769 │background?                  Spanish         │             48│              0│
2770 │                             South American  │             34│              0│
2771 │                             Central American│             52│              0│
2772 │                             Puerto Rican, OR│             78│              0│
2773 │                             Something else  │             68│              0│
2774 │                             Multiple -      │              7│              0│
2775 │                             cannot choose   │               │               │
2776 │                             one             │               │               │
2777 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2778
2779                                  Custom Tables
2780 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2781 │                                             │   D5. ETHNICITY: Are you of   │
2782 │                                             │  Hispanic or Latino origin or │
2783 │                                             │            descent?           │
2784 │                                             ├───────────────┬───────────────┤
2785 │                                             │      Yes      │       No      │
2786 │                                             ├───────────────┼───────────────┤
2787 │                                             │     Count     │     Count     │
2788 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2789 │D5a. What would you say is   Cuban           │             20│               │
2790 │your primary ethnic          Mexican         │            311│               │
2791 │background?                  Spanish         │             48│               │
2792 │                             South American  │             34│               │
2793 │                             Central American│             52│               │
2794 │                             Puerto Rican, OR│             78│               │
2795 │                             Something else  │             68│               │
2796 │                             Multiple -      │              7│               │
2797 │                             cannot choose   │               │               │
2798 │                             one             │               │               │
2799 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2800
2801                                  Custom Tables
2802 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2803 │                                             │   D5. ETHNICITY: Are you of   │
2804 │                                             │  Hispanic or Latino origin or │
2805 │                                             │            descent?           │
2806 │                                             ├───────────────┬───────────────┤
2807 │                                             │      Yes      │       No      │
2808 │                                             ├───────────────┼───────────────┤
2809 │                                             │     Count     │     Count     │
2810 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2811 │D5a. What would you say is   Cuban           │             20│n/a            │
2812 │your primary ethnic          Mexican         │            311│n/a            │
2813 │background?                  Spanish         │             48│n/a            │
2814 │                             South American  │             34│n/a            │
2815 │                             Central American│             52│n/a            │
2816 │                             Puerto Rican, OR│             78│n/a            │
2817 │                             Something else  │             68│n/a            │
2818 │                             Multiple -      │              7│n/a            │
2819 │                             cannot choose   │               │               │
2820 │                             one             │               │               │
2821 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2822 ])
2823 AT_CLEANUP
2824
2825 AT_SETUP([CTABLES FORMAT MISSING])
2826 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2827 AT_DATA([ctables.sps],
2828 [[GET 'nhtsa.sav'.
2829 CTABLES /FORMAT MISSING='(no data)' /TABLE qnd5a[COLPCT] BY qnd5.
2830 ]])
2831 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2832                                  Custom Tables
2833 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2834 │                                             │   D5. ETHNICITY: Are you of   │
2835 │                                             │  Hispanic or Latino origin or │
2836 │                                             │            descent?           │
2837 │                                             ├───────────────┬───────────────┤
2838 │                                             │      Yes      │       No      │
2839 │                                             ├───────────────┼───────────────┤
2840 │                                             │    Column %   │    Column %   │
2841 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2842 │D5a. What would you say is   Cuban           │           3.2%│(no data)      │
2843 │your primary ethnic          Mexican         │          50.3%│(no data)      │
2844 │background?                  Spanish         │           7.8%│(no data)      │
2845 │                             South American  │           5.5%│(no data)      │
2846 │                             Central American│           8.4%│(no data)      │
2847 │                             Puerto Rican, OR│          12.6%│(no data)      │
2848 │                             Something else  │          11.0%│(no data)      │
2849 │                             Multiple -      │           1.1%│(no data)      │
2850 │                             cannot choose   │               │               │
2851 │                             one             │               │               │
2852 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2853 ])
2854 AT_CLEANUP
2855
2856 AT_SETUP([CTABLES HIDESMALLCOUNTS])
2857 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2858 AT_DATA([ctables.sps],
2859 [[GET 'nhtsa.sav'.
2860 CTABLES /TABLE qn38[c][COUNT, COLPCT].
2861 CTABLES /HIDESMALLCOUNTS /TABLE qn38[c][COUNT, COLPCT].
2862 CTABLES /HIDESMALLCOUNTS COUNT=10 /TABLE qn38[c][COUNT, COLPCT].
2863 ]])
2864 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2865                                  Custom Tables
2866 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2867 │                                                              │Count│Column %│
2868 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2869 │38. How many drinks did you have on that         Less than one│    7│     .5%│
2870 │occasion?                                        1            │  491│   34.9%│
2871 │                                                 2            │  462│   32.9%│
2872 │                                                 3            │  229│   16.3%│
2873 │                                                 4            │   82│    5.8%│
2874 │                                                 5            │   56│    4.0%│
2875 │                                                 6            │   32│    2.3%│
2876 │                                                 7            │    9│     .6%│
2877 │                                                 8            │    8│     .6%│
2878 │                                                 9            │    4│     .3%│
2879 │                                                 10           │    6│     .4%│
2880 │                                                 11           │    2│     .1%│
2881 │                                                 12           │    5│     .4%│
2882 │                                                 14           │    1│     .1%│
2883 │                                                 15           │    1│     .1%│
2884 │                                                 18           │    1│     .1%│
2885 │                                                 20           │    4│     .3%│
2886 │                                                 25           │    1│     .1%│
2887 │                                                 30           │    3│     .2%│
2888 │                                                 60           │    1│     .1%│
2889 │                                                 99+          │    0│     .0%│
2890 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2891
2892                                  Custom Tables
2893 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2894 │                                                              │Count│Column %│
2895 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2896 │38. How many drinks did you have on that         Less than one│    7│     .5%│
2897 │occasion?                                        1            │  491│   34.9%│
2898 │                                                 2            │  462│   32.9%│
2899 │                                                 3            │  229│   16.3%│
2900 │                                                 4            │   82│    5.8%│
2901 │                                                 5            │   56│    4.0%│
2902 │                                                 6            │   32│    2.3%│
2903 │                                                 7            │    9│     .6%│
2904 │                                                 8            │    8│     .6%│
2905 │                                                 9            │<5   │     .3%│
2906 │                                                 10           │    6│     .4%│
2907 │                                                 11           │<5   │     .1%│
2908 │                                                 12           │    5│     .4%│
2909 │                                                 14           │<5   │     .1%│
2910 │                                                 15           │<5   │     .1%│
2911 │                                                 18           │<5   │     .1%│
2912 │                                                 20           │<5   │     .3%│
2913 │                                                 25           │<5   │     .1%│
2914 │                                                 30           │<5   │     .2%│
2915 │                                                 60           │<5   │     .1%│
2916 │                                                 99+          │<5   │     .0%│
2917 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2918
2919                                  Custom Tables
2920 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2921 │                                                              │Count│Column %│
2922 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2923 │38. How many drinks did you have on that         Less than one│<10  │     .5%│
2924 │occasion?                                        1            │  491│   34.9%│
2925 │                                                 2            │  462│   32.9%│
2926 │                                                 3            │  229│   16.3%│
2927 │                                                 4            │   82│    5.8%│
2928 │                                                 5            │   56│    4.0%│
2929 │                                                 6            │   32│    2.3%│
2930 │                                                 7            │<10  │     .6%│
2931 │                                                 8            │<10  │     .6%│
2932 │                                                 9            │<10  │     .3%│
2933 │                                                 10           │<10  │     .4%│
2934 │                                                 11           │<10  │     .1%│
2935 │                                                 12           │<10  │     .4%│
2936 │                                                 14           │<10  │     .1%│
2937 │                                                 15           │<10  │     .1%│
2938 │                                                 18           │<10  │     .1%│
2939 │                                                 20           │<10  │     .3%│
2940 │                                                 25           │<10  │     .1%│
2941 │                                                 30           │<10  │     .2%│
2942 │                                                 60           │<10  │     .1%│
2943 │                                                 99+          │<10  │     .0%│
2944 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2945 ])
2946 AT_CLEANUP
2947
2948 AT_SETUP([CTABLES FORMAT MINCOLWIDTH MAXCOLWIDTH])
2949 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2950 AT_DATA([ctables.sps],
2951 [[GET 'nhtsa.sav'.
2952 CTABLES /FORMAT MINCOLWIDTH=1 MAXCOLWIDTH=2 UNITS=INCHES /TABLE BY qns3a.
2953 ]])
2954 AT_CHECK([pspp ctables.sps -o - -O box=unicode -o pspp.spv], [0], [dnl
2955  Custom Tables
2956 ╭────────────╮
2957 │S3a. GENDER:│
2958 ├─────┬──────┤
2959 │ Male│Female│
2960 ├─────┼──────┤
2961 │Count│ Count│
2962 ├─────┼──────┤
2963 │ 3132│  3867│
2964 ╰─────┴──────╯
2965 ])
2966 AT_CHECK([pspp-output get-table-look pspp.spv pspp.stt])
2967 AT_CHECK([sed 's/ /\n/g' pspp.stt | grep ColumnWidth | sort], [0], [dnl
2968 maximumColumnWidth="192"
2969 minimumColumnWidth="96"
2970 ])
2971 AT_CLEANUP
2972
2973 AT_SETUP([CTABLES special formats])
2974 AT_KEYWORDS([NEGPAREN NEQUAL PAREN PCTPAREN])
2975 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2976 AT_DATA([ctables.sps],
2977 [[GET 'nhtsa.sav'.
2978 COMPUTE x = qnd3 - 4.
2979 CTABLES /TABLE x[MINIMUM NEGPAREN8.1, MINIMUM NEQUAL8.1, MINIMUM PAREN8.1, MINIMUM PCTPAREN8.1, MAXIMUM NEGPAREN8.1, MAXIMUM NEQUAL8.1, MAXIMUM PAREN8.1, MAXIMUM PCTPAREN8.1].
2980 ]])
2981 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2982                            Custom Tables
2983 ╭─┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────╮
2984 │ │Minimum│Minimum│Minimum│Minimum│Maximum│Maximum│Maximum│Maximum│
2985 ├─┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
2986 │x│(3.0)  │N=-3.0 │(-3.0) │(-3.0%)│8.0    │N=8.0  │(8.0)  │(8.0%) │
2987 ╰─┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────╯
2988 ])
2989 AT_CLEANUP
2990
2991 AT_SETUP([CTABLES TITLES])
2992 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2993 AT_DATA([ctables.sps],
2994 [[GET 'nhtsa.sav'.
2995 CTABLES
2996     /VLABELS VARIABLES=qn1 DISPLAY=NONE
2997     /TABLE ((qn1[c][COUNT])) BY qns3a[c] > qnd5
2998     /TITLES TITLE='How often do you drive?'
2999             CAPTION='Generated )TIME on )DATE'
3000             CORNER=')TABLE'.
3001 ]])
3002 AT_CHECK([pspp ctables.sps -O box=unicode | sed 's/..:..:../HH:MM:SS/
3003 s&../../..&MM/DD/YY&'], [0], [dnl
3004                             How often do you drive?
3005 ╭───────────────────────────────────┬─────────────────────────────────────────╮
3006 │                                   │               S3a. GENDER:              │
3007 │                                   ├────────────────────┬────────────────────┤
3008 │                                   │        Male        │       Female       │
3009 │                                   ├────────────────────┼────────────────────┤
3010 │                                   │ D5. ETHNICITY: Are │ D5. ETHNICITY: Are │
3011 │                                   │ you of Hispanic or │ you of Hispanic or │
3012 │                                   │  Latino origin or  │  Latino origin or  │
3013 │( ( 1. How often do you usually    │      descent?      │      descent?      │
3014 │drive a car or other motor         ├─────────┬──────────┼─────────┬──────────┤
3015 │vehicle?) ) BY S3a. GENDER: > D5.  │   Yes   │    No    │   Yes   │    No    │
3016 │ETHNICITY: Are you of Hispanic or  ├─────────┼──────────┼─────────┼──────────┤
3017 │Latino origin or descent?          │  Count  │   Count  │  Count  │   Count  │
3018 ├───────────────────────────────────┼─────────┼──────────┼─────────┼──────────┤
3019 │Every day                          │      218│      2066│      166│      2175│
3020 │Several days a week                │       44│       391│       45│       782│
3021 │Once a week or less                │       16│       109│       12│       223│
3022 │Only certain times a year          │       15│        41│       11│        61│
3023 │Never                              │       39│       150│       56│       278│
3024 ╰───────────────────────────────────┴─────────┴──────────┴─────────┴──────────╯
3025 Generated HH:MM:SS on MM/DD/YY
3026 ])
3027 AT_CLEANUP
3028
3029 AT_SETUP([CTABLES area definitions])
3030 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3031 AT_DATA([ctables.sps],
3032 [[GET 'nhtsa.sav'.
3033 CTABLES
3034     /VLABELS VARIABLES=ALL DISPLAY=NAME
3035     /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3036     /SLABELS POSITION=ROW
3037     /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[ROWID, LAYERROWID]
3038     /SLABELS POSITION=ROW
3039     /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[COLID, LAYERCOLID]
3040     /SLABELS POSITION=ROW.
3041 ]])
3042 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=80], [0], [dnl
3043                     Custom Tables
3044 Male
3045 ╭─────────────────────────────┬─────────────┬──────╮
3046 │                             │    QND7A    │ QN64B│
3047 │                             ├──────┬──────┼───┬──┤
3048 │                             │  Yes │  No  │   │  │
3049 │                             ├──────┼──────┤   │  │
3050 │                             │ QN86 │ QN86 │   │  │
3051 │                             ├───┬──┼───┬──┤   │  │
3052 │                             │Yes│No│Yes│No│Yes│No│
3053 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
3054 │QN61 Yes QN57 Yes Table ID   │  1│ 1│  1│ 1│  2│ 2│
3055 │                  Layer ID   │  1│ 1│  1│ 1│  2│ 2│
3056 │                  Subtable ID│  1│ 1│  2│ 2│  3│ 3│
3057 │             ╶───────────────┼───┼──┼───┼──┼───┼──┤
3058 │              No  Table ID   │  1│ 1│  1│ 1│  2│ 2│
3059 │                  Layer ID   │  1│ 1│  1│ 1│  2│ 2│
3060 │                  Subtable ID│  1│ 1│  2│ 2│  3│ 3│
3061 │    ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
3062 │     No  QN57 Yes Table ID   │  1│ 1│  1│ 1│  2│ 2│
3063 │                  Layer ID   │  1│ 1│  1│ 1│  2│ 2│
3064 │                  Subtable ID│  4│ 4│  5│ 5│  6│ 6│
3065 │             ╶───────────────┼───┼──┼───┼──┼───┼──┤
3066 │              No  Table ID   │  1│ 1│  1│ 1│  2│ 2│
3067 │                  Layer ID   │  1│ 1│  1│ 1│  2│ 2│
3068 │                  Subtable ID│  4│ 4│  5│ 5│  6│ 6│
3069 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
3070
3071                     Custom Tables
3072 Female
3073 ╭─────────────────────────────┬─────────────┬──────╮
3074 │                             │    QND7A    │ QN64B│
3075 │                             ├──────┬──────┼───┬──┤
3076 │                             │  Yes │  No  │   │  │
3077 │                             ├──────┼──────┤   │  │
3078 │                             │ QN86 │ QN86 │   │  │
3079 │                             ├───┬──┼───┬──┤   │  │
3080 │                             │Yes│No│Yes│No│Yes│No│
3081 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
3082 │QN61 Yes QN57 Yes Table ID   │  1│ 1│  1│ 1│  2│ 2│
3083 │                  Layer ID   │  3│ 3│  3│ 3│  4│ 4│
3084 │                  Subtable ID│  7│ 7│  8│ 8│  9│ 9│
3085 │             ╶───────────────┼───┼──┼───┼──┼───┼──┤
3086 │              No  Table ID   │  1│ 1│  1│ 1│  2│ 2│
3087 │                  Layer ID   │  3│ 3│  3│ 3│  4│ 4│
3088 │                  Subtable ID│  7│ 7│  8│ 8│  9│ 9│
3089 │    ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
3090 │     No  QN57 Yes Table ID   │  1│ 1│  1│ 1│  2│ 2│
3091 │                  Layer ID   │  3│ 3│  3│ 3│  4│ 4│
3092 │                  Subtable ID│ 10│10│ 11│11│ 12│12│
3093 │             ╶───────────────┼───┼──┼───┼──┼───┼──┤
3094 │              No  Table ID   │  1│ 1│  1│ 1│  2│ 2│
3095 │                  Layer ID   │  3│ 3│  3│ 3│  4│ 4│
3096 │                  Subtable ID│ 10│10│ 11│11│ 12│12│
3097 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
3098
3099                     Custom Tables
3100 Male
3101 ╭──────────────────────────────┬─────────────┬──────╮
3102 │                              │    QND7A    │ QN64B│
3103 │                              ├──────┬──────┼───┬──┤
3104 │                              │  Yes │  No  │   │  │
3105 │                              ├──────┼──────┤   │  │
3106 │                              │ QN86 │ QN86 │   │  │
3107 │                              ├───┬──┼───┬──┤   │  │
3108 │                              │Yes│No│Yes│No│Yes│No│
3109 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
3110 │QN61 Yes QN57 Yes Row ID      │  1│ 1│  2│ 2│  3│ 3│
3111 │                  Layer Row ID│  1│ 1│  1│ 1│  2│ 2│
3112 │             ╶────────────────┼───┼──┼───┼──┼───┼──┤
3113 │              No  Row ID      │  4│ 4│  5│ 5│  6│ 6│
3114 │                  Layer Row ID│  3│ 3│  3│ 3│  4│ 4│
3115 │    ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
3116 │     No  QN57 Yes Row ID      │  7│ 7│  8│ 8│  9│ 9│
3117 │                  Layer Row ID│  5│ 5│  5│ 5│  6│ 6│
3118 │             ╶────────────────┼───┼──┼───┼──┼───┼──┤
3119 │              No  Row ID      │ 10│10│ 11│11│ 12│12│
3120 │                  Layer Row ID│  7│ 7│  7│ 7│  8│ 8│
3121 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
3122
3123                     Custom Tables
3124 Female
3125 ╭──────────────────────────────┬─────────────┬──────╮
3126 │                              │    QND7A    │ QN64B│
3127 │                              ├──────┬──────┼───┬──┤
3128 │                              │  Yes │  No  │   │  │
3129 │                              ├──────┼──────┤   │  │
3130 │                              │ QN86 │ QN86 │   │  │
3131 │                              ├───┬──┼───┬──┤   │  │
3132 │                              │Yes│No│Yes│No│Yes│No│
3133 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
3134 │QN61 Yes QN57 Yes Row ID      │ 13│13│ 14│14│ 15│15│
3135 │                  Layer Row ID│  9│ 9│  9│ 9│ 10│10│
3136 │             ╶────────────────┼───┼──┼───┼──┼───┼──┤
3137 │              No  Row ID      │ 16│16│ 17│17│ 18│18│
3138 │                  Layer Row ID│ 11│11│ 11│11│ 12│12│
3139 │    ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
3140 │     No  QN57 Yes Row ID      │ 19│19│ 20│20│ 21│21│
3141 │                  Layer Row ID│ 13│13│ 13│13│ 14│14│
3142 │             ╶────────────────┼───┼──┼───┼──┼───┼──┤
3143 │              No  Row ID      │ 22│22│ 23│23│ 24│24│
3144 │                  Layer Row ID│ 15│15│ 15│15│ 16│16│
3145 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
3146
3147                       Custom Tables
3148 Male
3149 ╭─────────────────────────────────┬─────────────┬──────╮
3150 │                                 │    QND7A    │ QN64B│
3151 │                                 ├──────┬──────┼───┬──┤
3152 │                                 │  Yes │  No  │   │  │
3153 │                                 ├──────┼──────┤   │  │
3154 │                                 │ QN86 │ QN86 │   │  │
3155 │                                 ├───┬──┼───┬──┤   │  │
3156 │                                 │Yes│No│Yes│No│Yes│No│
3157 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
3158 │QN61 Yes QN57 Yes Column ID      │  1│ 2│  3│ 4│  5│ 6│
3159 │                  Layer Column ID│  1│ 2│  3│ 4│  5│ 6│
3160 │             ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3161 │              No  Column ID      │  1│ 2│  3│ 4│  5│ 6│
3162 │                  Layer Column ID│  1│ 2│  3│ 4│  5│ 6│
3163 │    ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3164 │     No  QN57 Yes Column ID      │  7│ 8│  9│10│ 11│12│
3165 │                  Layer Column ID│  1│ 2│  3│ 4│  5│ 6│
3166 │             ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3167 │              No  Column ID      │  7│ 8│  9│10│ 11│12│
3168 │                  Layer Column ID│  1│ 2│  3│ 4│  5│ 6│
3169 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3170
3171                       Custom Tables
3172 Female
3173 ╭─────────────────────────────────┬─────────────┬──────╮
3174 │                                 │    QND7A    │ QN64B│
3175 │                                 ├──────┬──────┼───┬──┤
3176 │                                 │  Yes │  No  │   │  │
3177 │                                 ├──────┼──────┤   │  │
3178 │                                 │ QN86 │ QN86 │   │  │
3179 │                                 ├───┬──┼───┬──┤   │  │
3180 │                                 │Yes│No│Yes│No│Yes│No│
3181 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
3182 │QN61 Yes QN57 Yes Column ID      │ 13│14│ 15│16│ 17│18│
3183 │                  Layer Column ID│  7│ 8│  9│10│ 11│12│
3184 │             ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3185 │              No  Column ID      │ 13│14│ 15│16│ 17│18│
3186 │                  Layer Column ID│  7│ 8│  9│10│ 11│12│
3187 │    ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3188 │     No  QN57 Yes Column ID      │ 19│20│ 21│22│ 23│24│
3189 │                  Layer Column ID│  7│ 8│  9│10│ 11│12│
3190 │             ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3191 │              No  Column ID      │ 19│20│ 21│22│ 23│24│
3192 │                  Layer Column ID│  7│ 8│  9│10│ 11│12│
3193 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3194 ])
3195 AT_CLEANUP
3196
3197 AT_SETUP([CTABLES area definitions with CLABELS ROWLABELS=OPPOSITE])
3198 AT_KEYWORDS([ROWLABELS OPPOSITE])
3199 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3200 AT_DATA([ctables.sps],
3201 [[GET 'nhtsa.sav'.
3202 CTABLES
3203     /VLABELS VARIABLES=ALL DISPLAY=NAME
3204     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3205     /SLABELS POSITION=ROW
3206     /CLABELS ROWLABELS=OPPOSITE
3207     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3208     /SLABELS POSITION=ROW
3209     /CLABELS ROWLABELS=OPPOSITE
3210     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3211     /SLABELS POSITION=ROW
3212     /CLABELS ROWLABELS=OPPOSITE.
3213 ]])
3214 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3215                                         Custom Tables
3216 Male
3217 ╭──────────────────────────────────┬───────────────────────────────────────────────────────╮
3218 │                                  │                          QN27                         │
3219 │                                  ├───────────────────────────┬───────────────────────────┤
3220 │                                  │            Yes            │             No            │
3221 │                                  ├───────────────────────────┼───────────────────────────┤
3222 │                                  │           QND7A           │           QND7A           │
3223 │                                  ├─────────────┬─────────────┼─────────────┬─────────────┤
3224 │                                  │     Yes     │      No     │     Yes     │      No     │
3225 │                                  ├─────────────┼─────────────┼─────────────┼─────────────┤
3226 │                                  │     QN86    │     QN86    │     QN86    │     QN86    │
3227 │                                  ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3228 │                                  │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3229 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3230 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3231 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3232 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3233 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3234 │                       Subtable ID│  1│ 1│  2│ 2│  3│ 3│  4│ 4│  5│ 5│  6│ 6│  7│ 7│  8│ 8│
3235 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3236 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3237 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3238 │                       Subtable ID│  1│ 1│  2│ 2│  3│ 3│  4│ 4│  5│ 5│  6│ 6│  7│ 7│  8│ 8│
3239 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3240 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3241 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3242 │                       Subtable ID│  9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3243 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3244 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3245 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3246 │                       Subtable ID│  9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3247 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3248
3249                                         Custom Tables
3250 Female
3251 ╭──────────────────────────────────┬───────────────────────────────────────────────────────╮
3252 │                                  │                          QN27                         │
3253 │                                  ├───────────────────────────┬───────────────────────────┤
3254 │                                  │            Yes            │             No            │
3255 │                                  ├───────────────────────────┼───────────────────────────┤
3256 │                                  │           QND7A           │           QND7A           │
3257 │                                  ├─────────────┬─────────────┼─────────────┬─────────────┤
3258 │                                  │     Yes     │      No     │     Yes     │      No     │
3259 │                                  ├─────────────┼─────────────┼─────────────┼─────────────┤
3260 │                                  │     QN86    │     QN86    │     QN86    │     QN86    │
3261 │                                  ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3262 │                                  │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3263 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3264 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3265 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3266 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3267 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3268 │                       Subtable ID│ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3269 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3270 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3271 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3272 │                       Subtable ID│ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3273 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3274 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3275 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3276 │                       Subtable ID│ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3277 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3278 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3279 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3280 │                       Subtable ID│ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3281 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3282
3283                                         Custom Tables
3284 Male
3285 ╭───────────────────────────────────┬───────────────────────────────────────────────────────╮
3286 │                                   │                          QN27                         │
3287 │                                   ├───────────────────────────┬───────────────────────────┤
3288 │                                   │            Yes            │             No            │
3289 │                                   ├───────────────────────────┼───────────────────────────┤
3290 │                                   │           QND7A           │           QND7A           │
3291 │                                   ├─────────────┬─────────────┼─────────────┬─────────────┤
3292 │                                   │     Yes     │      No     │     Yes     │      No     │
3293 │                                   ├─────────────┼─────────────┼─────────────┼─────────────┤
3294 │                                   │     QN86    │     QN86    │     QN86    │     QN86    │
3295 │                                   ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3296 │                                   │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3297 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3298 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3299 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3300 │QN26 Yes QN61 Yes QN57 Row ID      │  1│ 1│  2│ 2│  3│ 3│  4│ 4│  5│ 5│  6│ 6│  7│ 7│  8│ 8│
3301 │                       Layer Row ID│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3302 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3303 │              No  QN57 Row ID      │  9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3304 │                       Layer Row ID│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3305 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3306 │     No  QN61 Yes QN57 Row ID      │ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3307 │                       Layer Row ID│  3│ 3│  3│ 3│  3│ 3│  3│ 3│  3│ 3│  3│ 3│  3│ 3│  3│ 3│
3308 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3309 │              No  QN57 Row ID      │ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3310 │                       Layer Row ID│  4│ 4│  4│ 4│  4│ 4│  4│ 4│  4│ 4│  4│ 4│  4│ 4│  4│ 4│
3311 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3312
3313                                         Custom Tables
3314 Female
3315 ╭───────────────────────────────────┬───────────────────────────────────────────────────────╮
3316 │                                   │                          QN27                         │
3317 │                                   ├───────────────────────────┬───────────────────────────┤
3318 │                                   │            Yes            │             No            │
3319 │                                   ├───────────────────────────┼───────────────────────────┤
3320 │                                   │           QND7A           │           QND7A           │
3321 │                                   ├─────────────┬─────────────┼─────────────┬─────────────┤
3322 │                                   │     Yes     │      No     │     Yes     │      No     │
3323 │                                   ├─────────────┼─────────────┼─────────────┼─────────────┤
3324 │                                   │     QN86    │     QN86    │     QN86    │     QN86    │
3325 │                                   ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3326 │                                   │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3327 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3328 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3329 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3330 │QN26 Yes QN61 Yes QN57 Row ID      │ 33│33│ 34│34│ 35│35│ 36│36│ 37│37│ 38│38│ 39│39│ 40│40│
3331 │                       Layer Row ID│  5│ 5│  5│ 5│  5│ 5│  5│ 5│  5│ 5│  5│ 5│  5│ 5│  5│ 5│
3332 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3333 │              No  QN57 Row ID      │ 41│41│ 42│42│ 43│43│ 44│44│ 45│45│ 46│46│ 47│47│ 48│48│
3334 │                       Layer Row ID│  6│ 6│  6│ 6│  6│ 6│  6│ 6│  6│ 6│  6│ 6│  6│ 6│  6│ 6│
3335 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3336 │     No  QN61 Yes QN57 Row ID      │ 49│49│ 50│50│ 51│51│ 52│52│ 53│53│ 54│54│ 55│55│ 56│56│
3337 │                       Layer Row ID│  7│ 7│  7│ 7│  7│ 7│  7│ 7│  7│ 7│  7│ 7│  7│ 7│  7│ 7│
3338 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3339 │              No  QN57 Row ID      │ 57│57│ 58│58│ 59│59│ 60│60│ 61│61│ 62│62│ 63│63│ 64│64│
3340 │                       Layer Row ID│  8│ 8│  8│ 8│  8│ 8│  8│ 8│  8│ 8│  8│ 8│  8│ 8│  8│ 8│
3341 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3342
3343                                           Custom Tables
3344 Male
3345 ╭──────────────────────────────────────┬───────────────────────────────────────────────────────╮
3346 │                                      │                          QN27                         │
3347 │                                      ├───────────────────────────┬───────────────────────────┤
3348 │                                      │            Yes            │             No            │
3349 │                                      ├───────────────────────────┼───────────────────────────┤
3350 │                                      │           QND7A           │           QND7A           │
3351 │                                      ├─────────────┬─────────────┼─────────────┬─────────────┤
3352 │                                      │     Yes     │      No     │     Yes     │      No     │
3353 │                                      ├─────────────┼─────────────┼─────────────┼─────────────┤
3354 │                                      │     QN86    │     QN86    │     QN86    │     QN86    │
3355 │                                      ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3356 │                                      │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3357 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3358 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3359 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3360 │QN26 Yes QN61 Yes QN57 Column ID      │  2│ 1│  4│ 3│  6│ 5│  7│ 8│ 10│ 9│ 11│12│ 14│13│ 15│16│
3361 │                       Layer Column ID│  2│ 1│  4│ 3│  6│ 5│  7│ 8│ 10│ 9│ 11│12│ 14│13│ 15│16│
3362 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3363 │              No  QN57 Column ID      │  2│ 1│  4│ 3│  6│ 5│  7│ 8│ 10│ 9│ 11│12│ 14│13│ 15│16│
3364 │                       Layer Column ID│  2│ 1│  4│ 3│  6│ 5│  7│ 8│ 10│ 9│ 11│12│ 14│13│ 15│16│
3365 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3366 │     No  QN61 Yes QN57 Column ID      │ 18│17│ 19│20│ 21│22│ 23│24│ 25│26│ 28│27│ 29│30│ 32│31│
3367 │                       Layer Column ID│  2│ 1│  4│ 3│  6│ 5│  7│ 8│ 10│ 9│ 11│12│ 14│13│ 15│16│
3368 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3369 │              No  QN57 Column ID      │ 18│17│ 19│20│ 21│22│ 23│24│ 25│26│ 28│27│ 29│30│ 32│31│
3370 │                       Layer Column ID│  2│ 1│  4│ 3│  6│ 5│  7│ 8│ 10│ 9│ 11│12│ 14│13│ 15│16│
3371 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3372
3373                                           Custom Tables
3374 Female
3375 ╭──────────────────────────────────────┬───────────────────────────────────────────────────────╮
3376 │                                      │                          QN27                         │
3377 │                                      ├───────────────────────────┬───────────────────────────┤
3378 │                                      │            Yes            │             No            │
3379 │                                      ├───────────────────────────┼───────────────────────────┤
3380 │                                      │           QND7A           │           QND7A           │
3381 │                                      ├─────────────┬─────────────┼─────────────┬─────────────┤
3382 │                                      │     Yes     │      No     │     Yes     │      No     │
3383 │                                      ├─────────────┼─────────────┼─────────────┼─────────────┤
3384 │                                      │     QN86    │     QN86    │     QN86    │     QN86    │
3385 │                                      ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3386 │                                      │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3387 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3388 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3389 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3390 │QN26 Yes QN61 Yes QN57 Column ID      │ 34│33│ 35│36│ 37│38│ 39│40│ 41│42│ 44│43│ 45│46│ 47│48│
3391 │                       Layer Column ID│ 18│17│ 19│20│ 21│22│ 23│24│ 25│26│ 28│27│ 29│30│ 31│32│
3392 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3393 │              No  QN57 Column ID      │ 34│33│ 35│36│ 37│38│ 39│40│ 41│42│ 44│43│ 45│46│ 47│48│
3394 │                       Layer Column ID│ 18│17│ 19│20│ 21│22│ 23│24│ 25│26│ 28│27│ 29│30│ 31│32│
3395 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3396 │     No  QN61 Yes QN57 Column ID      │ 50│49│ 51│52│ 53│54│ 55│56│ 57│58│ 59│60│ 62│61│ 64│63│
3397 │                       Layer Column ID│ 18│17│ 19│20│ 21│22│ 23│24│ 25│26│ 28│27│ 29│30│ 31│32│
3398 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3399 │              No  QN57 Column ID      │ 50│49│ 51│52│ 53│54│ 55│56│ 57│58│ 59│60│ 62│61│ 64│63│
3400 │                       Layer Column ID│ 18│17│ 19│20│ 21│22│ 23│24│ 25│26│ 28│27│ 29│30│ 31│32│
3401 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3402 ])
3403 AT_CLEANUP
3404
3405 AT_SETUP([CTABLES area definitions with CLABELS COLLABELS=OPPOSITE])
3406 AT_KEYWORDS([COLLABELS OPPOSITE])
3407 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3408 AT_DATA([ctables.sps],
3409 [[GET 'nhtsa.sav'.
3410 CTABLES
3411     /VLABELS VARIABLES=ALL DISPLAY=NAME
3412     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3413     /SLABELS POSITION=ROW
3414     /CLABELS COLLABELS=OPPOSITE
3415     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3416     /SLABELS POSITION=ROW
3417     /CLABELS COLLABELS=OPPOSITE
3418     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3419     /SLABELS POSITION=ROW
3420     /CLABELS COLLABELS=OPPOSITE.
3421 ]])
3422 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3423                           Custom Tables
3424 Male
3425 ╭──────────────────────────────────────────┬───────────────────╮
3426 │                                          │        QN27       │
3427 │                                          ├─────────┬─────────┤
3428 │                                          │   Yes   │    No   │
3429 │                                          ├─────────┼─────────┤
3430 │                                          │  QND7A  │  QND7A  │
3431 │                                          ├────┬────┼────┬────┤
3432 │                                          │ Yes│ No │ Yes│ No │
3433 │                                          ├────┼────┼────┼────┤
3434 │                                          │QN86│QN86│QN86│QN86│
3435 ├──────────────────────────────────────────┼────┼────┼────┼────┤
3436 │QN26 Yes QN61 Yes QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3437 │                               Layer ID   │   1│   1│   1│   1│
3438 │                               Subtable ID│   1│   1│   2│   2│
3439 │                          ╶───────────────┼────┼────┼────┼────┤
3440 │                           No  Table ID   │   1│   1│   1│   1│
3441 │                               Layer ID   │   1│   1│   1│   1│
3442 │                               Subtable ID│   1│   1│   2│   2│
3443 │                      ╶───────────────────┼────┼────┼────┼────┤
3444 │                       No  Yes Table ID   │   1│   1│   1│   1│
3445 │                               Layer ID   │   1│   1│   1│   1│
3446 │                               Subtable ID│   3│   3│   4│   4│
3447 │                          ╶───────────────┼────┼────┼────┼────┤
3448 │                           No  Table ID   │   1│   1│   1│   1│
3449 │                               Layer ID   │   1│   1│   1│   1│
3450 │                               Subtable ID│   3│   3│   4│   4│
3451 │             ╶────────────────────────────┼────┼────┼────┼────┤
3452 │              No  QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3453 │                               Layer ID   │   1│   1│   1│   1│
3454 │                               Subtable ID│   5│   5│   6│   6│
3455 │                          ╶───────────────┼────┼────┼────┼────┤
3456 │                           No  Table ID   │   1│   1│   1│   1│
3457 │                               Layer ID   │   1│   1│   1│   1│
3458 │                               Subtable ID│   5│   5│   6│   6│
3459 │                      ╶───────────────────┼────┼────┼────┼────┤
3460 │                       No  Yes Table ID   │   1│   1│   1│   1│
3461 │                               Layer ID   │   1│   1│   1│   1│
3462 │                               Subtable ID│   7│   7│   8│   8│
3463 │                          ╶───────────────┼────┼────┼────┼────┤
3464 │                           No  Table ID   │   1│   1│   1│   1│
3465 │                               Layer ID   │   1│   1│   1│   1│
3466 │                               Subtable ID│   7│   7│   8│   8│
3467 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
3468 │     No  QN61 Yes QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3469 │                               Layer ID   │   1│   1│   1│   1│
3470 │                               Subtable ID│   9│   9│  10│  10│
3471 │                          ╶───────────────┼────┼────┼────┼────┤
3472 │                           No  Table ID   │   1│   1│   1│   1│
3473 │                               Layer ID   │   1│   1│   1│   1│
3474 │                               Subtable ID│   9│   9│  10│  10│
3475 │                      ╶───────────────────┼────┼────┼────┼────┤
3476 │                       No  Yes Table ID   │   1│   1│   1│   1│
3477 │                               Layer ID   │   1│   1│   1│   1│
3478 │                               Subtable ID│  11│  11│  12│  12│
3479 │                          ╶───────────────┼────┼────┼────┼────┤
3480 │                           No  Table ID   │   1│   1│   1│   1│
3481 │                               Layer ID   │   1│   1│   1│   1│
3482 │                               Subtable ID│  11│  11│  12│  12│
3483 │             ╶────────────────────────────┼────┼────┼────┼────┤
3484 │              No  QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3485 │                               Layer ID   │   1│   1│   1│   1│
3486 │                               Subtable ID│  13│  13│  14│  14│
3487 │                          ╶───────────────┼────┼────┼────┼────┤
3488 │                           No  Table ID   │   1│   1│   1│   1│
3489 │                               Layer ID   │   1│   1│   1│   1│
3490 │                               Subtable ID│  13│  13│  14│  14│
3491 │                      ╶───────────────────┼────┼────┼────┼────┤
3492 │                       No  Yes Table ID   │   1│   1│   1│   1│
3493 │                               Layer ID   │   1│   1│   1│   1│
3494 │                               Subtable ID│  15│  15│  16│  16│
3495 │                          ╶───────────────┼────┼────┼────┼────┤
3496 │                           No  Table ID   │   1│   1│   1│   1│
3497 │                               Layer ID   │   1│   1│   1│   1│
3498 │                               Subtable ID│  15│  15│  16│  16│
3499 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
3500
3501                           Custom Tables
3502 Female
3503 ╭──────────────────────────────────────────┬───────────────────╮
3504 │                                          │        QN27       │
3505 │                                          ├─────────┬─────────┤
3506 │                                          │   Yes   │    No   │
3507 │                                          ├─────────┼─────────┤
3508 │                                          │  QND7A  │  QND7A  │
3509 │                                          ├────┬────┼────┬────┤
3510 │                                          │ Yes│ No │ Yes│ No │
3511 │                                          ├────┼────┼────┼────┤
3512 │                                          │QN86│QN86│QN86│QN86│
3513 ├──────────────────────────────────────────┼────┼────┼────┼────┤
3514 │QN26 Yes QN61 Yes QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3515 │                               Layer ID   │   2│   2│   2│   2│
3516 │                               Subtable ID│  17│  17│  18│  18│
3517 │                          ╶───────────────┼────┼────┼────┼────┤
3518 │                           No  Table ID   │   1│   1│   1│   1│
3519 │                               Layer ID   │   2│   2│   2│   2│
3520 │                               Subtable ID│  17│  17│  18│  18│
3521 │                      ╶───────────────────┼────┼────┼────┼────┤
3522 │                       No  Yes Table ID   │   1│   1│   1│   1│
3523 │                               Layer ID   │   2│   2│   2│   2│
3524 │                               Subtable ID│  19│  19│  20│  20│
3525 │                          ╶───────────────┼────┼────┼────┼────┤
3526 │                           No  Table ID   │   1│   1│   1│   1│
3527 │                               Layer ID   │   2│   2│   2│   2│
3528 │                               Subtable ID│  19│  19│  20│  20│
3529 │             ╶────────────────────────────┼────┼────┼────┼────┤
3530 │              No  QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3531 │                               Layer ID   │   2│   2│   2│   2│
3532 │                               Subtable ID│  21│  21│  22│  22│
3533 │                          ╶───────────────┼────┼────┼────┼────┤
3534 │                           No  Table ID   │   1│   1│   1│   1│
3535 │                               Layer ID   │   2│   2│   2│   2│
3536 │                               Subtable ID│  21│  21│  22│  22│
3537 │                      ╶───────────────────┼────┼────┼────┼────┤
3538 │                       No  Yes Table ID   │   1│   1│   1│   1│
3539 │                               Layer ID   │   2│   2│   2│   2│
3540 │                               Subtable ID│  23│  23│  24│  24│
3541 │                          ╶───────────────┼────┼────┼────┼────┤
3542 │                           No  Table ID   │   1│   1│   1│   1│
3543 │                               Layer ID   │   2│   2│   2│   2│
3544 │                               Subtable ID│  23│  23│  24│  24│
3545 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
3546 │     No  QN61 Yes QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3547 │                               Layer ID   │   2│   2│   2│   2│
3548 │                               Subtable ID│  25│  25│  26│  26│
3549 │                          ╶───────────────┼────┼────┼────┼────┤
3550 │                           No  Table ID   │   1│   1│   1│   1│
3551 │                               Layer ID   │   2│   2│   2│   2│
3552 │                               Subtable ID│  25│  25│  26│  26│
3553 │                      ╶───────────────────┼────┼────┼────┼────┤
3554 │                       No  Yes Table ID   │   1│   1│   1│   1│
3555 │                               Layer ID   │   2│   2│   2│   2│
3556 │                               Subtable ID│  27│  27│  28│  28│
3557 │                          ╶───────────────┼────┼────┼────┼────┤
3558 │                           No  Table ID   │   1│   1│   1│   1│
3559 │                               Layer ID   │   2│   2│   2│   2│
3560 │                               Subtable ID│  27│  27│  28│  28│
3561 │             ╶────────────────────────────┼────┼────┼────┼────┤
3562 │              No  QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3563 │                               Layer ID   │   2│   2│   2│   2│
3564 │                               Subtable ID│  29│  29│  30│  30│
3565 │                          ╶───────────────┼────┼────┼────┼────┤
3566 │                           No  Table ID   │   1│   1│   1│   1│
3567 │                               Layer ID   │   2│   2│   2│   2│
3568 │                               Subtable ID│  29│  29│  30│  30│
3569 │                      ╶───────────────────┼────┼────┼────┼────┤
3570 │                       No  Yes Table ID   │   1│   1│   1│   1│
3571 │                               Layer ID   │   2│   2│   2│   2│
3572 │                               Subtable ID│  31│  31│  32│  32│
3573 │                          ╶───────────────┼────┼────┼────┼────┤
3574 │                           No  Table ID   │   1│   1│   1│   1│
3575 │                               Layer ID   │   2│   2│   2│   2│
3576 │                               Subtable ID│  31│  31│  32│  32│
3577 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
3578
3579                           Custom Tables
3580 Male
3581 ╭───────────────────────────────────────────┬───────────────────╮
3582 │                                           │        QN27       │
3583 │                                           ├─────────┬─────────┤
3584 │                                           │   Yes   │    No   │
3585 │                                           ├─────────┼─────────┤
3586 │                                           │  QND7A  │  QND7A  │
3587 │                                           ├────┬────┼────┬────┤
3588 │                                           │ Yes│ No │ Yes│ No │
3589 │                                           ├────┼────┼────┼────┤
3590 │                                           │QN86│QN86│QN86│QN86│
3591 ├───────────────────────────────────────────┼────┼────┼────┼────┤
3592 │QN26 Yes QN61 Yes QN57 Yes Yes Row ID      │   2│   2│   3│   3│
3593 │                               Layer Row ID│   2│   2│   2│   2│
3594 │                          ╶────────────────┼────┼────┼────┼────┤
3595 │                           No  Row ID      │   1│   1│   4│   4│
3596 │                               Layer Row ID│   1│   1│   1│   1│
3597 │                      ╶────────────────────┼────┼────┼────┼────┤
3598 │                       No  Yes Row ID      │   5│   5│   7│   7│
3599 │                               Layer Row ID│   3│   3│   3│   3│
3600 │                          ╶────────────────┼────┼────┼────┼────┤
3601 │                           No  Row ID      │   6│   6│   8│   8│
3602 │                               Layer Row ID│   4│   4│   4│   4│
3603 │             ╶─────────────────────────────┼────┼────┼────┼────┤
3604 │              No  QN57 Yes Yes Row ID      │  10│  10│  11│  11│
3605 │                               Layer Row ID│   6│   6│   6│   6│
3606 │                          ╶────────────────┼────┼────┼────┼────┤
3607 │                           No  Row ID      │   9│   9│  12│  12│
3608 │                               Layer Row ID│   5│   5│   5│   5│
3609 │                      ╶────────────────────┼────┼────┼────┼────┤
3610 │                       No  Yes Row ID      │  14│  14│  16│  16│
3611 │                               Layer Row ID│   8│   8│   8│   8│
3612 │                          ╶────────────────┼────┼────┼────┼────┤
3613 │                           No  Row ID      │  13│  13│  15│  15│
3614 │                               Layer Row ID│   7│   7│   7│   7│
3615 │    ╶──────────────────────────────────────┼────┼────┼────┼────┤
3616 │     No  QN61 Yes QN57 Yes Yes Row ID      │  17│  17│  19│  19│
3617 │                               Layer Row ID│   9│   9│   9│   9│
3618 │                          ╶────────────────┼────┼────┼────┼────┤
3619 │                           No  Row ID      │  18│  18│  20│  20│
3620 │                               Layer Row ID│  10│  10│  10│  10│
3621 │                      ╶────────────────────┼────┼────┼────┼────┤
3622 │                       No  Yes Row ID      │  21│  21│  23│  23│
3623 │                               Layer Row ID│  11│  11│  11│  11│
3624 │                          ╶────────────────┼────┼────┼────┼────┤
3625 │                           No  Row ID      │  22│  22│  24│  24│
3626 │                               Layer Row ID│  12│  12│  12│  12│
3627 │             ╶─────────────────────────────┼────┼────┼────┼────┤
3628 │              No  QN57 Yes Yes Row ID      │  26│  26│  28│  28│
3629 │                               Layer Row ID│  14│  14│  14│  14│
3630 │                          ╶────────────────┼────┼────┼────┼────┤
3631 │                           No  Row ID      │  25│  25│  27│  27│
3632 │                               Layer Row ID│  13│  13│  13│  13│
3633 │                      ╶────────────────────┼────┼────┼────┼────┤
3634 │                       No  Yes Row ID      │  30│  30│  32│  32│
3635 │                               Layer Row ID│  16│  16│  16│  16│
3636 │                          ╶────────────────┼────┼────┼────┼────┤
3637 │                           No  Row ID      │  29│  29│  31│  31│
3638 │                               Layer Row ID│  15│  15│  15│  15│
3639 ╰───────────────────────────────────────────┴────┴────┴────┴────╯
3640
3641                           Custom Tables
3642 Female
3643 ╭───────────────────────────────────────────┬───────────────────╮
3644 │                                           │        QN27       │
3645 │                                           ├─────────┬─────────┤
3646 │                                           │   Yes   │    No   │
3647 │                                           ├─────────┼─────────┤
3648 │                                           │  QND7A  │  QND7A  │
3649 │                                           ├────┬────┼────┬────┤
3650 │                                           │ Yes│ No │ Yes│ No │
3651 │                                           ├────┼────┼────┼────┤
3652 │                                           │QN86│QN86│QN86│QN86│
3653 ├───────────────────────────────────────────┼────┼────┼────┼────┤
3654 │QN26 Yes QN61 Yes QN57 Yes Yes Row ID      │  33│  33│  36│  36│
3655 │                               Layer Row ID│  17│  17│  17│  17│
3656 │                          ╶────────────────┼────┼────┼────┼────┤
3657 │                           No  Row ID      │  34│  34│  35│  35│
3658 │                               Layer Row ID│  18│  18│  18│  18│
3659 │                      ╶────────────────────┼────┼────┼────┼────┤
3660 │                       No  Yes Row ID      │  37│  37│  39│  39│
3661 │                               Layer Row ID│  19│  19│  19│  19│
3662 │                          ╶────────────────┼────┼────┼────┼────┤
3663 │                           No  Row ID      │  38│  38│  40│  40│
3664 │                               Layer Row ID│  20│  20│  20│  20│
3665 │             ╶─────────────────────────────┼────┼────┼────┼────┤
3666 │              No  QN57 Yes Yes Row ID      │  41│  41│  44│  44│
3667 │                               Layer Row ID│  21│  21│  21│  21│
3668 │                          ╶────────────────┼────┼────┼────┼────┤
3669 │                           No  Row ID      │  42│  42│  43│  43│
3670 │                               Layer Row ID│  22│  22│  22│  22│
3671 │                      ╶────────────────────┼────┼────┼────┼────┤
3672 │                       No  Yes Row ID      │  45│  45│  48│  48│
3673 │                               Layer Row ID│  23│  23│  23│  23│
3674 │                          ╶────────────────┼────┼────┼────┼────┤
3675 │                           No  Row ID      │  46│  46│  47│  47│
3676 │                               Layer Row ID│  24│  24│  24│  24│
3677 │    ╶──────────────────────────────────────┼────┼────┼────┼────┤
3678 │     No  QN61 Yes QN57 Yes Yes Row ID      │  49│  49│  52│  52│
3679 │                               Layer Row ID│  25│  25│  25│  25│
3680 │                          ╶────────────────┼────┼────┼────┼────┤
3681 │                           No  Row ID      │  50│  50│  51│  51│
3682 │                               Layer Row ID│  26│  26│  26│  26│
3683 │                      ╶────────────────────┼────┼────┼────┼────┤
3684 │                       No  Yes Row ID      │  53│  53│  55│  55│
3685 │                               Layer Row ID│  27│  27│  27│  27│
3686 │                          ╶────────────────┼────┼────┼────┼────┤
3687 │                           No  Row ID      │  54│  54│  56│  56│
3688 │                               Layer Row ID│  28│  28│  28│  28│
3689 │             ╶─────────────────────────────┼────┼────┼────┼────┤
3690 │              No  QN57 Yes Yes Row ID      │  58│  58│  59│  59│
3691 │                               Layer Row ID│  30│  30│  30│  30│
3692 │                          ╶────────────────┼────┼────┼────┼────┤
3693 │                           No  Row ID      │  57│  57│  60│  60│
3694 │                               Layer Row ID│  29│  29│  29│  29│
3695 │                      ╶────────────────────┼────┼────┼────┼────┤
3696 │                       No  Yes Row ID      │  62│  62│  64│  64│
3697 │                               Layer Row ID│  32│  32│  32│  32│
3698 │                          ╶────────────────┼────┼────┼────┼────┤
3699 │                           No  Row ID      │  61│  61│  63│  63│
3700 │                               Layer Row ID│  31│  31│  31│  31│
3701 ╰───────────────────────────────────────────┴────┴────┴────┴────╯
3702
3703                             Custom Tables
3704 Male
3705 ╭──────────────────────────────────────────────┬───────────────────╮
3706 │                                              │        QN27       │
3707 │                                              ├─────────┬─────────┤
3708 │                                              │   Yes   │    No   │
3709 │                                              ├─────────┼─────────┤
3710 │                                              │  QND7A  │  QND7A  │
3711 │                                              ├────┬────┼────┬────┤
3712 │                                              │ Yes│ No │ Yes│ No │
3713 │                                              ├────┼────┼────┼────┤
3714 │                                              │QN86│QN86│QN86│QN86│
3715 ├──────────────────────────────────────────────┼────┼────┼────┼────┤
3716 │QN26 Yes QN61 Yes QN57 Yes Yes Column ID      │   1│   2│   3│   4│
3717 │                               Layer Column ID│   1│   2│   3│   4│
3718 │                          ╶───────────────────┼────┼────┼────┼────┤
3719 │                           No  Column ID      │   1│   2│   3│   4│
3720 │                               Layer Column ID│   1│   2│   3│   4│
3721 │                      ╶───────────────────────┼────┼────┼────┼────┤
3722 │                       No  Yes Column ID      │   5│   6│   7│   8│
3723 │                               Layer Column ID│   1│   2│   3│   4│
3724 │                          ╶───────────────────┼────┼────┼────┼────┤
3725 │                           No  Column ID      │   5│   6│   7│   8│
3726 │                               Layer Column ID│   1│   2│   3│   4│
3727 │             ╶────────────────────────────────┼────┼────┼────┼────┤
3728 │              No  QN57 Yes Yes Column ID      │   9│  10│  11│  12│
3729 │                               Layer Column ID│   1│   2│   3│   4│
3730 │                          ╶───────────────────┼────┼────┼────┼────┤
3731 │                           No  Column ID      │   9│  10│  11│  12│
3732 │                               Layer Column ID│   1│   2│   3│   4│
3733 │                      ╶───────────────────────┼────┼────┼────┼────┤
3734 │                       No  Yes Column ID      │  13│  14│  15│  16│
3735 │                               Layer Column ID│   1│   2│   3│   4│
3736 │                          ╶───────────────────┼────┼────┼────┼────┤
3737 │                           No  Column ID      │  13│  14│  15│  16│
3738 │                               Layer Column ID│   1│   2│   3│   4│
3739 │    ╶─────────────────────────────────────────┼────┼────┼────┼────┤
3740 │     No  QN61 Yes QN57 Yes Yes Column ID      │  17│  18│  19│  20│
3741 │                               Layer Column ID│   1│   2│   3│   4│
3742 │                          ╶───────────────────┼────┼────┼────┼────┤
3743 │                           No  Column ID      │  17│  18│  19│  20│
3744 │                               Layer Column ID│   1│   2│   3│   4│
3745 │                      ╶───────────────────────┼────┼────┼────┼────┤
3746 │                       No  Yes Column ID      │  21│  22│  23│  24│
3747 │                               Layer Column ID│   1│   2│   3│   4│
3748 │                          ╶───────────────────┼────┼────┼────┼────┤
3749 │                           No  Column ID      │  21│  22│  23│  24│
3750 │                               Layer Column ID│   1│   2│   3│   4│
3751 │             ╶────────────────────────────────┼────┼────┼────┼────┤
3752 │              No  QN57 Yes Yes Column ID      │  25│  26│  27│  28│
3753 │                               Layer Column ID│   1│   2│   3│   4│
3754 │                          ╶───────────────────┼────┼────┼────┼────┤
3755 │                           No  Column ID      │  25│  26│  27│  28│
3756 │                               Layer Column ID│   1│   2│   3│   4│
3757 │                      ╶───────────────────────┼────┼────┼────┼────┤
3758 │                       No  Yes Column ID      │  29│  30│  31│  32│
3759 │                               Layer Column ID│   1│   2│   3│   4│
3760 │                          ╶───────────────────┼────┼────┼────┼────┤
3761 │                           No  Column ID      │  29│  30│  31│  32│
3762 │                               Layer Column ID│   1│   2│   3│   4│
3763 ╰──────────────────────────────────────────────┴────┴────┴────┴────╯
3764
3765                             Custom Tables
3766 Female
3767 ╭──────────────────────────────────────────────┬───────────────────╮
3768 │                                              │        QN27       │
3769 │                                              ├─────────┬─────────┤
3770 │                                              │   Yes   │    No   │
3771 │                                              ├─────────┼─────────┤
3772 │                                              │  QND7A  │  QND7A  │
3773 │                                              ├────┬────┼────┬────┤
3774 │                                              │ Yes│ No │ Yes│ No │
3775 │                                              ├────┼────┼────┼────┤
3776 │                                              │QN86│QN86│QN86│QN86│
3777 ├──────────────────────────────────────────────┼────┼────┼────┼────┤
3778 │QN26 Yes QN61 Yes QN57 Yes Yes Column ID      │  33│  34│  35│  36│
3779 │                               Layer Column ID│   5│   6│   7│   8│
3780 │                          ╶───────────────────┼────┼────┼────┼────┤
3781 │                           No  Column ID      │  33│  34│  35│  36│
3782 │                               Layer Column ID│   5│   6│   7│   8│
3783 │                      ╶───────────────────────┼────┼────┼────┼────┤
3784 │                       No  Yes Column ID      │  37│  38│  39│  40│
3785 │                               Layer Column ID│   5│   6│   7│   8│
3786 │                          ╶───────────────────┼────┼────┼────┼────┤
3787 │                           No  Column ID      │  37│  38│  39│  40│
3788 │                               Layer Column ID│   5│   6│   7│   8│
3789 │             ╶────────────────────────────────┼────┼────┼────┼────┤
3790 │              No  QN57 Yes Yes Column ID      │  41│  42│  43│  44│
3791 │                               Layer Column ID│   5│   6│   7│   8│
3792 │                          ╶───────────────────┼────┼────┼────┼────┤
3793 │                           No  Column ID      │  41│  42│  43│  44│
3794 │                               Layer Column ID│   5│   6│   7│   8│
3795 │                      ╶───────────────────────┼────┼────┼────┼────┤
3796 │                       No  Yes Column ID      │  45│  46│  47│  48│
3797 │                               Layer Column ID│   5│   6│   7│   8│
3798 │                          ╶───────────────────┼────┼────┼────┼────┤
3799 │                           No  Column ID      │  45│  46│  47│  48│
3800 │                               Layer Column ID│   5│   6│   7│   8│
3801 │    ╶─────────────────────────────────────────┼────┼────┼────┼────┤
3802 │     No  QN61 Yes QN57 Yes Yes Column ID      │  49│  50│  51│  52│
3803 │                               Layer Column ID│   5│   6│   7│   8│
3804 │                          ╶───────────────────┼────┼────┼────┼────┤
3805 │                           No  Column ID      │  49│  50│  51│  52│
3806 │                               Layer Column ID│   5│   6│   7│   8│
3807 │                      ╶───────────────────────┼────┼────┼────┼────┤
3808 │                       No  Yes Column ID      │  53│  54│  55│  56│
3809 │                               Layer Column ID│   5│   6│   7│   8│
3810 │                          ╶───────────────────┼────┼────┼────┼────┤
3811 │                           No  Column ID      │  53│  54│  55│  56│
3812 │                               Layer Column ID│   5│   6│   7│   8│
3813 │             ╶────────────────────────────────┼────┼────┼────┼────┤
3814 │              No  QN57 Yes Yes Column ID      │  57│  58│  59│  60│
3815 │                               Layer Column ID│   5│   6│   7│   8│
3816 │                          ╶───────────────────┼────┼────┼────┼────┤
3817 │                           No  Column ID      │  57│  58│  59│  60│
3818 │                               Layer Column ID│   5│   6│   7│   8│
3819 │                      ╶───────────────────────┼────┼────┼────┼────┤
3820 │                       No  Yes Column ID      │  61│  62│  63│  64│
3821 │                               Layer Column ID│   5│   6│   7│   8│
3822 │                          ╶───────────────────┼────┼────┼────┼────┤
3823 │                           No  Column ID      │  61│  62│  63│  64│
3824 │                               Layer Column ID│   5│   6│   7│   8│
3825 ╰──────────────────────────────────────────────┴────┴────┴────┴────╯
3826 ])
3827 AT_CLEANUP
3828
3829 AT_SETUP([CTABLES area definitions with CLABELS ROWLABELS=LAYER])
3830 AT_KEYWORDS([ROWLABELS LAYER])
3831 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3832 AT_DATA([ctables.sps],
3833 [[GET 'nhtsa.sav'.
3834 CTABLES
3835     /VLABELS VARIABLES=ALL DISPLAY=NAME
3836     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3837     /SLABELS POSITION=ROW
3838     /CLABELS ROWLABELS=LAYER
3839     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3840     /SLABELS POSITION=ROW
3841     /CLABELS ROWLABELS=LAYER
3842     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3843     /SLABELS POSITION=ROW
3844     /CLABELS ROWLABELS=LAYER.
3845 ]])
3846 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3847                           Custom Tables
3848 Male
3849 Yes
3850 ╭──────────────────────────────────┬───────────────────────────╮
3851 │                                  │            QN27           │
3852 │                                  ├─────────────┬─────────────┤
3853 │                                  │     Yes     │      No     │
3854 │                                  ├─────────────┼─────────────┤
3855 │                                  │    QND7A    │    QND7A    │
3856 │                                  ├──────┬──────┼──────┬──────┤
3857 │                                  │  Yes │  No  │  Yes │  No  │
3858 │                                  ├──────┼──────┼──────┼──────┤
3859 │                                  │ QN86 │ QN86 │ QN86 │ QN86 │
3860 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┤
3861 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│
3862 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3863 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3864 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3865 │                       Subtable ID│  2│ 2│  3│ 3│  5│ 5│  7│ 7│
3866 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3867 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3868 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3869 │                       Subtable ID│  2│ 2│  3│ 3│  5│ 5│  7│ 7│
3870 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3871 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3872 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3873 │                       Subtable ID│ 10│10│ 12│12│ 13│13│ 16│16│
3874 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3875 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3876 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3877 │                       Subtable ID│ 10│10│ 12│12│ 13│13│ 16│16│
3878 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3879
3880                           Custom Tables
3881 Male
3882 No
3883 ╭──────────────────────────────────┬───────────────────────────╮
3884 │                                  │            QN27           │
3885 │                                  ├─────────────┬─────────────┤
3886 │                                  │     Yes     │      No     │
3887 │                                  ├─────────────┼─────────────┤
3888 │                                  │    QND7A    │    QND7A    │
3889 │                                  ├──────┬──────┼──────┬──────┤
3890 │                                  │  Yes │  No  │  Yes │  No  │
3891 │                                  ├──────┼──────┼──────┼──────┤
3892 │                                  │ QN86 │ QN86 │ QN86 │ QN86 │
3893 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┤
3894 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│
3895 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3896 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3897 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3898 │                       Subtable ID│  1│ 1│  4│ 4│  6│ 6│  8│ 8│
3899 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3900 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3901 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3902 │                       Subtable ID│  1│ 1│  4│ 4│  6│ 6│  8│ 8│
3903 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3904 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3905 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3906 │                       Subtable ID│  9│ 9│ 11│11│ 14│14│ 15│15│
3907 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3908 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3909 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3910 │                       Subtable ID│  9│ 9│ 11│11│ 14│14│ 15│15│
3911 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3912
3913                           Custom Tables
3914 Female
3915 Yes
3916 ╭──────────────────────────────────┬───────────────────────────╮
3917 │                                  │            QN27           │
3918 │                                  ├─────────────┬─────────────┤
3919 │                                  │     Yes     │      No     │
3920 │                                  ├─────────────┼─────────────┤
3921 │                                  │    QND7A    │    QND7A    │
3922 │                                  ├──────┬──────┼──────┬──────┤
3923 │                                  │  Yes │  No  │  Yes │  No  │
3924 │                                  ├──────┼──────┼──────┼──────┤
3925 │                                  │ QN86 │ QN86 │ QN86 │ QN86 │
3926 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┤
3927 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│
3928 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3929 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3930 │                       Layer ID   │  3│ 3│  3│ 3│  3│ 3│  3│ 3│
3931 │                       Subtable ID│ 17│17│ 19│19│ 21│21│ 23│23│
3932 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3933 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3934 │                       Layer ID   │  3│ 3│  3│ 3│  3│ 3│  3│ 3│
3935 │                       Subtable ID│ 17│17│ 19│19│ 21│21│ 23│23│
3936 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3937 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3938 │                       Layer ID   │  3│ 3│  3│ 3│  3│ 3│  3│ 3│
3939 │                       Subtable ID│ 25│25│ 28│28│ 29│29│ 32│32│
3940 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3941 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3942 │                       Layer ID   │  3│ 3│  3│ 3│  3│ 3│  3│ 3│
3943 │                       Subtable ID│ 25│25│ 28│28│ 29│29│ 32│32│
3944 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3945
3946                           Custom Tables
3947 Female
3948 No
3949 ╭──────────────────────────────────┬───────────────────────────╮
3950 │                                  │            QN27           │
3951 │                                  ├─────────────┬─────────────┤
3952 │                                  │     Yes     │      No     │
3953 │                                  ├─────────────┼─────────────┤
3954 │                                  │    QND7A    │    QND7A    │
3955 │                                  ├──────┬──────┼──────┬──────┤
3956 │                                  │  Yes │  No  │  Yes │  No  │
3957 │                                  ├──────┼──────┼──────┼──────┤
3958 │                                  │ QN86 │ QN86 │ QN86 │ QN86 │
3959 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┤
3960 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│
3961 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3962 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3963 │                       Layer ID   │  4│ 4│  4│ 4│  4│ 4│  4│ 4│
3964 │                       Subtable ID│ 18│18│ 20│20│ 22│22│ 24│24│
3965 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3966 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3967 │                       Layer ID   │  4│ 4│  4│ 4│  4│ 4│  4│ 4│
3968 │                       Subtable ID│ 18│18│ 20│20│ 22│22│ 24│24│
3969 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3970 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3971 │                       Layer ID   │  4│ 4│  4│ 4│  4│ 4│  4│ 4│
3972 │                       Subtable ID│ 26│26│ 27│27│ 30│30│ 31│31│
3973 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3974 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3975 │                       Layer ID   │  4│ 4│  4│ 4│  4│ 4│  4│ 4│
3976 │                       Subtable ID│ 26│26│ 27│27│ 30│30│ 31│31│
3977 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3978
3979                           Custom Tables
3980 Male
3981 Yes
3982 ╭───────────────────────────────────┬───────────────────────────╮
3983 │                                   │            QN27           │
3984 │                                   ├─────────────┬─────────────┤
3985 │                                   │     Yes     │      No     │
3986 │                                   ├─────────────┼─────────────┤
3987 │                                   │    QND7A    │    QND7A    │
3988 │                                   ├──────┬──────┼──────┬──────┤
3989 │                                   │  Yes │  No  │  Yes │  No  │
3990 │                                   ├──────┼──────┼──────┼──────┤
3991 │                                   │ QN86 │ QN86 │ QN86 │ QN86 │
3992 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┤
3993 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│
3994 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3995 │QN26 Yes QN61 Yes QN57 Row ID      │  1│ 1│  3│ 3│  6│ 6│  8│ 8│
3996 │                       Layer Row ID│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3997 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3998 │              No  QN57 Row ID      │  9│ 9│ 11│11│ 14│14│ 15│15│
3999 │                       Layer Row ID│  3│ 3│  3│ 3│  3│ 3│  3│ 3│
4000 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4001 │     No  QN61 Yes QN57 Row ID      │ 18│18│ 20│20│ 22│22│ 23│23│
4002 │                       Layer Row ID│  6│ 6│  6│ 6│  6│ 6│  6│ 6│
4003 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4004 │              No  QN57 Row ID      │ 26│26│ 28│28│ 29│29│ 32│32│
4005 │                       Layer Row ID│  8│ 8│  8│ 8│  8│ 8│  8│ 8│
4006 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4007
4008                           Custom Tables
4009 Male
4010 No
4011 ╭───────────────────────────────────┬───────────────────────────╮
4012 │                                   │            QN27           │
4013 │                                   ├─────────────┬─────────────┤
4014 │                                   │     Yes     │      No     │
4015 │                                   ├─────────────┼─────────────┤
4016 │                                   │    QND7A    │    QND7A    │
4017 │                                   ├──────┬──────┼──────┬──────┤
4018 │                                   │  Yes │  No  │  Yes │  No  │
4019 │                                   ├──────┼──────┼──────┼──────┤
4020 │                                   │ QN86 │ QN86 │ QN86 │ QN86 │
4021 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┤
4022 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│
4023 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4024 │QN26 Yes QN61 Yes QN57 Row ID      │  2│ 2│  4│ 4│  5│ 5│  7│ 7│
4025 │                       Layer Row ID│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
4026 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4027 │              No  QN57 Row ID      │ 10│10│ 12│12│ 13│13│ 16│16│
4028 │                       Layer Row ID│  4│ 4│  4│ 4│  4│ 4│  4│ 4│
4029 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4030 │     No  QN61 Yes QN57 Row ID      │ 17│17│ 19│19│ 21│21│ 24│24│
4031 │                       Layer Row ID│  5│ 5│  5│ 5│  5│ 5│  5│ 5│
4032 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4033 │              No  QN57 Row ID      │ 25│25│ 27│27│ 30│30│ 31│31│
4034 │                       Layer Row ID│  7│ 7│  7│ 7│  7│ 7│  7│ 7│
4035 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4036
4037                           Custom Tables
4038 Female
4039 Yes
4040 ╭───────────────────────────────────┬───────────────────────────╮
4041 │                                   │            QN27           │
4042 │                                   ├─────────────┬─────────────┤
4043 │                                   │     Yes     │      No     │
4044 │                                   ├─────────────┼─────────────┤
4045 │                                   │    QND7A    │    QND7A    │
4046 │                                   ├──────┬──────┼──────┬──────┤
4047 │                                   │  Yes │  No  │  Yes │  No  │
4048 │                                   ├──────┼──────┼──────┼──────┤
4049 │                                   │ QN86 │ QN86 │ QN86 │ QN86 │
4050 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┤
4051 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│
4052 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4053 │QN26 Yes QN61 Yes QN57 Row ID      │ 33│33│ 36│36│ 38│38│ 40│40│
4054 │                       Layer Row ID│  9│ 9│  9│ 9│  9│ 9│  9│ 9│
4055 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4056 │              No  QN57 Row ID      │ 42│42│ 43│43│ 45│45│ 47│47│
4057 │                       Layer Row ID│ 12│12│ 12│12│ 12│12│ 12│12│
4058 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4059 │     No  QN61 Yes QN57 Row ID      │ 50│50│ 52│52│ 53│53│ 56│56│
4060 │                       Layer Row ID│ 14│14│ 14│14│ 14│14│ 14│14│
4061 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4062 │              No  QN57 Row ID      │ 57│57│ 60│60│ 61│61│ 63│63│
4063 │                       Layer Row ID│ 15│15│ 15│15│ 15│15│ 15│15│
4064 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4065
4066                           Custom Tables
4067 Female
4068 No
4069 ╭───────────────────────────────────┬───────────────────────────╮
4070 │                                   │            QN27           │
4071 │                                   ├─────────────┬─────────────┤
4072 │                                   │     Yes     │      No     │
4073 │                                   ├─────────────┼─────────────┤
4074 │                                   │    QND7A    │    QND7A    │
4075 │                                   ├──────┬──────┼──────┬──────┤
4076 │                                   │  Yes │  No  │  Yes │  No  │
4077 │                                   ├──────┼──────┼──────┼──────┤
4078 │                                   │ QN86 │ QN86 │ QN86 │ QN86 │
4079 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┤
4080 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│
4081 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4082 │QN26 Yes QN61 Yes QN57 Row ID      │ 34│34│ 35│35│ 37│37│ 39│39│
4083 │                       Layer Row ID│ 10│10│ 10│10│ 10│10│ 10│10│
4084 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4085 │              No  QN57 Row ID      │ 41│41│ 44│44│ 46│46│ 48│48│
4086 │                       Layer Row ID│ 11│11│ 11│11│ 11│11│ 11│11│
4087 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4088 │     No  QN61 Yes QN57 Row ID      │ 49│49│ 51│51│ 54│54│ 55│55│
4089 │                       Layer Row ID│ 13│13│ 13│13│ 13│13│ 13│13│
4090 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4091 │              No  QN57 Row ID      │ 58│58│ 59│59│ 62│62│ 64│64│
4092 │                       Layer Row ID│ 16│16│ 16│16│ 16│16│ 16│16│
4093 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4094
4095                             Custom Tables
4096 Male
4097 Yes
4098 ╭──────────────────────────────────────┬───────────────────────────╮
4099 │                                      │            QN27           │
4100 │                                      ├─────────────┬─────────────┤
4101 │                                      │     Yes     │      No     │
4102 │                                      ├─────────────┼─────────────┤
4103 │                                      │    QND7A    │    QND7A    │
4104 │                                      ├──────┬──────┼──────┬──────┤
4105 │                                      │  Yes │  No  │  Yes │  No  │
4106 │                                      ├──────┼──────┼──────┼──────┤
4107 │                                      │ QN86 │ QN86 │ QN86 │ QN86 │
4108 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┤
4109 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│
4110 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4111 │QN26 Yes QN61 Yes QN57 Column ID      │  2│ 4│  6│ 7│ 10│11│ 14│15│
4112 │                       Layer Column ID│  2│ 4│  6│ 7│ 10│11│ 14│15│
4113 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4114 │              No  QN57 Column ID      │  2│ 4│  6│ 7│ 10│11│ 14│15│
4115 │                       Layer Column ID│  2│ 4│  6│ 7│ 10│11│ 14│15│
4116 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4117 │     No  QN61 Yes QN57 Column ID      │ 18│19│ 21│23│ 25│28│ 29│32│
4118 │                       Layer Column ID│  2│ 4│  6│ 7│ 10│11│ 14│15│
4119 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4120 │              No  QN57 Column ID      │ 18│19│ 21│23│ 25│28│ 29│32│
4121 │                       Layer Column ID│  2│ 4│  6│ 7│ 10│11│ 14│15│
4122 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4123
4124                             Custom Tables
4125 Male
4126 No
4127 ╭──────────────────────────────────────┬───────────────────────────╮
4128 │                                      │            QN27           │
4129 │                                      ├─────────────┬─────────────┤
4130 │                                      │     Yes     │      No     │
4131 │                                      ├─────────────┼─────────────┤
4132 │                                      │    QND7A    │    QND7A    │
4133 │                                      ├──────┬──────┼──────┬──────┤
4134 │                                      │  Yes │  No  │  Yes │  No  │
4135 │                                      ├──────┼──────┼──────┼──────┤
4136 │                                      │ QN86 │ QN86 │ QN86 │ QN86 │
4137 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┤
4138 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│
4139 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4140 │QN26 Yes QN61 Yes QN57 Column ID      │  1│ 3│  5│ 8│  9│12│ 13│16│
4141 │                       Layer Column ID│  1│ 3│  5│ 8│  9│12│ 13│16│
4142 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4143 │              No  QN57 Column ID      │  1│ 3│  5│ 8│  9│12│ 13│16│
4144 │                       Layer Column ID│  1│ 3│  5│ 8│  9│12│ 13│16│
4145 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4146 │     No  QN61 Yes QN57 Column ID      │ 17│20│ 22│24│ 26│27│ 30│31│
4147 │                       Layer Column ID│  1│ 3│  5│ 8│  9│12│ 13│16│
4148 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4149 │              No  QN57 Column ID      │ 17│20│ 22│24│ 26│27│ 30│31│
4150 │                       Layer Column ID│  1│ 3│  5│ 8│  9│12│ 13│16│
4151 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4152
4153                             Custom Tables
4154 Female
4155 Yes
4156 ╭──────────────────────────────────────┬───────────────────────────╮
4157 │                                      │            QN27           │
4158 │                                      ├─────────────┬─────────────┤
4159 │                                      │     Yes     │      No     │
4160 │                                      ├─────────────┼─────────────┤
4161 │                                      │    QND7A    │    QND7A    │
4162 │                                      ├──────┬──────┼──────┬──────┤
4163 │                                      │  Yes │  No  │  Yes │  No  │
4164 │                                      ├──────┼──────┼──────┼──────┤
4165 │                                      │ QN86 │ QN86 │ QN86 │ QN86 │
4166 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┤
4167 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│
4168 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4169 │QN26 Yes QN61 Yes QN57 Column ID      │ 34│35│ 37│39│ 41│44│ 45│47│
4170 │                       Layer Column ID│ 18│19│ 21│23│ 25│28│ 29│31│
4171 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4172 │              No  QN57 Column ID      │ 34│35│ 37│39│ 41│44│ 45│47│
4173 │                       Layer Column ID│ 18│19│ 21│23│ 25│28│ 29│31│
4174 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4175 │     No  QN61 Yes QN57 Column ID      │ 50│51│ 53│55│ 57│59│ 62│64│
4176 │                       Layer Column ID│ 18│19│ 21│23│ 25│28│ 29│31│
4177 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4178 │              No  QN57 Column ID      │ 50│51│ 53│55│ 57│59│ 62│64│
4179 │                       Layer Column ID│ 18│19│ 21│23│ 25│28│ 29│31│
4180 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4181
4182                             Custom Tables
4183 Female
4184 No
4185 ╭──────────────────────────────────────┬───────────────────────────╮
4186 │                                      │            QN27           │
4187 │                                      ├─────────────┬─────────────┤
4188 │                                      │     Yes     │      No     │
4189 │                                      ├─────────────┼─────────────┤
4190 │                                      │    QND7A    │    QND7A    │
4191 │                                      ├──────┬──────┼──────┬──────┤
4192 │                                      │  Yes │  No  │  Yes │  No  │
4193 │                                      ├──────┼──────┼──────┼──────┤
4194 │                                      │ QN86 │ QN86 │ QN86 │ QN86 │
4195 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┤
4196 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│
4197 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4198 │QN26 Yes QN61 Yes QN57 Column ID      │ 33│36│ 38│40│ 42│43│ 46│48│
4199 │                       Layer Column ID│ 17│20│ 22│24│ 26│27│ 30│32│
4200 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4201 │              No  QN57 Column ID      │ 33│36│ 38│40│ 42│43│ 46│48│
4202 │                       Layer Column ID│ 17│20│ 22│24│ 26│27│ 30│32│
4203 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4204 │     No  QN61 Yes QN57 Column ID      │ 49│52│ 54│56│ 58│60│ 61│63│
4205 │                       Layer Column ID│ 17│20│ 22│24│ 26│27│ 30│32│
4206 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4207 │              No  QN57 Column ID      │ 49│52│ 54│56│ 58│60│ 61│63│
4208 │                       Layer Column ID│ 17│20│ 22│24│ 26│27│ 30│32│
4209 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4210 ])
4211 AT_CLEANUP
4212
4213 AT_SETUP([CTABLES area definitions with CLABELS COLLABELS=LAYER])
4214 AT_KEYWORDS([COLLABELS LAYER])
4215 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4216 AT_DATA([ctables.sps],
4217 [[GET 'nhtsa.sav'.
4218 CTABLES
4219     /VLABELS VARIABLES=ALL DISPLAY=NAME
4220     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
4221     /SLABELS POSITION=ROW
4222     /CLABELS COLLABELS=LAYER
4223     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
4224     /SLABELS POSITION=ROW
4225     /CLABELS COLLABELS=LAYER
4226     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
4227     /SLABELS POSITION=ROW
4228     /CLABELS COLLABELS=LAYER.
4229 ]])
4230 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
4231                         Custom Tables
4232 Male
4233 Yes
4234 ╭──────────────────────────────────────┬───────────────────╮
4235 │                                      │        QN27       │
4236 │                                      ├─────────┬─────────┤
4237 │                                      │   Yes   │    No   │
4238 │                                      ├─────────┼─────────┤
4239 │                                      │  QND7A  │  QND7A  │
4240 │                                      ├────┬────┼────┬────┤
4241 │                                      │ Yes│ No │ Yes│ No │
4242 │                                      ├────┼────┼────┼────┤
4243 │                                      │QN86│QN86│QN86│QN86│
4244 ├──────────────────────────────────────┼────┼────┼────┼────┤
4245 │QN26 Yes QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4246 │                           Layer ID   │   2│   2│   2│   2│
4247 │                           Subtable ID│   2│   2│   4│   4│
4248 │                      ╶───────────────┼────┼────┼────┼────┤
4249 │                       No  Table ID   │   1│   1│   1│   1│
4250 │                           Layer ID   │   2│   2│   2│   2│
4251 │                           Subtable ID│   2│   2│   4│   4│
4252 │             ╶────────────────────────┼────┼────┼────┼────┤
4253 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4254 │                           Layer ID   │   2│   2│   2│   2│
4255 │                           Subtable ID│   5│   5│   7│   7│
4256 │                      ╶───────────────┼────┼────┼────┼────┤
4257 │                       No  Table ID   │   1│   1│   1│   1│
4258 │                           Layer ID   │   2│   2│   2│   2│
4259 │                           Subtable ID│   5│   5│   7│   7│
4260 │    ╶─────────────────────────────────┼────┼────┼────┼────┤
4261 │     No  QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4262 │                           Layer ID   │   2│   2│   2│   2│
4263 │                           Subtable ID│  10│  10│  12│  12│
4264 │                      ╶───────────────┼────┼────┼────┼────┤
4265 │                       No  Table ID   │   1│   1│   1│   1│
4266 │                           Layer ID   │   2│   2│   2│   2│
4267 │                           Subtable ID│  10│  10│  12│  12│
4268 │             ╶────────────────────────┼────┼────┼────┼────┤
4269 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4270 │                           Layer ID   │   2│   2│   2│   2│
4271 │                           Subtable ID│  13│  13│  15│  15│
4272 │                      ╶───────────────┼────┼────┼────┼────┤
4273 │                       No  Table ID   │   1│   1│   1│   1│
4274 │                           Layer ID   │   2│   2│   2│   2│
4275 │                           Subtable ID│  13│  13│  15│  15│
4276 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4277
4278                         Custom Tables
4279 Male
4280 No
4281 ╭──────────────────────────────────────┬───────────────────╮
4282 │                                      │        QN27       │
4283 │                                      ├─────────┬─────────┤
4284 │                                      │   Yes   │    No   │
4285 │                                      ├─────────┼─────────┤
4286 │                                      │  QND7A  │  QND7A  │
4287 │                                      ├────┬────┼────┬────┤
4288 │                                      │ Yes│ No │ Yes│ No │
4289 │                                      ├────┼────┼────┼────┤
4290 │                                      │QN86│QN86│QN86│QN86│
4291 ├──────────────────────────────────────┼────┼────┼────┼────┤
4292 │QN26 Yes QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4293 │                           Layer ID   │   1│   1│   1│   1│
4294 │                           Subtable ID│   1│   1│   3│   3│
4295 │                      ╶───────────────┼────┼────┼────┼────┤
4296 │                       No  Table ID   │   1│   1│   1│   1│
4297 │                           Layer ID   │   1│   1│   1│   1│
4298 │                           Subtable ID│   1│   1│   3│   3│
4299 │             ╶────────────────────────┼────┼────┼────┼────┤
4300 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4301 │                           Layer ID   │   1│   1│   1│   1│
4302 │                           Subtable ID│   6│   6│   8│   8│
4303 │                      ╶───────────────┼────┼────┼────┼────┤
4304 │                       No  Table ID   │   1│   1│   1│   1│
4305 │                           Layer ID   │   1│   1│   1│   1│
4306 │                           Subtable ID│   6│   6│   8│   8│
4307 │    ╶─────────────────────────────────┼────┼────┼────┼────┤
4308 │     No  QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4309 │                           Layer ID   │   1│   1│   1│   1│
4310 │                           Subtable ID│   9│   9│  11│  11│
4311 │                      ╶───────────────┼────┼────┼────┼────┤
4312 │                       No  Table ID   │   1│   1│   1│   1│
4313 │                           Layer ID   │   1│   1│   1│   1│
4314 │                           Subtable ID│   9│   9│  11│  11│
4315 │             ╶────────────────────────┼────┼────┼────┼────┤
4316 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4317 │                           Layer ID   │   1│   1│   1│   1│
4318 │                           Subtable ID│  14│  14│  16│  16│
4319 │                      ╶───────────────┼────┼────┼────┼────┤
4320 │                       No  Table ID   │   1│   1│   1│   1│
4321 │                           Layer ID   │   1│   1│   1│   1│
4322 │                           Subtable ID│  14│  14│  16│  16│
4323 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4324
4325                         Custom Tables
4326 Female
4327 Yes
4328 ╭──────────────────────────────────────┬───────────────────╮
4329 │                                      │        QN27       │
4330 │                                      ├─────────┬─────────┤
4331 │                                      │   Yes   │    No   │
4332 │                                      ├─────────┼─────────┤
4333 │                                      │  QND7A  │  QND7A  │
4334 │                                      ├────┬────┼────┬────┤
4335 │                                      │ Yes│ No │ Yes│ No │
4336 │                                      ├────┼────┼────┼────┤
4337 │                                      │QN86│QN86│QN86│QN86│
4338 ├──────────────────────────────────────┼────┼────┼────┼────┤
4339 │QN26 Yes QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4340 │                           Layer ID   │   4│   4│   4│   4│
4341 │                           Subtable ID│  18│  18│  19│  19│
4342 │                      ╶───────────────┼────┼────┼────┼────┤
4343 │                       No  Table ID   │   1│   1│   1│   1│
4344 │                           Layer ID   │   4│   4│   4│   4│
4345 │                           Subtable ID│  18│  18│  19│  19│
4346 │             ╶────────────────────────┼────┼────┼────┼────┤
4347 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4348 │                           Layer ID   │   4│   4│   4│   4│
4349 │                           Subtable ID│  22│  22│  23│  23│
4350 │                      ╶───────────────┼────┼────┼────┼────┤
4351 │                       No  Table ID   │   1│   1│   1│   1│
4352 │                           Layer ID   │   4│   4│   4│   4│
4353 │                           Subtable ID│  22│  22│  23│  23│
4354 │    ╶─────────────────────────────────┼────┼────┼────┼────┤
4355 │     No  QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4356 │                           Layer ID   │   4│   4│   4│   4│
4357 │                           Subtable ID│  26│  26│  28│  28│
4358 │                      ╶───────────────┼────┼────┼────┼────┤
4359 │                       No  Table ID   │   1│   1│   1│   1│
4360 │                           Layer ID   │   4│   4│   4│   4│
4361 │                           Subtable ID│  26│  26│  28│  28│
4362 │             ╶────────────────────────┼────┼────┼────┼────┤
4363 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4364 │                           Layer ID   │   4│   4│   4│   4│
4365 │                           Subtable ID│  29│  29│  31│  31│
4366 │                      ╶───────────────┼────┼────┼────┼────┤
4367 │                       No  Table ID   │   1│   1│   1│   1│
4368 │                           Layer ID   │   4│   4│   4│   4│
4369 │                           Subtable ID│  29│  29│  31│  31│
4370 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4371
4372                         Custom Tables
4373 Female
4374 No
4375 ╭──────────────────────────────────────┬───────────────────╮
4376 │                                      │        QN27       │
4377 │                                      ├─────────┬─────────┤
4378 │                                      │   Yes   │    No   │
4379 │                                      ├─────────┼─────────┤
4380 │                                      │  QND7A  │  QND7A  │
4381 │                                      ├────┬────┼────┬────┤
4382 │                                      │ Yes│ No │ Yes│ No │
4383 │                                      ├────┼────┼────┼────┤
4384 │                                      │QN86│QN86│QN86│QN86│
4385 ├──────────────────────────────────────┼────┼────┼────┼────┤
4386 │QN26 Yes QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4387 │                           Layer ID   │   3│   3│   3│   3│
4388 │                           Subtable ID│  17│  17│  20│  20│
4389 │                      ╶───────────────┼────┼────┼────┼────┤
4390 │                       No  Table ID   │   1│   1│   1│   1│
4391 │                           Layer ID   │   3│   3│   3│   3│
4392 │                           Subtable ID│  17│  17│  20│  20│
4393 │             ╶────────────────────────┼────┼────┼────┼────┤
4394 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4395 │                           Layer ID   │   3│   3│   3│   3│
4396 │                           Subtable ID│  21│  21│  24│  24│
4397 │                      ╶───────────────┼────┼────┼────┼────┤
4398 │                       No  Table ID   │   1│   1│   1│   1│
4399 │                           Layer ID   │   3│   3│   3│   3│
4400 │                           Subtable ID│  21│  21│  24│  24│
4401 │    ╶─────────────────────────────────┼────┼────┼────┼────┤
4402 │     No  QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4403 │                           Layer ID   │   3│   3│   3│   3│
4404 │                           Subtable ID│  25│  25│  27│  27│
4405 │                      ╶───────────────┼────┼────┼────┼────┤
4406 │                       No  Table ID   │   1│   1│   1│   1│
4407 │                           Layer ID   │   3│   3│   3│   3│
4408 │                           Subtable ID│  25│  25│  27│  27│
4409 │             ╶────────────────────────┼────┼────┼────┼────┤
4410 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4411 │                           Layer ID   │   3│   3│   3│   3│
4412 │                           Subtable ID│  30│  30│  32│  32│
4413 │                      ╶───────────────┼────┼────┼────┼────┤
4414 │                       No  Table ID   │   1│   1│   1│   1│
4415 │                           Layer ID   │   3│   3│   3│   3│
4416 │                           Subtable ID│  30│  30│  32│  32│
4417 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4418
4419                         Custom Tables
4420 Male
4421 Yes
4422 ╭───────────────────────────────────────┬───────────────────╮
4423 │                                       │        QN27       │
4424 │                                       ├─────────┬─────────┤
4425 │                                       │   Yes   │    No   │
4426 │                                       ├─────────┼─────────┤
4427 │                                       │  QND7A  │  QND7A  │
4428 │                                       ├────┬────┼────┬────┤
4429 │                                       │ Yes│ No │ Yes│ No │
4430 │                                       ├────┼────┼────┼────┤
4431 │                                       │QN86│QN86│QN86│QN86│
4432 ├───────────────────────────────────────┼────┼────┼────┼────┤
4433 │QN26 Yes QN61 Yes QN57 Yes Row ID      │   2│   2│   3│   3│
4434 │                           Layer Row ID│   2│   2│   2│   2│
4435 │                      ╶────────────────┼────┼────┼────┼────┤
4436 │                       No  Row ID      │   5│   5│   7│   7│
4437 │                           Layer Row ID│   3│   3│   3│   3│
4438 │             ╶─────────────────────────┼────┼────┼────┼────┤
4439 │              No  QN57 Yes Row ID      │  10│  10│  11│  11│
4440 │                           Layer Row ID│   6│   6│   6│   6│
4441 │                      ╶────────────────┼────┼────┼────┼────┤
4442 │                       No  Row ID      │  14│  14│  16│  16│
4443 │                           Layer Row ID│   8│   8│   8│   8│
4444 │    ╶──────────────────────────────────┼────┼────┼────┼────┤
4445 │     No  QN61 Yes QN57 Yes Row ID      │  17│  17│  19│  19│
4446 │                           Layer Row ID│   9│   9│   9│   9│
4447 │                      ╶────────────────┼────┼────┼────┼────┤
4448 │                       No  Row ID      │  21│  21│  23│  23│
4449 │                           Layer Row ID│  11│  11│  11│  11│
4450 │             ╶─────────────────────────┼────┼────┼────┼────┤
4451 │              No  QN57 Yes Row ID      │  26│  26│  28│  28│
4452 │                           Layer Row ID│  14│  14│  14│  14│
4453 │                      ╶────────────────┼────┼────┼────┼────┤
4454 │                       No  Row ID      │  30│  30│  32│  32│
4455 │                           Layer Row ID│  16│  16│  16│  16│
4456 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4457
4458                         Custom Tables
4459 Male
4460 No
4461 ╭───────────────────────────────────────┬───────────────────╮
4462 │                                       │        QN27       │
4463 │                                       ├─────────┬─────────┤
4464 │                                       │   Yes   │    No   │
4465 │                                       ├─────────┼─────────┤
4466 │                                       │  QND7A  │  QND7A  │
4467 │                                       ├────┬────┼────┬────┤
4468 │                                       │ Yes│ No │ Yes│ No │
4469 │                                       ├────┼────┼────┼────┤
4470 │                                       │QN86│QN86│QN86│QN86│
4471 ├───────────────────────────────────────┼────┼────┼────┼────┤
4472 │QN26 Yes QN61 Yes QN57 Yes Row ID      │   1│   1│   4│   4│
4473 │                           Layer Row ID│   1│   1│   1│   1│
4474 │                      ╶────────────────┼────┼────┼────┼────┤
4475 │                       No  Row ID      │   6│   6│   8│   8│
4476 │                           Layer Row ID│   4│   4│   4│   4│
4477 │             ╶─────────────────────────┼────┼────┼────┼────┤
4478 │              No  QN57 Yes Row ID      │   9│   9│  12│  12│
4479 │                           Layer Row ID│   5│   5│   5│   5│
4480 │                      ╶────────────────┼────┼────┼────┼────┤
4481 │                       No  Row ID      │  13│  13│  15│  15│
4482 │                           Layer Row ID│   7│   7│   7│   7│
4483 │    ╶──────────────────────────────────┼────┼────┼────┼────┤
4484 │     No  QN61 Yes QN57 Yes Row ID      │  18│  18│  20│  20│
4485 │                           Layer Row ID│  10│  10│  10│  10│
4486 │                      ╶────────────────┼────┼────┼────┼────┤
4487 │                       No  Row ID      │  22│  22│  24│  24│
4488 │                           Layer Row ID│  12│  12│  12│  12│
4489 │             ╶─────────────────────────┼────┼────┼────┼────┤
4490 │              No  QN57 Yes Row ID      │  25│  25│  27│  27│
4491 │                           Layer Row ID│  13│  13│  13│  13│
4492 │                      ╶────────────────┼────┼────┼────┼────┤
4493 │                       No  Row ID      │  29│  29│  31│  31│
4494 │                           Layer Row ID│  15│  15│  15│  15│
4495 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4496
4497                         Custom Tables
4498 Female
4499 Yes
4500 ╭───────────────────────────────────────┬───────────────────╮
4501 │                                       │        QN27       │
4502 │                                       ├─────────┬─────────┤
4503 │                                       │   Yes   │    No   │
4504 │                                       ├─────────┼─────────┤
4505 │                                       │  QND7A  │  QND7A  │
4506 │                                       ├────┬────┼────┬────┤
4507 │                                       │ Yes│ No │ Yes│ No │
4508 │                                       ├────┼────┼────┼────┤
4509 │                                       │QN86│QN86│QN86│QN86│
4510 ├───────────────────────────────────────┼────┼────┼────┼────┤
4511 │QN26 Yes QN61 Yes QN57 Yes Row ID      │  33│  33│  36│  36│
4512 │                           Layer Row ID│  17│  17│  17│  17│
4513 │                      ╶────────────────┼────┼────┼────┼────┤
4514 │                       No  Row ID      │  37│  37│  39│  39│
4515 │                           Layer Row ID│  19│  19│  19│  19│
4516 │             ╶─────────────────────────┼────┼────┼────┼────┤
4517 │              No  QN57 Yes Row ID      │  41│  41│  44│  44│
4518 │                           Layer Row ID│  21│  21│  21│  21│
4519 │                      ╶────────────────┼────┼────┼────┼────┤
4520 │                       No  Row ID      │  45│  45│  48│  48│
4521 │                           Layer Row ID│  23│  23│  23│  23│
4522 │    ╶──────────────────────────────────┼────┼────┼────┼────┤
4523 │     No  QN61 Yes QN57 Yes Row ID      │  49│  49│  52│  52│
4524 │                           Layer Row ID│  25│  25│  25│  25│
4525 │                      ╶────────────────┼────┼────┼────┼────┤
4526 │                       No  Row ID      │  53│  53│  55│  55│
4527 │                           Layer Row ID│  27│  27│  27│  27│
4528 │             ╶─────────────────────────┼────┼────┼────┼────┤
4529 │              No  QN57 Yes Row ID      │  58│  58│  59│  59│
4530 │                           Layer Row ID│  30│  30│  30│  30│
4531 │                      ╶────────────────┼────┼────┼────┼────┤
4532 │                       No  Row ID      │  62│  62│  64│  64│
4533 │                           Layer Row ID│  32│  32│  32│  32│
4534 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4535
4536                         Custom Tables
4537 Female
4538 No
4539 ╭───────────────────────────────────────┬───────────────────╮
4540 │                                       │        QN27       │
4541 │                                       ├─────────┬─────────┤
4542 │                                       │   Yes   │    No   │
4543 │                                       ├─────────┼─────────┤
4544 │                                       │  QND7A  │  QND7A  │
4545 │                                       ├────┬────┼────┬────┤
4546 │                                       │ Yes│ No │ Yes│ No │
4547 │                                       ├────┼────┼────┼────┤
4548 │                                       │QN86│QN86│QN86│QN86│
4549 ├───────────────────────────────────────┼────┼────┼────┼────┤
4550 │QN26 Yes QN61 Yes QN57 Yes Row ID      │  34│  34│  35│  35│
4551 │                           Layer Row ID│  18│  18│  18│  18│
4552 │                      ╶────────────────┼────┼────┼────┼────┤
4553 │                       No  Row ID      │  38│  38│  40│  40│
4554 │                           Layer Row ID│  20│  20│  20│  20│
4555 │             ╶─────────────────────────┼────┼────┼────┼────┤
4556 │              No  QN57 Yes Row ID      │  42│  42│  43│  43│
4557 │                           Layer Row ID│  22│  22│  22│  22│
4558 │                      ╶────────────────┼────┼────┼────┼────┤
4559 │                       No  Row ID      │  46│  46│  47│  47│
4560 │                           Layer Row ID│  24│  24│  24│  24│
4561 │    ╶──────────────────────────────────┼────┼────┼────┼────┤
4562 │     No  QN61 Yes QN57 Yes Row ID      │  50│  50│  51│  51│
4563 │                           Layer Row ID│  26│  26│  26│  26│
4564 │                      ╶────────────────┼────┼────┼────┼────┤
4565 │                       No  Row ID      │  54│  54│  56│  56│
4566 │                           Layer Row ID│  28│  28│  28│  28│
4567 │             ╶─────────────────────────┼────┼────┼────┼────┤
4568 │              No  QN57 Yes Row ID      │  57│  57│  60│  60│
4569 │                           Layer Row ID│  29│  29│  29│  29│
4570 │                      ╶────────────────┼────┼────┼────┼────┤
4571 │                       No  Row ID      │  61│  61│  63│  63│
4572 │                           Layer Row ID│  31│  31│  31│  31│
4573 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4574
4575                           Custom Tables
4576 Male
4577 Yes
4578 ╭──────────────────────────────────────────┬───────────────────╮
4579 │                                          │        QN27       │
4580 │                                          ├─────────┬─────────┤
4581 │                                          │   Yes   │    No   │
4582 │                                          ├─────────┼─────────┤
4583 │                                          │  QND7A  │  QND7A  │
4584 │                                          ├────┬────┼────┬────┤
4585 │                                          │ Yes│ No │ Yes│ No │
4586 │                                          ├────┼────┼────┼────┤
4587 │                                          │QN86│QN86│QN86│QN86│
4588 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4589 │QN26 Yes QN61 Yes QN57 Yes Column ID      │   1│   4│   5│   7│
4590 │                           Layer Column ID│   1│   4│   5│   7│
4591 │                      ╶───────────────────┼────┼────┼────┼────┤
4592 │                       No  Column ID      │   1│   4│   5│   7│
4593 │                           Layer Column ID│   1│   4│   5│   7│
4594 │             ╶────────────────────────────┼────┼────┼────┼────┤
4595 │              No  QN57 Yes Column ID      │   9│  12│  14│  15│
4596 │                           Layer Column ID│   1│   4│   5│   7│
4597 │                      ╶───────────────────┼────┼────┼────┼────┤
4598 │                       No  Column ID      │   9│  12│  14│  15│
4599 │                           Layer Column ID│   1│   4│   5│   7│
4600 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
4601 │     No  QN61 Yes QN57 Yes Column ID      │  18│  20│  22│  24│
4602 │                           Layer Column ID│   1│   4│   5│   7│
4603 │                      ╶───────────────────┼────┼────┼────┼────┤
4604 │                       No  Column ID      │  18│  20│  22│  24│
4605 │                           Layer Column ID│   1│   4│   5│   7│
4606 │             ╶────────────────────────────┼────┼────┼────┼────┤
4607 │              No  QN57 Yes Column ID      │  26│  27│  30│  31│
4608 │                           Layer Column ID│   1│   4│   5│   7│
4609 │                      ╶───────────────────┼────┼────┼────┼────┤
4610 │                       No  Column ID      │  26│  27│  30│  31│
4611 │                           Layer Column ID│   1│   4│   5│   7│
4612 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4613
4614                           Custom Tables
4615 Male
4616 No
4617 ╭──────────────────────────────────────────┬───────────────────╮
4618 │                                          │        QN27       │
4619 │                                          ├─────────┬─────────┤
4620 │                                          │   Yes   │    No   │
4621 │                                          ├─────────┼─────────┤
4622 │                                          │  QND7A  │  QND7A  │
4623 │                                          ├────┬────┼────┬────┤
4624 │                                          │ Yes│ No │ Yes│ No │
4625 │                                          ├────┼────┼────┼────┤
4626 │                                          │QN86│QN86│QN86│QN86│
4627 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4628 │QN26 Yes QN61 Yes QN57 Yes Column ID      │   2│   3│   6│   8│
4629 │                           Layer Column ID│   2│   3│   6│   8│
4630 │                      ╶───────────────────┼────┼────┼────┼────┤
4631 │                       No  Column ID      │   2│   3│   6│   8│
4632 │                           Layer Column ID│   2│   3│   6│   8│
4633 │             ╶────────────────────────────┼────┼────┼────┼────┤
4634 │              No  QN57 Yes Column ID      │  10│  11│  13│  16│
4635 │                           Layer Column ID│   2│   3│   6│   8│
4636 │                      ╶───────────────────┼────┼────┼────┼────┤
4637 │                       No  Column ID      │  10│  11│  13│  16│
4638 │                           Layer Column ID│   2│   3│   6│   8│
4639 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
4640 │     No  QN61 Yes QN57 Yes Column ID      │  17│  19│  21│  23│
4641 │                           Layer Column ID│   2│   3│   6│   8│
4642 │                      ╶───────────────────┼────┼────┼────┼────┤
4643 │                       No  Column ID      │  17│  19│  21│  23│
4644 │                           Layer Column ID│   2│   3│   6│   8│
4645 │             ╶────────────────────────────┼────┼────┼────┼────┤
4646 │              No  QN57 Yes Column ID      │  25│  28│  29│  32│
4647 │                           Layer Column ID│   2│   3│   6│   8│
4648 │                      ╶───────────────────┼────┼────┼────┼────┤
4649 │                       No  Column ID      │  25│  28│  29│  32│
4650 │                           Layer Column ID│   2│   3│   6│   8│
4651 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4652
4653                           Custom Tables
4654 Female
4655 Yes
4656 ╭──────────────────────────────────────────┬───────────────────╮
4657 │                                          │        QN27       │
4658 │                                          ├─────────┬─────────┤
4659 │                                          │   Yes   │    No   │
4660 │                                          ├─────────┼─────────┤
4661 │                                          │  QND7A  │  QND7A  │
4662 │                                          ├────┬────┼────┬────┤
4663 │                                          │ Yes│ No │ Yes│ No │
4664 │                                          ├────┼────┼────┼────┤
4665 │                                          │QN86│QN86│QN86│QN86│
4666 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4667 │QN26 Yes QN61 Yes QN57 Yes Column ID      │  34│  36│  37│  39│
4668 │                           Layer Column ID│  10│  12│  13│  15│
4669 │                      ╶───────────────────┼────┼────┼────┼────┤
4670 │                       No  Column ID      │  34│  36│  37│  39│
4671 │                           Layer Column ID│  10│  12│  13│  15│
4672 │             ╶────────────────────────────┼────┼────┼────┼────┤
4673 │              No  QN57 Yes Column ID      │  41│  43│  46│  48│
4674 │                           Layer Column ID│  10│  12│  13│  15│
4675 │                      ╶───────────────────┼────┼────┼────┼────┤
4676 │                       No  Column ID      │  41│  43│  46│  48│
4677 │                           Layer Column ID│  10│  12│  13│  15│
4678 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
4679 │     No  QN61 Yes QN57 Yes Column ID      │  50│  51│  53│  55│
4680 │                           Layer Column ID│  10│  12│  13│  15│
4681 │                      ╶───────────────────┼────┼────┼────┼────┤
4682 │                       No  Column ID      │  50│  51│  53│  55│
4683 │                           Layer Column ID│  10│  12│  13│  15│
4684 │             ╶────────────────────────────┼────┼────┼────┼────┤
4685 │              No  QN57 Yes Column ID      │  58│  60│  62│  64│
4686 │                           Layer Column ID│  10│  12│  13│  15│
4687 │                      ╶───────────────────┼────┼────┼────┼────┤
4688 │                       No  Column ID      │  58│  60│  62│  64│
4689 │                           Layer Column ID│  10│  12│  13│  15│
4690 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4691
4692                           Custom Tables
4693 Female
4694 No
4695 ╭──────────────────────────────────────────┬───────────────────╮
4696 │                                          │        QN27       │
4697 │                                          ├─────────┬─────────┤
4698 │                                          │   Yes   │    No   │
4699 │                                          ├─────────┼─────────┤
4700 │                                          │  QND7A  │  QND7A  │
4701 │                                          ├────┬────┼────┬────┤
4702 │                                          │ Yes│ No │ Yes│ No │
4703 │                                          ├────┼────┼────┼────┤
4704 │                                          │QN86│QN86│QN86│QN86│
4705 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4706 │QN26 Yes QN61 Yes QN57 Yes Column ID      │  33│  35│  38│  40│
4707 │                           Layer Column ID│   9│  11│  14│  16│
4708 │                      ╶───────────────────┼────┼────┼────┼────┤
4709 │                       No  Column ID      │  33│  35│  38│  40│
4710 │                           Layer Column ID│   9│  11│  14│  16│
4711 │             ╶────────────────────────────┼────┼────┼────┼────┤
4712 │              No  QN57 Yes Column ID      │  42│  44│  45│  47│
4713 │                           Layer Column ID│   9│  11│  14│  16│
4714 │                      ╶───────────────────┼────┼────┼────┼────┤
4715 │                       No  Column ID      │  42│  44│  45│  47│
4716 │                           Layer Column ID│   9│  11│  14│  16│
4717 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
4718 │     No  QN61 Yes QN57 Yes Column ID      │  49│  52│  54│  56│
4719 │                           Layer Column ID│   9│  11│  14│  16│
4720 │                      ╶───────────────────┼────┼────┼────┼────┤
4721 │                       No  Column ID      │  49│  52│  54│  56│
4722 │                           Layer Column ID│   9│  11│  14│  16│
4723 │             ╶────────────────────────────┼────┼────┼────┼────┤
4724 │              No  QN57 Yes Column ID      │  57│  59│  61│  63│
4725 │                           Layer Column ID│   9│  11│  14│  16│
4726 │                      ╶───────────────────┼────┼────┼────┼────┤
4727 │                       No  Column ID      │  57│  59│  61│  63│
4728 │                           Layer Column ID│   9│  11│  14│  16│
4729 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4730 ])
4731 AT_CLEANUP
4732
4733 AT_SETUP([CTABLES categorical summary functions])
4734 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4735 AT_DATA([ctables.sps],
4736 [[GET 'nhtsa.sav'.
4737 CTABLES
4738     /TABLE region BY qnd5a[COUNT, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTAL[COUNT, VALIDN, TOTALN]]
4739     /CATEGORIES VARIABLES=qnd5a TOTAL=YES MISSING=INCLUDE
4740     /SLABELS POSITION=ROW.
4741 ]])
4742 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
4743                                                       Custom Tables
4744 ╭─────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────╮
4745 │                 │                     D5a. What would you say is your primary ethnic background?                     │
4746 │                 ├─────┬───────┬───────┬──────────┬──────────┬─────────┬──────────┬──────────────┬──────┬───────┬─────┤
4747 │                 │     │       │       │          │          │         │          │  Multiple -  │      │       │     │
4748 │                 │     │       │       │   South  │  Central │  Puerto │ Something│ cannot choose│ Don't│       │     │
4749 │                 │Cuban│Mexican│Spanish│ American │ American │Rican, OR│   else   │      one     │ know │Refused│Total│
4750 ├─────────────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4751 │Region NE Count  │    6│      8│      8│        11│         7│       39│        23│             2│     0│      1│  105│
4752 │          Row %  │ 5.7%│   7.6%│   7.6%│     10.5%│      6.7%│    37.1%│     21.9%│          1.9%│   .0%│   1.0%│     │
4753 │          Row    │ 5.8%│   7.7%│   7.7%│     10.6%│      6.7%│    37.5%│     22.1%│          1.9%│   .0%│    .0%│     │
4754 │          Valid N│     │       │       │          │          │         │          │              │      │       │     │
4755 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4756 │          Row    │  .4%│    .6%│    .6%│       .8%│       .5%│     2.8%│      1.6%│           .1%│   .0%│    .1%│     │
4757 │          Total N│     │       │       │          │          │         │          │              │      │       │     │
4758 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4759 │          Valid N│     │       │       │          │          │         │          │              │      │       │  104│
4760 │          Total N│     │       │       │          │          │         │          │              │      │       │ 1409│
4761 │      ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4762 │       MW Count  │    3│     24│      1│         4│         5│        9│         6│             0│     0│      1│   53│
4763 │          Row %  │ 5.7%│  45.3%│   1.9%│      7.5%│      9.4%│    17.0%│     11.3%│           .0%│   .0%│   1.9%│     │
4764 │          Row    │ 5.8%│  46.2%│   1.9%│      7.7%│      9.6%│    17.3%│     11.5%│           .0%│   .0%│    .0%│     │
4765 │          Valid N│     │       │       │          │          │         │          │              │      │       │     │
4766 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4767 │          Row    │  .2%│   1.5%│    .1%│       .2%│       .3%│      .5%│       .4%│           .0%│   .0%│    .1%│     │
4768 │          Total N│     │       │       │          │          │         │          │              │      │       │     │
4769 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4770 │          Valid N│     │       │       │          │          │         │          │              │      │       │   52│
4771 │          Total N│     │       │       │          │          │         │          │              │      │       │ 1654│
4772 │      ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4773 │       S  Count  │   10│    113│     11│        14│        25│       23│        20│             2│     3│      2│  223│
4774 │          Row %  │ 4.5%│  50.7%│   4.9%│      6.3%│     11.2%│    10.3%│      9.0%│           .9%│  1.3%│    .9%│     │
4775 │          Row    │ 4.6%│  51.8%│   5.0%│      6.4%│     11.5%│    10.6%│      9.2%│           .9%│   .0%│    .0%│     │
4776 │          Valid N│     │       │       │          │          │         │          │              │      │       │     │
4777 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4778 │          Row    │  .4%│   4.7%│    .5%│       .6%│      1.0%│     1.0%│       .8%│           .1%│   .1%│    .1%│     │
4779 │          Total N│     │       │       │          │          │         │          │              │      │       │     │
4780 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4781 │          Valid N│     │       │       │          │          │         │          │              │      │       │  218│
4782 │          Total N│     │       │       │          │          │         │          │              │      │       │ 2390│
4783 │      ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4784 │       W  Count  │    1│    166│     28│         5│        15│        7│        19│             3│     0│      1│  245│
4785 │          Row %  │  .4%│  67.8%│  11.4%│      2.0%│      6.1%│     2.9%│      7.8%│          1.2%│   .0%│    .4%│     │
4786 │          Row    │  .4%│  68.0%│  11.5%│      2.0%│      6.1%│     2.9%│      7.8%│          1.2%│   .0%│    .0%│     │
4787 │          Valid N│     │       │       │          │          │         │          │              │      │       │     │
4788 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4789 │          Row    │  .1%│  10.7%│   1.8%│       .3%│      1.0%│      .5%│      1.2%│           .2%│   .0%│    .1%│     │
4790 │          Total N│     │       │       │          │          │         │          │              │      │       │     │
4791 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4792 │          Valid N│     │       │       │          │          │         │          │              │      │       │  244│
4793 │          Total N│     │       │       │          │          │         │          │              │      │       │ 1546│
4794 ╰─────────────────┴─────┴───────┴───────┴──────────┴──────────┴─────────┴──────────┴──────────────┴──────┴───────┴─────╯
4795 ])
4796 AT_CLEANUP
4797
4798 AT_SETUP([CTABLES scale summary functions])
4799 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4800 AT_DATA([ctables.sps],
4801 [[GET 'nhtsa.sav'.
4802 SET TVAR=NAME.
4803
4804 * Use SPLIT FILE with FREQUENCIES to generate output equivalent to
4805   CTABLES later, to make the results easier to verify.
4806 SPLIT FILE BY REGION.
4807 FREQUENCIES
4808     qn19a
4809     /STATISTICS=MEAN SEMEAN MEDIAN MODE STDDEV VARIANCE RANGE MINIMUM MAXIMUM SUM
4810     /FORMAT NOTABLE /MISSING=INCLUDE.
4811 SPLIT FILE OFF.
4812
4813 CTABLES
4814     /VLABELS VARIABLE=qn19a DISPLAY=NONE
4815     /TABLE region BY qn19a[VALIDN, MISSING, MEAN, SEMEAN, MEDIAN, MODE, STDDEV, VARIANCE, RANGE, MINIMUM, MAXIMUM, SUM, COUNT, TOTALN, ROWPCT.SUM]
4816     /CATEGORIES VARIABLES=qn19a TOTAL=YES MISSING=INCLUDE
4817     /SLABELS POSITION=ROW
4818     /CLABELS ROWLABELS=OPPOSITE.
4819 ]])
4820 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
4821                    Statistics
4822 ╭─────────┬───────────────────────────────────╮
4823 │         │               REGION              │
4824 │         ├────────┬────────┬────────┬────────┤
4825 │         │   NE   │   MW   │    S   │    W   │
4826 │         ├────────┼────────┼────────┼────────┤
4827 │         │  QN19A │  QN19A │  QN19A │  QN19A │
4828 ├─────────┼────────┼────────┼────────┼────────┤
4829 │N Valid  │     936│    1019│    1276│     950│
4830 │  Missing│     473│     635│    1114│     596│
4831 ├─────────┼────────┼────────┼────────┼────────┤
4832 │Mean     │   19.33│   19.83│   20.29│   19.87│
4833 ├─────────┼────────┼────────┼────────┼────────┤
4834 │S.E. Mean│     .14│     .16│     .18│     .17│
4835 ├─────────┼────────┼────────┼────────┼────────┤
4836 │Median   │   18.00│   19.00│   19.00│   19.00│
4837 ├─────────┼────────┼────────┼────────┼────────┤
4838 │Mode     │   18.00│   18.00│   18.00│   18.00│
4839 ├─────────┼────────┼────────┼────────┼────────┤
4840 │Std Dev  │    4.41│    5.15│    6.44│    5.25│
4841 ├─────────┼────────┼────────┼────────┼────────┤
4842 │Variance │   19.41│   26.47│   41.43│   27.59│
4843 ├─────────┼────────┼────────┼────────┼────────┤
4844 │Range    │   59.00│   71.00│   75.00│   61.00│
4845 ├─────────┼────────┼────────┼────────┼────────┤
4846 │Minimum  │     .00│    4.00│    4.00│    4.00│
4847 ├─────────┼────────┼────────┼────────┼────────┤
4848 │Maximum  │   59.00│   75.00│   79.00│   65.00│
4849 ├─────────┼────────┼────────┼────────┼────────┤
4850 │Sum      │18092.00│20206.00│25886.00│18877.00│
4851 ╰─────────┴────────┴────────┴────────┴────────╯
4852
4853                          Custom Tables
4854 ╭────────────────────────┬────────┬────────┬────────┬────────╮
4855 │                        │   NE   │   MW   │    S   │    W   │
4856 ├────────────────────────┼────────┼────────┼────────┼────────┤
4857 │REGION Valid N          │     936│    1019│    1276│     950│
4858 │       Missing          │  473.00│  635.00│ 1114.00│  596.00│
4859 │       Mean             │   19.33│   19.83│   20.29│   19.87│
4860 │       Std Error of Mean│     .14│     .16│     .18│     .17│
4861 │       Median           │   18.00│   19.00│   19.00│   19.00│
4862 │       Mode             │   18.00│   18.00│   18.00│   18.00│
4863 │       Std Deviation    │    4.41│    5.15│    6.44│    5.25│
4864 │       Variance         │   19.41│   26.47│   41.43│   27.59│
4865 │       Range            │   59.00│   71.00│   75.00│   61.00│
4866 │       Minimum          │     .00│    4.00│    4.00│    4.00│
4867 │       Maximum          │   59.00│   75.00│   79.00│   65.00│
4868 │       Sum              │18092.00│20206.00│25886.00│18877.00│
4869 │       Count            │    1409│    1654│    2390│    1546│
4870 │       Total N          │    1409│    1654│    2390│    1546│
4871 │       Row Sum %        │   21.8%│   24.3%│   31.2%│   22.7%│
4872 ╰────────────────────────┴────────┴────────┴────────┴────────╯
4873 ])
4874 AT_CLEANUP
4875
4876 AT_SETUP([CTABLES scale summary functions - weighting])
4877 weight=1
4878 c=10
4879 for a in 1 2 9; do
4880     for b in 3 4 9; do
4881         for n in 1 2 3 4 5 6 7 8 9 10; do
4882             if test $c -lt 15; then
4883                 cval=.
4884             else
4885                 cval=$c
4886             fi
4887             printf "$weight $a $b $cval\n"
4888             weight=$(expr \( $weight + 3 \) % 7 + 2)
4889             c=$(expr \( $c + 13 \) % 29 + 7)
4890         done
4891     done
4892 done > ctables.txt
4893
4894 AT_DATA([analysis.sps],
4895 [[* Use SPLIT FILE with FREQUENCIES to generate output equivalent to
4896   CTABLES later, to make the results easier to verify.
4897 SPLIT FILE BY a b.
4898 FREQUENCIES
4899     c
4900     /STATISTICS=MEAN SEMEAN MEDIAN MODE STDDEV VARIANCE RANGE MINIMUM MAXIMUM SUM
4901     /FORMAT NOTABLE /MISSING=INCLUDE.
4902 SPLIT FILE OFF.
4903
4904 CTABLES
4905     /TABLE c[VALIDN, MISSING, MEAN F8.2, SEMEAN F8.2, MEDIAN F8.2, MODE, STDDEV F8.2, VARIANCE F8.2, RANGE F8.2, MINIMUM, MAXIMUM, SUM F8.2, COUNT, TOTALN, LAYERROWPCT.SUM] BY a>b
4906     /SLABELS POSITION=ROW
4907     /CATEGORIES VARIABLES=a b MISSING=INCLUDE.
4908 ]])
4909
4910 AT_DATA([ctables.sps],
4911 [[DATA LIST LIST NOTABLE FILE='ctables.txt'
4912     /w (F5.0) a b c (f2.0).
4913 VAR LEVEL w c (SCALE) a b (NOMINAL).
4914 MISSING VALUES a b (9).
4915
4916 INCLUDE 'analysis.sps'.
4917
4918 WEIGHT BY w.
4919 INCLUDE 'analysis.sps'.
4920
4921 * Same as original analysis using unweighted versions of summaries.
4922 CTABLES
4923     /TABLE c[UVALIDN, UMISSING, UMEAN F8.2, USEMEAN F8.2, UMEDIAN F8.2, UMODE, USTDDEV F8.2, UVARIANCE F8.2, USUM F8.2, UCOUNT, UTOTALN, ULAYERROWPCT.SUM] BY a>b
4924     /SLABELS POSITION=ROW
4925     /CATEGORIES VARIABLES=a b MISSING=INCLUDE.
4926 ]])
4927 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
4928                                 Statistics
4929 ╭─────────┬──────────────────────────────────────────────────────────────╮
4930 │         │                               a                              │
4931 │         ├────────────────────┬────────────────────┬────────────────────┤
4932 │         │          1         │          2         │          9         │
4933 │         ├────────────────────┼────────────────────┼────────────────────┤
4934 │         │          b         │          b         │          b         │
4935 │         ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
4936 │         │   3  │   4  │   9  │   3  │   4  │   9  │   3  │   4  │   9  │
4937 │         ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4938 │         │   c  │   c  │   c  │   c  │   c  │   c  │   c  │   c  │   c  │
4939 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4940 │N Valid  │     7│     6│     8│     7│     7│     8│     7│     7│     8│
4941 │  Missing│     3│     4│     2│     3│     3│     2│     3│     3│     2│
4942 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4943 │Mean     │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
4944 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4945 │S.E. Mean│  2.44│  2.14│  2.58│  2.44│  2.18│  2.43│  2.36│  2.18│  2.47│
4946 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4947 │Median   │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
4948 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4949 │Mode     │    16│    18│    15│    16│    18│    15│    16│    18│    15│
4950 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4951 │Std Dev  │  6.47│  5.24│  7.31│  6.47│  5.77│  6.88│  6.24│  5.77│  6.98│
4952 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4953 │Variance │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
4954 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4955 │Range    │ 18.00│ 13.00│ 20.00│ 18.00│ 15.00│ 20.00│ 18.00│ 15.00│ 20.00│
4956 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4957 │Minimum  │    16│    18│    15│    16│    18│    15│    16│    18│    15│
4958 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4959 │Maximum  │    34│    31│    35│    34│    33│    35│    34│    33│    35│
4960 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4961 │Sum      │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
4962 ╰─────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
4963
4964                                     Custom Tables
4965 ╭───────────────────┬──────────────────────────────────────────────────────────────╮
4966 │                   │                               a                              │
4967 │                   ├────────────────────┬────────────────────┬────────────────────┤
4968 │                   │          1         │          2         │          9         │
4969 │                   ├────────────────────┼────────────────────┼────────────────────┤
4970 │                   │          b         │          b         │          b         │
4971 │                   ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
4972 │                   │   3  │   4  │   9  │   3  │   4  │   9  │   3  │   4  │   9  │
4973 ├───────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4974 │c Valid N          │     7│     6│     8│     7│     7│     8│     7│     7│     8│
4975 │  Missing          │     3│     4│     2│     3│     3│     2│     3│     3│     2│
4976 │  Mean             │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
4977 │  Std Error of Mean│  2.44│  2.14│  2.58│  2.44│  2.18│  2.43│  2.36│  2.18│  2.47│
4978 │  Median           │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
4979 │  Mode             │    16│    18│    15│    16│    18│    15│    16│    18│    15│
4980 │  Std Deviation    │  6.47│  5.24│  7.31│  6.47│  5.77│  6.88│  6.24│  5.77│  6.98│
4981 │  Variance         │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
4982 │  Range            │ 18.00│ 13.00│ 20.00│ 18.00│ 15.00│ 20.00│ 18.00│ 15.00│ 20.00│
4983 │  Minimum          │    16│    18│    15│    16│    18│    15│    16│    18│    15│
4984 │  Maximum          │    34│    31│    35│    34│    33│    35│    34│    33│    35│
4985 │  Sum              │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
4986 │  Count            │    10│    10│    10│    10│    10│    10│    10│    10│    10│
4987 │  Total N          │    10│    10│    10│    10│    10│    10│    10│    10│    10│
4988 │  Layer Row Sum %  │ 26.3%│ 21.3%│     .│ 26.3%│ 26.1%│     .│     .│     .│     .│
4989 ╰───────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
4990
4991                                   Statistics
4992 ╭─────────┬─────────────────────────────────────────────────────────────────╮
4993 │         │                                a                                │
4994 │         ├─────────────────────┬─────────────────────┬─────────────────────┤
4995 │         │          1          │          2          │          9          │
4996 │         ├─────────────────────┼─────────────────────┼─────────────────────┤
4997 │         │          b          │          b          │          b          │
4998 │         ├───────┬──────┬──────┼──────┬───────┬──────┼──────┬──────┬───────┤
4999 │         │   3   │   4  │   9  │   3  │   4   │   9  │   3  │   4  │   9   │
5000 │         ├───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5001 │         │   c   │   c  │   c  │   c  │   c   │   c  │   c  │   c  │   c   │
5002 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5003 │N Valid  │     40│    35│    41│    26│     38│    40│    34│    32│     39│
5004 │  Missing│      6│    14│    11│    22│     13│     7│    16│    21│     10│
5005 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5006 │Mean     │  27.23│ 24.20│ 22.63│ 27.96│  27.21│ 23.48│ 23.71│ 25.47│  26.03│
5007 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5008 │S.E. Mean│    .93│   .75│  1.03│  1.12│    .84│   .87│  1.01│  1.05│   1.01│
5009 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5010 │Median   │  30.00│ 22.00│ 19.00│ 30.00│  29.00│ 24.00│ 23.00│ 24.00│  28.00│
5011 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5012 │Mode     │     34│    29│    19│    34│     33│    28│    23│    18│     30│
5013 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5014 │Std Dev  │   5.89│  4.42│  6.59│  5.69│   5.16│  5.50│  5.87│  5.94│   6.30│
5015 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5016 │Variance │  34.64│ 19.52│ 43.39│ 32.36│  26.66│ 30.20│ 34.46│ 35.29│  39.71│
5017 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5018 │Range    │  18.00│ 13.00│ 20.00│ 18.00│  15.00│ 20.00│ 18.00│ 15.00│  20.00│
5019 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5020 │Minimum  │     16│    18│    15│    16│     18│    15│    16│    18│     15│
5021 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5022 │Maximum  │     34│    31│    35│    34│     33│    35│    34│    33│     35│
5023 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5024 │Sum      │1089.00│847.00│928.00│727.00│1034.00│939.00│806.00│815.00│1015.00│
5025 ╰─────────┴───────┴──────┴──────┴──────┴───────┴──────┴──────┴──────┴───────╯
5026
5027                                      Custom Tables
5028 ╭───────────────────┬─────────────────────────────────────────────────────────────────╮
5029 │                   │                                a                                │
5030 │                   ├─────────────────────┬─────────────────────┬─────────────────────┤
5031 │                   │          1          │          2          │          9          │
5032 │                   ├─────────────────────┼─────────────────────┼─────────────────────┤
5033 │                   │          b          │          b          │          b          │
5034 │                   ├───────┬──────┬──────┼──────┬───────┬──────┼──────┬──────┬───────┤
5035 │                   │   3   │   4  │   9  │   3  │   4   │   9  │   3  │   4  │   9   │
5036 ├───────────────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5037 │c Valid N          │     40│    35│    41│    26│     38│    40│    34│    32│     39│
5038 │  Missing          │      6│    14│    11│    22│     13│     7│    16│    21│     10│
5039 │  Mean             │  27.22│ 24.20│ 22.63│ 27.96│  27.21│ 23.48│ 23.71│ 25.47│  26.03│
5040 │  Std Error of Mean│    .93│   .75│  1.03│  1.12│    .84│   .87│  1.01│  1.05│   1.01│
5041 │  Median           │  30.00│ 22.00│ 19.00│ 30.00│  29.00│ 24.00│ 23.00│ 24.00│  28.00│
5042 │  Mode             │     34│    29│    19│    34│     33│    28│    23│    18│     30│
5043 │  Std Deviation    │   5.89│  4.42│  6.59│  5.69│   5.16│  5.50│  5.87│  5.94│   6.30│
5044 │  Variance         │  34.64│ 19.52│ 43.39│ 32.36│  26.66│ 30.20│ 34.46│ 35.29│  39.71│
5045 │  Range            │  18.00│ 13.00│ 20.00│ 18.00│  15.00│ 20.00│ 18.00│ 15.00│  20.00│
5046 │  Minimum          │     16│    18│    15│    16│     18│    15│    16│    18│     15│
5047 │  Maximum          │     34│    31│    35│    34│     33│    35│    34│    33│     35│
5048 │  Sum              │1089.00│847.00│928.00│727.00│1034.00│939.00│806.00│815.00│1015.00│
5049 │  Count            │     46│    49│    52│    48│     51│    47│    50│    53│     49│
5050 │  Total N          │     46│    49│    52│    48│     51│    47│    50│    53│     49│
5051 │  Layer Row Sum %  │  29.5%│ 22.9%│     .│ 19.7%│  28.0%│     .│     .│     .│      .│
5052 ╰───────────────────┴───────┴──────┴──────┴──────┴───────┴──────┴──────┴──────┴───────╯
5053
5054                                         Custom Tables
5055 ╭────────────────────────────┬──────────────────────────────────────────────────────────────╮
5056 │                            │                               a                              │
5057 │                            ├────────────────────┬────────────────────┬────────────────────┤
5058 │                            │          1         │          2         │          9         │
5059 │                            ├────────────────────┼────────────────────┼────────────────────┤
5060 │                            │          b         │          b         │          b         │
5061 │                            ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
5062 │                            │   3  │   4  │   9  │   3  │   4  │   9  │   3  │   4  │   9  │
5063 ├────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5064 │c Valid N                   │     7│     6│     8│     7│     7│     8│     7│     7│     8│
5065 │  Missing                   │     3│     4│     2│     3│     3│     2│     3│     3│     2│
5066 │  Unweighted Mean           │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
5067 │  Std Error of Mean         │  2.44│  2.14│  2.58│  2.44│  2.18│  2.43│  2.36│  2.18│  2.47│
5068 │  Median                    │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
5069 │  Mode                      │    16│    18│    15│    16│    18│    15│    16│    18│    15│
5070 │  Std Deviation             │  6.47│  5.24│  7.31│  6.47│  5.77│  6.88│  6.24│  5.77│  6.98│
5071 │  Variance                  │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
5072 │  Sum                       │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
5073 │  Unweighted Count          │    10│    10│    10│    10│    10│    10│    10│    10│    10│
5074 │  Total N                   │    10│    10│    10│    10│    10│    10│    10│    10│    10│
5075 │  Unweighted Layer Row Sum %│ 26.3%│ 21.3%│     .│ 26.3%│ 26.1%│     .│     .│     .│     .│
5076 ╰────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
5077 ])
5078 AT_CLEANUP
5079
5080 AT_SETUP([CTABLES hidden scale VLABELS])
5081 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
5082 AT_DATA([ctables.sps],
5083 [[GET 'nhtsa.sav'.
5084 CTABLES
5085     /TABLE region BY qn19a + qn35
5086     /SLABELS POSITION=ROW.
5087 CTABLES
5088     /VLABELS VARIABLE=qn19a DISPLAY=NONE
5089     /TABLE region BY qn19a + qn35
5090     /SLABELS POSITION=ROW.
5091 CTABLES
5092     /VLABELS VARIABLE=qn35 DISPLAY=NONE
5093     /TABLE region BY qn19a + qn35
5094     /SLABELS POSITION=ROW.
5095
5096 * This one in particular caused a crash because no categories were
5097   created on the column axis, so passing in 0 for the index was still
5098   too big for that number of categories.  It was fixed by creating a
5099   name-only category for each variable despite the "NONE" request,
5100   then hiding the entire dimension's labels if all its labels were
5101   set to "NONE".
5102 CTABLES
5103     /VLABELS VARIABLE=qn19a qn35 DISPLAY=NONE
5104     /TABLE region BY qn19a + qn35
5105     /SLABELS POSITION=ROW.
5106 ]])
5107 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
5108                                  Custom Tables
5109 ╭──────────────┬────────────────────────────┬─────────────────────────────────╮
5110 │              │ 19a. About how old were you│ 35. In the past thirty days, how│
5111 │              │   when you first starting  │   many times have you driven a  │
5112 │              │    drinking alcohol, not   │  motor vehicle WITHIN TWO HOURS │
5113 │              │  counting small tastes or  │     AFTER drinking alcoholic    │
5114 │              │      sips of alcohol.      │            beverages?           │
5115 ├──────────────┼────────────────────────────┼─────────────────────────────────┤
5116 │Region NE Mean│                       19.33│                                2│
5117 │      ╶───────┼────────────────────────────┼─────────────────────────────────┤
5118 │       MW Mean│                       19.83│                                2│
5119 │      ╶───────┼────────────────────────────┼─────────────────────────────────┤
5120 │       S  Mean│                       20.29│                                2│
5121 │      ╶───────┼────────────────────────────┼─────────────────────────────────┤
5122 │       W  Mean│                       19.87│                                2│
5123 ╰──────────────┴────────────────────────────┴─────────────────────────────────╯
5124
5125                                  Custom Tables
5126 ╭──────────────┬─────┬────────────────────────────────────────────────────────╮
5127 │              │     │  35. In the past thirty days, how many times have you  │
5128 │              │     │ driven a motor vehicle WITHIN TWO HOURS AFTER drinking │
5129 │              │QN19A│                  alcoholic beverages?                  │
5130 ├──────────────┼─────┼────────────────────────────────────────────────────────┤
5131 │Region NE Mean│19.33│                                                       2│
5132 │      ╶───────┼─────┼────────────────────────────────────────────────────────┤
5133 │       MW Mean│19.83│                                                       2│
5134 │      ╶───────┼─────┼────────────────────────────────────────────────────────┤
5135 │       S  Mean│20.29│                                                       2│
5136 │      ╶───────┼─────┼────────────────────────────────────────────────────────┤
5137 │       W  Mean│19.87│                                                       2│
5138 ╰──────────────┴─────┴────────────────────────────────────────────────────────╯
5139
5140                                  Custom Tables
5141 ╭──────────────┬─────────────────────────────────────────────────────────┬────╮
5142 │              │   19a. About how old were you when you first starting   │    │
5143 │              │  drinking alcohol, not counting small tastes or sips of │    │
5144 │              │                         alcohol.                        │qn35│
5145 ├──────────────┼─────────────────────────────────────────────────────────┼────┤
5146 │Region NE Mean│                                                    19.33│   2│
5147 │      ╶───────┼─────────────────────────────────────────────────────────┼────┤
5148 │       MW Mean│                                                    19.83│   2│
5149 │      ╶───────┼─────────────────────────────────────────────────────────┼────┤
5150 │       S  Mean│                                                    20.29│   2│
5151 │      ╶───────┼─────────────────────────────────────────────────────────┼────┤
5152 │       W  Mean│                                                    19.87│   2│
5153 ╰──────────────┴─────────────────────────────────────────────────────────┴────╯
5154
5155       Custom Tables
5156 ╭──────────────┬───────╮
5157 │Region NE Mean│19.33 2│
5158 │      ╶───────┼───────┤
5159 │       MW Mean│19.83 2│
5160 │      ╶───────┼───────┤
5161 │       S  Mean│20.29 2│
5162 │      ╶───────┼───────┤
5163 │       W  Mean│19.87 2│
5164 ╰──────────────┴───────╯
5165 ])
5166 AT_CLEANUP
5167
5168 AT_SETUP([CTABLES with SPLIT FILE])
5169 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
5170 AT_DATA([ctables.sps],
5171 [[GET 'nhtsa.sav'.
5172
5173 SORT CASES BY qns3a.
5174
5175 CTABLES /TABLE qn105ba.
5176
5177 * Layered split has no effect on output.
5178 SPLIT FILE BY qns3a.
5179 CTABLES /TABLE qn105ba.
5180
5181 * Add column variable qns3a to compare against separate splits.
5182 CTABLES /TABLE qn105ba BY qns3a.
5183
5184 * Separate splits are truly output separately.
5185 SPLIT FILE SEPARATE BY qns3a.
5186 CTABLES /TABLE qn105ba.
5187 ]])
5188 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
5189                                   Custom Tables
5190 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5191 │                                                                        │Count│
5192 ├────────────────────────────────────────────────────────────────────────┼─────┤
5193 │105b. How likely is it that drivers who have had too much   Almost      │  700│
5194 │to drink to drive safely will A. Get stopped by the police? certain     │     │
5195 │                                                            Very likely │ 1502│
5196 │                                                            Somewhat    │ 2763│
5197 │                                                            likely      │     │
5198 │                                                            Somewhat    │ 1307│
5199 │                                                            unlikely    │     │
5200 │                                                            Very        │  609│
5201 │                                                            unlikely    │     │
5202 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5203
5204                                   Custom Tables
5205 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5206 │                                                                        │Count│
5207 ├────────────────────────────────────────────────────────────────────────┼─────┤
5208 │105b. How likely is it that drivers who have had too much   Almost      │  700│
5209 │to drink to drive safely will A. Get stopped by the police? certain     │     │
5210 │                                                            Very likely │ 1502│
5211 │                                                            Somewhat    │ 2763│
5212 │                                                            likely      │     │
5213 │                                                            Somewhat    │ 1307│
5214 │                                                            unlikely    │     │
5215 │                                                            Very        │  609│
5216 │                                                            unlikely    │     │
5217 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5218
5219                                   Custom Tables
5220 ╭─────────────────────────────────────────────────────────────────┬────────────╮
5221 │                                                                 │S3a. GENDER:│
5222 │                                                                 ├─────┬──────┤
5223 │                                                                 │ Male│Female│
5224 │                                                                 ├─────┼──────┤
5225 │                                                                 │Count│ Count│
5226 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
5227 │105b. How likely is it that drivers who have had too Almost      │  297│   403│
5228 │much to drink to drive safely will A. Get stopped by certain     │     │      │
5229 │the police?                                          Very likely │  660│   842│
5230 │                                                     Somewhat    │ 1174│  1589│
5231 │                                                     likely      │     │      │
5232 │                                                     Somewhat    │  640│   667│
5233 │                                                     unlikely    │     │      │
5234 │                                                     Very        │  311│   298│
5235 │                                                     unlikely    │     │      │
5236 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
5237
5238     Split Values
5239 ╭────────────┬─────╮
5240 │Variable    │Value│
5241 ├────────────┼─────┤
5242 │S3a. GENDER:│Male │
5243 ╰────────────┴─────╯
5244
5245                                   Custom Tables
5246 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5247 │                                                                        │Count│
5248 ├────────────────────────────────────────────────────────────────────────┼─────┤
5249 │105b. How likely is it that drivers who have had too much   Almost      │  297│
5250 │to drink to drive safely will A. Get stopped by the police? certain     │     │
5251 │                                                            Very likely │  660│
5252 │                                                            Somewhat    │ 1174│
5253 │                                                            likely      │     │
5254 │                                                            Somewhat    │  640│
5255 │                                                            unlikely    │     │
5256 │                                                            Very        │  311│
5257 │                                                            unlikely    │     │
5258 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5259
5260      Split Values
5261 ╭────────────┬──────╮
5262 │Variable    │ Value│
5263 ├────────────┼──────┤
5264 │S3a. GENDER:│Female│
5265 ╰────────────┴──────╯
5266
5267                                   Custom Tables
5268 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5269 │                                                                        │Count│
5270 ├────────────────────────────────────────────────────────────────────────┼─────┤
5271 │105b. How likely is it that drivers who have had too much   Almost      │  403│
5272 │to drink to drive safely will A. Get stopped by the police? certain     │     │
5273 │                                                            Very likely │  842│
5274 │                                                            Somewhat    │ 1589│
5275 │                                                            likely      │     │
5276 │                                                            Somewhat    │  667│
5277 │                                                            unlikely    │     │
5278 │                                                            Very        │  298│
5279 │                                                            unlikely    │     │
5280 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5281 ])
5282 AT_CLEANUP
5283
5284 AT_SETUP([CTABLES variable level inference])
5285 AT_DATA([data.txt], [dnl
5286 dnl n1 has 10 unique small values -> nominal.
5287 dnl n2 has 23 unique small values -> nominal.
5288 dnl n3 is all missing -> nominal.
5289 dnl s1 has 24 unique small values -> scale.
5290 dnl s2 has one negative value -> scale.
5291 dnl s3 has one non-integer value -> scale.
5292 dnl s4 has no valid values less than 10 -> scale.
5293 dnl s5 has no valid values less than 10,000 -> scale.
5294 1  1  . 1  1  1    10 10001
5295 2  2  . 2  2  2    11 10002
5296 3  3  . 3  3  3    12 10003
5297 4  4  . 4  4  4    13 10004
5298 5  5  . 5  5  5    14 10005
5299 6  6  . 6  6  6    15 10006
5300 7  7  . 7  7  7    16 10007
5301 8  8  . 8  8  8    17 10008
5302 9  9  . 9  9  9    18 10009
5303 10 10 . 10 10 10.5 19 110000
5304 1  11 . 11 -1 1    11 10001
5305 2  12 . 12 2  2    12 10002
5306 3  13 . 13 3  3    13 10003
5307 4  14 . 14 4  4    14 10004
5308 5  15 . 15 5  5    15 10005
5309 6  16 . 16 6  6    16 10006
5310 7  17 . 17 7  7    17 10007
5311 8  18 . 18 8  8    18 10008
5312 9  19 . 19 9  9    19 10009
5313 1  20 . 20 1  1    20 10001
5314 2  21 . 21 2  2    21 10002
5315 3  22 . 22 3  3    22 10003
5316 4  23 . 23 4  4    23 10004
5317 5  23 . 24 5  5    24 10005
5318 6  23 . 24 6  6    25 10006
5319 ])
5320
5321 AT_DATA([ctables.sps], [dnl
5322 DATA LIST LIST file='data.txt' NOTABLE /n1 to n3 s1 to s5.
5323
5324 * Nominal formats (copied from data that will default to scale).
5325 COMPUTE n4=s1.
5326 COMPUTE n5=s1.
5327 FORMATS n4(WKDAY5) n5(MONTH5).
5328
5329 * Scale formats (copied from data that will default to nominal).
5330 COMPUTE s6=n1.
5331 COMPUTE s7=n1.
5332 COMPUTE s8=n1.
5333 FORMATS s6(DOLLAR6.2) s7(CCA8.2) s8(DATETIME17).
5334
5335 STRING string(A8).
5336
5337 DISPLAY DICTIONARY.
5338 CTABLES /TABLE n1 + n2 + n3 + string + s1 + s2 + s3 + s4 + s5.
5339 DISPLAY DICTIONARY.
5340 ])
5341
5342 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
5343                                     Variables
5344 ╭──────┬────────┬──────────────┬─────┬─────┬─────────┬────────────┬────────────╮
5345 │      │        │  Measurement │     │     │         │            │            │
5346 │Name  │Position│     Level    │ Role│Width│Alignment│Print Format│Write Format│
5347 ├──────┼────────┼──────────────┼─────┼─────┼─────────┼────────────┼────────────┤
5348 │n1    │       1│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5349 │n2    │       2│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5350 │n3    │       3│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5351 │s1    │       4│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5352 │s2    │       5│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5353 │s3    │       6│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5354 │s4    │       7│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5355 │s5    │       8│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5356 │n4    │       9│Unknown       │Input│    8│Right    │WKDAY5      │WKDAY5      │
5357 │n5    │      10│Unknown       │Input│    8│Right    │MONTH5      │MONTH5      │
5358 │s6    │      11│Unknown       │Input│    8│Right    │DOLLAR6.2   │DOLLAR6.2   │
5359 │s7    │      12│Unknown       │Input│    8│Right    │CCA8.2      │CCA8.2      │
5360 │s8    │      13│Unknown       │Input│    8│Right    │DATETIME17.0│DATETIME17.0│
5361 │string│      14│Nominal       │Input│    8│Left     │A8          │A8          │
5362 ╰──────┴────────┴──────────────┴─────┴─────┴─────────┴────────────┴────────────╯
5363
5364         Custom Tables
5365 ╭────────────┬─────┬────────╮
5366 │            │Count│  Mean  │
5367 ├────────────┼─────┼────────┤
5368 │n1     1.00 │    3│        │
5369 │       2.00 │    3│        │
5370 │       3.00 │    3│        │
5371 │       4.00 │    3│        │
5372 │       5.00 │    3│        │
5373 │       6.00 │    3│        │
5374 │       7.00 │    2│        │
5375 │       8.00 │    2│        │
5376 │       9.00 │    2│        │
5377 │       10.00│    1│        │
5378 ├────────────┼─────┼────────┤
5379 │n2     1.00 │    1│        │
5380 │       2.00 │    1│        │
5381 │       3.00 │    1│        │
5382 │       4.00 │    1│        │
5383 │       5.00 │    1│        │
5384 │       6.00 │    1│        │
5385 │       7.00 │    1│        │
5386 │       8.00 │    1│        │
5387 │       9.00 │    1│        │
5388 │       10.00│    1│        │
5389 │       11.00│    1│        │
5390 │       12.00│    1│        │
5391 │       13.00│    1│        │
5392 │       14.00│    1│        │
5393 │       15.00│    1│        │
5394 │       16.00│    1│        │
5395 │       17.00│    1│        │
5396 │       18.00│    1│        │
5397 │       19.00│    1│        │
5398 │       20.00│    1│        │
5399 │       21.00│    1│        │
5400 │       22.00│    1│        │
5401 │       23.00│    3│        │
5402 ├────────────┼─────┼────────┤
5403 │string      │   25│        │
5404 ├────────────┼─────┼────────┤
5405 │s1          │     │   12.96│
5406 ├────────────┼─────┼────────┤
5407 │s2          │     │    4.76│
5408 ├────────────┼─────┼────────┤
5409 │s3          │     │    4.86│
5410 ├────────────┼─────┼────────┤
5411 │s4          │     │   16.60│
5412 ├────────────┼─────┼────────┤
5413 │s5          │     │14004.44│
5414 ╰────────────┴─────┴────────╯
5415
5416                                     Variables
5417 ╭──────┬────────┬──────────────┬─────┬─────┬─────────┬────────────┬────────────╮
5418 │      │        │  Measurement │     │     │         │            │            │
5419 │Name  │Position│     Level    │ Role│Width│Alignment│Print Format│Write Format│
5420 ├──────┼────────┼──────────────┼─────┼─────┼─────────┼────────────┼────────────┤
5421 │n1    │       1│Nominal       │Input│    8│Right    │F8.2        │F8.2        │
5422 │n2    │       2│Nominal       │Input│    8│Right    │F8.2        │F8.2        │
5423 │n3    │       3│Nominal       │Input│    8│Right    │F8.2        │F8.2        │
5424 │s1    │       4│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5425 │s2    │       5│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5426 │s3    │       6│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5427 │s4    │       7│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5428 │s5    │       8│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5429 │n4    │       9│Nominal       │Input│    8│Right    │WKDAY5      │WKDAY5      │
5430 │n5    │      10│Nominal       │Input│    8│Right    │MONTH5      │MONTH5      │
5431 │s6    │      11│Scale         │Input│    8│Right    │DOLLAR6.2   │DOLLAR6.2   │
5432 │s7    │      12│Scale         │Input│    8│Right    │CCA8.2      │CCA8.2      │
5433 │s8    │      13│Scale         │Input│    8│Right    │DATETIME17.0│DATETIME17.0│
5434 │string│      14│Nominal       │Input│    8│Left     │A8          │A8          │
5435 ╰──────┴────────┴──────────────┴─────┴─────┴─────────┴────────────┴────────────╯
5436 ])
5437 AT_CLEANUP