add examples
[pspp] / tests / language / stats / ctables.at
1 AT_BANNER([CTABLES])
2
3 dnl Features not yet implemented:
4 dnl - Multiple response sets
5 dnl - MRSETS subcommand.
6 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
7 dnl - SIGTEST
8 dnl - COMPARETEST
9 dnl - Summary functions:
10 dnl   * .LCL and .UCL suffixes.
11 dnl   * .SE suffixes.
12 dnl - CATEGORIES:
13 dnl   * Data-dependent sorting.
14
15 AT_SETUP([CTABLES parsing])
16 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
17 AT_DATA([ctables.sps],
18 [[GET 'nhtsa.sav'.
19 CTABLES
20     /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
21     /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
22     /FORMAT UNITS=CM EMPTY="(-)"
23     /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
24     /VLABELS VARIABLES=qn17 DISPLAY=NAME
25     /VLABELS VARIABLES=qns3a DISPLAY=LABEL
26     /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
27     /VLABELS VARIABLES=qn20 DISPLAY=NONE
28     /MRSETS COUNTDUPLICATES=NO
29     /MRSETS COUNTDUPLICATES=YES
30     /SMISSING VARIABLE
31     /SMISSING LISTWISE
32     /WEIGHT VARIABLE=qns3a
33     /HIDESMALLCOUNTS
34     /HIDESMALLCOUNTS COUNT=10
35     /TABLE qnsa1
36     /SLABELS POSITION=COLUMN VISIBLE=YES
37     /SLABELS VISIBLE=NO POSITION=ROW
38     /SLABELS POSITION=LAYER
39     /CLABELS AUTO
40     /CLABELS ROWLABELS=OPPOSITE
41     /CRITERIA CILEVEL=50
42     /CATEGORIES VARIABLES=qn1 qn17
43                 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
44                 POSITION=BEFORE EMPTY=INCLUDE.
45 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
46 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
47 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
48 ]])
49 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
50          Custom Tables
51 Count
52 ╭───────────────────┬────┬────╮
53 │                   │ RDD│CELL│
54 ├───────────────────┼────┼────┤
55 │Sa1. SAMPLE SOURCE:│5392│1607│
56 ╰───────────────────┴────┴────╯
57
58        Custom Tables
59 RDD
60 ╭───────────────────┬─────╮
61 │                   │Count│
62 ├───────────────────┼─────┤
63 │Sa1. SAMPLE SOURCE:│ 5392│
64 ╰───────────────────┴─────╯
65
66           Custom Tables
67 ╭────────────────────────┬─────╮
68 │                        │Count│
69 ├────────────────────────┼─────┤
70 │Sa1. SAMPLE SOURCE: RDD │ 5392│
71 │                    CELL│ 1607│
72 ╰────────────────────────┴─────╯
73
74           Custom Tables
75 ╭────────────────────────┬─────╮
76 │                        │Count│
77 ├────────────────────────┼─────┤
78 │Sa1. SAMPLE SOURCE: RDD │ 5392│
79 │                    CELL│ 1607│
80 ╰────────────────────────┴─────╯
81 ])
82 AT_CLEANUP
83
84 AT_SETUP([CTABLES parsing - negative])
85 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
86 AT_DATA([ctables.sps],
87 [[GET 'nhtsa.sav'.
88 CTABLES.
89 CTABLES /FORMAT MINCOLWIDTH='foo'.
90 CTABLES /TABLE qn1 [**].
91 CTABLES /TABLE qn1 [NOTAFUNCTION].
92 CTABLES /TABLE (qn1.
93 CTABLES /TABLE **.
94 CTABLES /TABLE NOTAVAR.
95 STRING string(A8).
96 CTABLES /TABLE string[S].
97 CTABLES /TABLE qn1 [PTILE 101].
98 CTABLES /TABLE qn1 [MEAN F0.1].
99 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
100 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
101 CTABLES /TABLE qn1 [MEAN TOTALS].
102 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
103 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
104 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
105 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
106 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
107 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
108 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
109 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
110 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
111 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
112 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
113 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
114 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
115 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
116 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
117 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
118 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
119 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
120 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
121 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
122 CTABLES /PCOMPUTE &k=EXPR([LO **]).
123 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
124 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
125 CTABLES /PCOMPUTE &k=EXPR([1**]).
126 CTABLES /PCOMPUTE &k=EXPR((1x)).
127 CTABLES /PCOMPUTE **k.
128 CTABLES /PCOMPUTE &1.
129 CTABLES /PCOMPUTE &k**.
130 CTABLES /PCOMPUTE &k=**.
131 CTABLES /PCOMPUTE &k=EXPR**.
132 CTABLES /PCOMPUTE &k=EXPR(1x).
133 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
134 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
135 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
136 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
137 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
138 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
139 CTABLES /FORMAT EMPTY=**.
140 CTABLES /FORMAT MISSING=**.
141 CTABLES /FORMAT **.
142 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
143 CTABLES /VLABELS **.
144 CTABLES /VLABELS VARIABLES=NOTAVAR.
145 CTABLES /VLABELS VARIABLES=qn1 **.
146 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
147 CTABLES /MRSETS **.
148 CTABLES /MRSETS COUNTDUPLICATES=**.
149 CTABLES /SMISSING **.
150 CTABLES /WEIGHT **.
151 CTABLES /WEIGHT VARIABLE=NOTAVAR.
152 CTABLES /HIDESMALLCOUNTS COUNT=1.
153 CTABLES /QUUX.
154 CTABLES /HIDESMALLCOUNTS COUNT=2.
155 CTABLES /TABLE qn1**.
156 CTABLES /TABLE qn1 /SLABELS POSITION=**.
157 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
158 CTABLES /TABLE qn1 /SLABELS **.
159 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
160 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
161 CTABLES /TABLE qn1 /CLABELS **.
162 CTABLES /TABLE qn1 /CRITERIA **.
163 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
164 CTABLES /TABLE qn1 /TITLES **.
165 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
166 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
167 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
168 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
169 CTABLES /TABLE qn1 /SIGTEST **.
170 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
171 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
172 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
173 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
174 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
175 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
176 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
177 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
178 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
179 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
180 CTABLES /TABLE qn1 /COMPARETEST **.
181 CTABLES /TABLE qn1 / **.
182 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
183 CTABLES /TABLE qn20 > qnd1.
184 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
185 NUMERIC datetime (DATETIME17.0).
186 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
187 ]])
188 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
189 [[ctables.sps:2.8: error: CTABLES: Syntax error at end of command: expecting `/'.
190
191 ctables.sps:3.29-3.33: error: CTABLES: Syntax error at `'foo'': Expected non-
192 negative number for MINCOLWIDTH.
193
194 ctables.sps:4.21-4.22: error: CTABLES: Syntax error at `**': expecting
195 identifier.
196
197 ctables.sps:5.21-5.32: error: CTABLES: Syntax error at `NOTAFUNCTION': Expecting
198 summary function name.
199
200 ctables.sps:6.20: error: CTABLES: Syntax error at end of command: expecting `@:}@'.
201
202 ctables.sps:7.16-7.17: error: CTABLES: Syntax error at `**': expecting
203 identifier.
204
205 ctables.sps:8: error: CTABLES: NOTAVAR is not a variable name.
206
207 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
208 scale variable.
209    10 | CTABLES /TABLE string[S].
210       |                ^~~~~~~~~
211
212 ctables.sps:11.27-11.29: error: CTABLES: Syntax error at `101': Expected number
213 between 0 and 100 for PTILE.
214
215 ctables.sps:12: error: CTABLES: Output format F0.1 specifies width 0, but F
216 requires a width between 1 and 40.
217
218 ctables.sps:13.26-13.36: error: CTABLES: Syntax error at `NEGPAREN1.2': Output
219 format NEGPAREN requires width 2 or greater.
220
221 ctables.sps:14.26-14.36: error: CTABLES: Syntax error at `NEGPAREN3.4': Output
222 format NEGPAREN requires width greater than decimals.
223
224 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
225 scale variables.
226    15 | CTABLES /TABLE qn1 [MEAN TOTALS].
227       |                     ^~~~
228
229 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
230    15 | CTABLES /TABLE qn1 [MEAN TOTALS].
231       |                ^~~
232
233 ctables.sps:15.32: error: CTABLES: Syntax error at `@:>@': expecting `@<:@'.
234
235 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
236 scale variables.
237    16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
238       |                     ^~~~
239
240 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
241    16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
242       |                ^~~
243
244 ctables.sps:16.40: error: CTABLES: Syntax error at `%': expecting `@:>@'.
245
246 ctables.sps:17.56: error: CTABLES: Syntax error at `x': expecting string.
247
248 ctables.sps:18.50-18.51: error: CTABLES: Syntax error at `**': expecting THRU.
249
250 ctables.sps:19.55: error: CTABLES: Syntax error at `x': expecting number.
251
252 ctables.sps:20.54-20.55: error: CTABLES: Syntax error at `**': expecting number.
253
254 ctables.sps:21.56-21.57: error: CTABLES: Syntax error at `**': expecting string.
255
256 ctables.sps:22.48-22.49: error: CTABLES: Syntax error at `**': expecting
257 identifier.
258
259 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
260    23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
261       |                                               ^~
262
263 ctables.sps:24.61-24.63: error: CTABLES: Syntax error at `101': Expected number
264 between 0 and 100 for PTILE.
265
266 ctables.sps:25.58: error: CTABLES: Syntax error at end of command: expecting
267 `@:}@'.
268
269 ctables.sps:26.54: error: CTABLES: Syntax error at end of command: expecting
270 `@{:@'.
271
272 ctables.sps:27.54-27.55: error: CTABLES: Syntax error at `**': expecting INCLUDE
273 or EXCLUDE.
274
275 ctables.sps:28.52-28.53: error: CTABLES: Syntax error at `**': expecting YES or
276 NO.
277
278 ctables.sps:29.52-29.53: error: CTABLES: Syntax error at `**': expecting string.
279
280 ctables.sps:30.55-30.56: error: CTABLES: Syntax error at `**': expecting BEFORE
281 or AFTER.
282
283 ctables.sps:31.52-31.53: error: CTABLES: Syntax error at `**': expecting INCLUDE
284 or EXCLUDE.
285
286 ctables.sps:32.46-32.47: error: CTABLES: Syntax error at `**': expecting ORDER,
287 KEY, MISSING, TOTAL, LABEL, POSITION, or EMPTY.
288
289 ctables.sps:33.54-33.55: error: CTABLES: Syntax error at `**': expecting TOTAL,
290 LABEL, POSITION, or EMPTY.
291
292 ctables.sps:34.36: error: CTABLES: Syntax error at `0': Expected positive
293 integer for SUBTOTAL.
294
295 ctables.sps:35.37-35.38: error: CTABLES: Syntax error at `**': expecting `@:>@'.
296
297 ctables.sps:36.31-36.32: error: CTABLES: Syntax error at `**': expecting THRU.
298
299 ctables.sps:37.36-37.37: error: CTABLES: Syntax error at `**': expecting number.
300
301 ctables.sps:38.35-38.36: error: CTABLES: Syntax error at `**': expecting number.
302
303 ctables.sps:39.29-39.30: error: CTABLES: Syntax error at `**': expecting `@:>@'.
304
305 ctables.sps:40.29: error: CTABLES: Syntax error at `x': expecting `@:}@'.
306
307 ctables.sps:41.19-41.20: error: CTABLES: Syntax error at `**': expecting &.
308
309 ctables.sps:42.20: error: CTABLES: Syntax error at `1': expecting identifier.
310
311 ctables.sps:43.21-43.22: error: CTABLES: Syntax error at `**': expecting `='.
312
313 ctables.sps:44.22-44.23: error: CTABLES: Syntax error at `**': expecting EXPR.
314
315 ctables.sps:45.26-45.27: error: CTABLES: Syntax error at `**': expecting `('.
316
317 ctables.sps:46.28: error: CTABLES: Syntax error at `x': expecting `)'.
318
319 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
320 the previous definition.
321    47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
322       |                               ^~~~~~~~~~~~~~~~~~~
323
324 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
325    47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
326       |          ^~~~~~~~~~~~~~~~~~~
327
328 ctables.sps:47.50: error: CTABLES: Syntax error at end of command: expecting
329 `/'.
330
331 ctables.sps:48.53-48.64: error: CTABLES: Syntax error at `NOTAFUNCTION':
332 Expecting summary function name.
333
334 ctables.sps:49.59-49.60: error: CTABLES: Syntax error at `**': Expected number
335 between 0 and 100 for PTILE.
336
337 ctables.sps:50.52-50.53: error: CTABLES: Syntax error at `**': expecting string.
338
339 ctables.sps:51.61-51.62: error: CTABLES: Syntax error at `**': expecting YES or
340 NO.
341
342 ctables.sps:52.46-52.47: error: CTABLES: Syntax error at `**': expecting LABEL,
343 FORMAT, or HIDESOURCECATS.
344
345 ctables.sps:53.23-53.24: error: CTABLES: Syntax error at `**': expecting string.
346
347 ctables.sps:54.25-54.26: error: CTABLES: Syntax error at `**': expecting string.
348
349 ctables.sps:55.17-55.18: error: CTABLES: Syntax error at `**': expecting
350 MINCOLWIDTH, MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
351
352 ctables.sps:56: error: CTABLES: MINCOLWIDTH must not be greater than
353 MAXCOLWIDTH.
354
355 ctables.sps:57.18-57.19: error: CTABLES: Syntax error at `**': expecting
356 VARIABLES.
357
358 ctables.sps:58: error: CTABLES: NOTAVAR is not a variable name.
359
360 ctables.sps:59.32-59.33: error: CTABLES: Syntax error at `**': expecting
361 DISPLAY.
362
363 ctables.sps:60.40-60.41: error: CTABLES: Syntax error at `**': expecting
364 DEFAULT, NAME, LABEL, BOTH, or NONE.
365
366 ctables.sps:61.17-61.18: error: CTABLES: Syntax error at `**': expecting
367 COUNTDUPLICATES.
368
369 ctables.sps:62.33-62.34: error: CTABLES: Syntax error at `**': expecting YES or
370 NO.
371
372 ctables.sps:63.19-63.20: error: CTABLES: Syntax error at `**': expecting
373 VARIABLE or LISTWISE.
374
375 ctables.sps:64.17-64.18: error: CTABLES: Syntax error at `**': expecting
376 VARIABLE.
377
378 ctables.sps:65: error: CTABLES: NOTAVAR is not a variable name.
379
380 ctables.sps:66.32: error: CTABLES: Syntax error at `1': Expected integer 2 or
381 greater for HIDESMALLCOUNTS COUNT.
382
383 ctables.sps:67.10-67.13: error: CTABLES: Syntax error at `QUUX': expecting
384 FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
385 HIDESMALLCOUNTS, or TABLE.
386
387 ctables.sps:68.33: error: CTABLES: Syntax error at end of command: expecting
388 `/'.
389
390 ctables.sps:69.19-69.20: error: CTABLES: Syntax error at `**': expecting `/'.
391
392 ctables.sps:70.38-70.39: error: CTABLES: Syntax error at `**': expecting COLUMN,
393 ROW, or LAYER.
394
395 ctables.sps:71.37-71.38: error: CTABLES: Syntax error at `**': expecting YES or
396 NO.
397
398 ctables.sps:72.29-72.30: error: CTABLES: Syntax error at `**': expecting
399 POSITION or VISIBLE.
400
401 ctables.sps:73.39-73.40: error: CTABLES: Syntax error at `**': expecting
402 OPPOSITE or LAYER.
403
404 ctables.sps:74.39-74.40: error: CTABLES: Syntax error at `**': expecting
405 OPPOSITE or LAYER.
406
407 ctables.sps:75.29-75.30: error: CTABLES: Syntax error at `**': expecting AUTO,
408 ROWLABELS, or COLLABELS.
409
410 ctables.sps:76.30-76.31: error: CTABLES: Syntax error at `**': expecting
411 CILEVEL.
412
413 ctables.sps:77.38-77.40: error: CTABLES: Syntax error at `101': Expected number
414 in @<:@0,100@:}@ for CILEVEL.
415
416 ctables.sps:78.28-78.29: error: CTABLES: Syntax error at `**': expecting
417 CAPTION, CORNER, or TITLE.
418
419 ctables.sps:79.34-79.35: error: CTABLES: Syntax error at `**': expecting
420 CHISQUARE.
421
422 ctables.sps:80.35-80.36: error: CTABLES: Syntax error at `**': Expected number
423 in @<:@0,1@:}@ for ALPHA.
424
425 ctables.sps:81.43-81.44: error: CTABLES: Syntax error at `**': expecting YES or
426 NO.
427
428 ctables.sps:82.40-82.41: error: CTABLES: Syntax error at `**': expecting
429 ALLVISIBLE or SUBTOTALS.
430
431 ctables.sps:83.29-83.30: error: CTABLES: Syntax error at `**': expecting TYPE,
432 ALPHA, INCLUDEMRSETS, or CATEGORIES.
433
434 ctables.sps:84.38-84.39: error: CTABLES: Syntax error at `**': expecting PROP or
435 MEAN.
436
437 ctables.sps:85.39-85.40: error: CTABLES: Syntax error at `**': Expected number
438 in (0,1) for ALPHA.
439
440 ctables.sps:86.39: error: CTABLES: Syntax error at `0': Expected number in (0,1)
441 for ALPHA.
442
443 ctables.sps:87.40-87.41: error: CTABLES: Syntax error at `**': expecting
444 BONFERRONI, BH, or NONE.
445
446 ctables.sps:88.47-88.48: error: CTABLES: Syntax error at `**': expecting YES or
447 NO.
448
449 ctables.sps:89.47-89.48: error: CTABLES: Syntax error at `**': expecting ALLCATS
450 or TESTEDCATS.
451
452 ctables.sps:90.44-90.45: error: CTABLES: Syntax error at `**': expecting
453 ALLVISIBLE or SUBTOTALS.
454
455 ctables.sps:91.39-91.40: error: CTABLES: Syntax error at `**': expecting YES or
456 NO.
457
458 ctables.sps:92.39-92.40: error: CTABLES: Syntax error at `**': expecting APA or
459 SIMPLE.
460
461 ctables.sps:93.41-93.42: error: CTABLES: Syntax error at `**': expecting YES or
462 NO.
463
464 ctables.sps:94.33-94.34: error: CTABLES: Syntax error at `**': expecting TYPE,
465 ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE, STYLE, or
466 SHOWSIG.
467
468 ctables.sps:95.22-95.23: error: CTABLES: Syntax error at `**': expecting TABLE,
469 SLABELS, CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
470
471 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
472 specified.
473
474 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
475    97 | CTABLES /TABLE qn20 > qnd1.
476       |                ^~~~~~~~~~~
477
478 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
479    97 | CTABLES /TABLE qn20 > qnd1.
480       |                ^~~~
481
482 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
483    97 | CTABLES /TABLE qn20 > qnd1.
484       |                       ^~~~
485
486 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
487 categorical variables at the innermost nesting level.
488    98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
489       |                ^~~~~~~~~~~~~~~~~~~~
490
491 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
492 summary.
493    98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
494       |                ^~~
495
496 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
497 specification as format DATETIME: Day (123) must be between 1 and 31..
498   100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
499       |                                                    ^~~~~
500 ]])
501 AT_CLEANUP
502
503 AT_SETUP([CTABLES parsing - more negative])
504 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
505 AT_DATA([ctables.sps],
506 [[GET 'nhtsa.sav'.
507 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
508 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
509 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
510
511 STRING string(A8).
512 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
513 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
514
515 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
516
517 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
518 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
519 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
520 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
521
522 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
523 CTABLES /PCOMPUTE &x=EXPR([**]).
524 CTABLES /PCOMPUTE &x=EXPR(**).
525
526 CTABLES /TABLE.
527
528 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT]. 
529
530 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 50).
531
532 CTABLES /TABLE $mrset.
533
534 CTABLES /TABLE qn113 /SIGTEST TYPE=CHISQUARE.
535 CTABLES /TABLE qn113 /COMPARETEST TYPE=PROP.
536
537 CTABLES /TABLE qn113 [COUNT.UCL].
538
539 CTABLES /TABLE qn1 /CATEGORIES **.
540 ]])
541 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
542 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a
543 category not included in the category list.
544     2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
545 VARIABLES=qn1 [&pc].
546       |
547 ^~~
548
549 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
550     2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
551 VARIABLES=qn1 [&pc].
552       |                            ^~~~~~~~
553
554 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the
555 list of categories here.
556     2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
557 VARIABLES=qn1 [&pc].
558       |
559 ^~~~
560
561 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a
562 category not included in the category list.
563     3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
564 [&pc].
565       |
566 ^~~
567
568 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
569     3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1
570 [&pc].
571       |                            ^~~~~
572
573 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the
574 variable's CATEGORIES specification.
575
576 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of
577 SUBTOTAL or HSUBTOTAL, so references from computed categories must refer to
578 subtotals by position, e.g. SUBTOTAL[1].
579     4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
580 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
581       |
582 ^~~~~~~~~~~~~~~~~~~~~~~~
583
584 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a
585 position.
586     4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES
587 VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
588       |                            ^~~~~~~~
589
590 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be
591 applied only to string variables, but this subcommand tries to apply it to
592 numeric variable QN1.
593     7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
594       |                                               ^~~~~~~~
595
596 ctables.sps:8.53: error: CTABLES: This category specification may be applied
597 only to numeric variables, but this subcommand tries to apply it to string
598 variable string.
599     8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
600       |                                                     ^
601
602 ctables.sps:10.74-10.86: error: CTABLES: Syntax error at `KEY=MEAN(qn1)': Data-
603 dependent sorting is not implemented.
604
605 ctables.sps:12: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
606 moved to be categorical, but qnd1 is a scale variable.
607
608 ctables.sps:13: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
609 moved to have the same width, but QN1 has width 0 and string has width 8.
610
611 ctables.sps:14: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
612 moved to have the same value labels, but QN1 and QNSA1 have different value
613 labels.
614
615 ctables.sps:15: error: CTABLES: ROWLABELS=OPPOSITE requires the variables to be
616 moved to have the same category specifications, but QN105BA and QN105BB have
617 different category specifications.
618
619 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is
620 left-associative: `a**b**c' equals `(a**b)**c', not `a**(b**c)'.  To disable
621 this warning, insert parentheses.
622    17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
623       |                           ^~~~~~~
624
625 ctables.sps:17.35: error: CTABLES: Syntax error at end of command: expecting
626 `/'.
627
628 ctables.sps:18.28-18.29: error: CTABLES: Syntax error at `**'.
629
630 ctables.sps:19.27-19.28: error: CTABLES: Syntax error at `**'.
631
632 ctables.sps:21.15: error: CTABLES: Syntax error at end of command: At least one
633 variable must be specified.
634
635 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
636
637 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a
638 summary.
639    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
640       |                                                  ^~~~~
641
642 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a
643 summary.
644    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
645       |                ^~~~~
646
647 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a
648 summary.
649    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
650       |                                 ^~~~~
651
652 ctables.sps:23.33-23.37: note: CTABLES: This is a scale variable, so it always
653 has a summary even if the syntax does not explicitly specify one.
654    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
655       |                                 ^~~~~
656
657 ctables.sps:25.46-25.63: error: CTABLES: Syntax error at `KEY=PTILE(qn1, 50)':
658 Data-dependent sorting is not implemented.
659
660 ctables.sps:27.16-27.21: error: CTABLES: Syntax error at `$mrset': Multiple
661 response set support not implemented.
662
663 ctables.sps:29.23-29.44: error: CTABLES: Syntax error at `SIGTEST
664 TYPE=CHISQUARE': Support for SIGTEST not yet implemented.
665
666 ctables.sps:30.35-30.43: error: CTABLES: Syntax error at `TYPE=PROP': Support
667 for COMPARETEST not yet implemented.
668
669 ctables.sps:32.23-32.31: error: CTABLES: Syntax error at `COUNT.UCL': Support
670 for LCL, UCL, and SE summary functions is not yet implemented.
671
672 ctables.sps:34.32-34.33: error: CTABLES: Syntax error at `**': expecting
673 VARIABLES.
674 ]])
675 AT_CLEANUP
676
677 AT_SETUP([CTABLES one categorical variable])
678 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
679 AT_DATA([ctables.sps],
680 [[GET 'nhtsa.sav'.
681 CTABLES /TABLE qn1.
682 CTABLES /TABLE BY qn1.
683 CTABLES /TABLE BY BY qn1.
684 ]])
685 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
686                                   Custom Tables
687 ╭────────────────────────────────────────────────────────────────────────┬─────╮
688 │                                                                        │Count│
689 ├────────────────────────────────────────────────────────────────────────┼─────┤
690 │ 1. How often do you usually drive a car or other  Every day            │ 4667│
691 │motor vehicle?                                     Several days a week  │ 1274│
692 │                                                   Once a week or less  │  361│
693 │                                                   Only certain times a │  130│
694 │                                                   year                 │     │
695 │                                                   Never                │  540│
696 ╰────────────────────────────────────────────────────────────────────────┴─────╯
697
698                                   Custom Tables
699 ╭──────────────────────────────────────────────────────────────────────────────╮
700 │        1. How often do you usually drive a car or other motor vehicle?       │
701 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
702 │         │  Several days a  │  Once a week or  │  Only certain times a  │     │
703 │Every day│       week       │       less       │          year          │Never│
704 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
705 │  Count  │       Count      │       Count      │          Count         │Count│
706 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
707 │     4667│              1274│               361│                     130│  540│
708 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
709
710 Custom Tables
711 Every day
712 ╭─────╮
713 │Count│
714 ├─────┤
715 │ 4667│
716 ╰─────╯
717 ])
718 AT_CLEANUP
719
720 AT_SETUP([CTABLES one string variable])
721 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
722 AT_DATA([ctables.sps],
723 [[GET 'nhtsa.sav'.
724 STRING licensed(A8).
725 MISSING VALUES licensed('DontKnow', 'Refused').
726 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
727 CTABLES /TABLE licensed.
728 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
729 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
730 * Notice that the string matching is case-sensitive.
731 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
732 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
733 CTABLES
734     /PCOMPUTE &notyes=EXPR(['No']+['DontKnow']+['Refused'])
735     /PPROPERTIES &notyes LABEL='Not Yes' HIDESOURCECATS=YES
736     /TABLE licensed
737     /CATEGORIES VARIABLES=licensed ['Yes', &notyes, 'No', 'DontKnow', 'Refused'].
738 CTABLES
739     /PCOMPUTE &notyes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
740     /PPROPERTIES &notyes LABEL='Not Yes' HIDESOURCECATS=YES
741     /TABLE licensed
742     /CATEGORIES VARIABLES=licensed ['Yes', &notyes, 'DontKnow' THRU 'No', 'Refused'].
743 ]])
744 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
745     Custom Tables
746 ╭────────────┬─────╮
747 │            │Count│
748 ├────────────┼─────┤
749 │licensed No │  572│
750 │         Yes│ 6379│
751 ╰────────────┴─────╯
752
753           Custom Tables
754 ╭─────────────────┬─────┬───────╮
755 │                 │Count│Valid N│
756 ├─────────────────┼─────┼───────┤
757 │licensed DontKnow│    4│       │
758 │         No      │  572│       │
759 │         Refused │   44│       │
760 │         Yes     │ 6379│       │
761 │         Total   │ 6999│   6951│
762 ╰─────────────────┴─────┴───────╯
763
764      Custom Tables
765 ╭──────────────┬─────╮
766 │              │Count│
767 ├──────────────┼─────┤
768 │licensed Yes  │ 6379│
769 │         No   │  572│
770 │         Total│ 6951│
771 ╰──────────────┴─────╯
772
773      Custom Tables
774 ╭──────────────┬─────╮
775 │              │Count│
776 ├──────────────┼─────┤
777 │licensed Yes  │ 6379│
778 │         no   │    0│
779 │         Total│ 6379│
780 ╰──────────────┴─────╯
781
782       Custom Tables
783 ╭────────────────┬─────╮
784 │                │Count│
785 ├────────────────┼─────┤
786 │licensed No     │  572│
787 │         Refused│   44│
788 │         Yes    │ 6379│
789 │         Total  │ 6995│
790 ╰────────────────┴─────╯
791
792       Custom Tables
793 ╭────────────────┬─────╮
794 │                │Count│
795 ├────────────────┼─────┤
796 │licensed Yes    │ 6379│
797 │         Not Yes│  620│
798 ╰────────────────┴─────╯
799
800       Custom Tables
801 ╭────────────────┬─────╮
802 │                │Count│
803 ├────────────────┼─────┤
804 │licensed Yes    │ 6379│
805 │         Not Yes│  620│
806 ╰────────────────┴─────╯
807 ])
808 AT_CLEANUP
809
810 AT_SETUP([CTABLES one scale variable])
811 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
812 AT_DATA([ctables.sps],
813 [[GET 'nhtsa.sav'.
814 DESCRIPTIVES qnd1.
815 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
816 CTABLES /TABLE BY qnd1.
817 CTABLES /TABLE BY BY qnd1.
818 ]])
819 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
820                        Descriptive Statistics
821 ╭──────────────────────────┬────┬─────┬───────┬───────┬───────────╮
822 │                          │  N │ Mean│Std Dev│Minimum│  Maximum  │
823 ├──────────────────────────┼────┼─────┼───────┼───────┼───────────┤
824 │D1. AGE: What is your age?│6930│48.26│  19.01│     16│86 or older│
825 │Valid N (listwise)        │6999│     │       │       │           │
826 │Missing N (listwise)      │  69│     │       │       │           │
827 ╰──────────────────────────┴────┴─────┴───────┴───────┴───────────╯
828
829                                   Custom Tables
830 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
831 │                      │     │       │       │    │     Std    │       │       │
832 │                      │Count│Valid N│Total N│Mean│  Deviation │Minimum│Maximum│
833 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
834 │D1. AGE: What is your │ 6999│   6930│   6999│  48│          19│     16│     86│
835 │age?                  │     │       │       │    │            │       │       │
836 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
837
838         Custom Tables
839 ╭──────────────────────────╮
840 │D1. AGE: What is your age?│
841 ├──────────────────────────┤
842 │           Mean           │
843 ├──────────────────────────┤
844 │                        48│
845 ╰──────────────────────────╯
846
847 Custom Tables
848 D1. AGE: What is your age?
849 ╭────╮
850 │Mean│
851 ├────┤
852 │  48│
853 ╰────╯
854 ])
855 AT_CLEANUP
856
857 AT_SETUP([CTABLES simple stacking])
858 AT_KEYWORDS([stack stacked])
859 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
860 AT_DATA([ctables.sps],
861 [[GET 'nhtsa.sav'.
862 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
863 ]])
864 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
865                                   Custom Tables
866 ╭───────────────────────────────────────────────────────────────┬──────────────╮
867 │                                                               │ S3a. GENDER: │
868 │                                                               ├──────┬───────┤
869 │                                                               │ Male │ Female│
870 │                                                               ├──────┼───────┤
871 │                                                               │Column│ Column│
872 │                                                               │   %  │   %   │
873 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
874 │105b. How likely is it that drivers who have had   Almost      │   10%│    11%│
875 │too much to drink to drive safely will A. Get      certain     │      │       │
876 │stopped by the police?                             Very likely │   21%│    22%│
877 │                                                   Somewhat    │   38%│    42%│
878 │                                                   likely      │      │       │
879 │                                                   Somewhat    │   21%│    18%│
880 │                                                   unlikely    │      │       │
881 │                                                   Very        │   10%│     8%│
882 │                                                   unlikely    │      │       │
883 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
884 │105b. How likely is it that drivers who have had   Almost      │   14%│    18%│
885 │too much to drink to drive safely will B. Have an  certain     │      │       │
886 │accident?                                          Very likely │   36%│    45%│
887 │                                                   Somewhat    │   39%│    32%│
888 │                                                   likely      │      │       │
889 │                                                   Somewhat    │    9%│     4%│
890 │                                                   unlikely    │      │       │
891 │                                                   Very        │    3%│     2%│
892 │                                                   unlikely    │      │       │
893 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
894 │105b. How likely is it that drivers who have had   Almost      │   18%│    16%│
895 │too much to drink to drive safely will C. Be       certain     │      │       │
896 │convicted for drunk driving?                       Very likely │   32%│    28%│
897 │                                                   Somewhat    │   27%│    32%│
898 │                                                   likely      │      │       │
899 │                                                   Somewhat    │   15%│    15%│
900 │                                                   unlikely    │      │       │
901 │                                                   Very        │    9%│     9%│
902 │                                                   unlikely    │      │       │
903 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
904 │105b. How likely is it that drivers who have had   Almost      │   16%│    16%│
905 │too much to drink to drive safely will D. Be       certain     │      │       │
906 │arrested for drunk driving?                        Very likely │   26%│    27%│
907 │                                                   Somewhat    │   32%│    35%│
908 │                                                   likely      │      │       │
909 │                                                   Somewhat    │   17%│    15%│
910 │                                                   unlikely    │      │       │
911 │                                                   Very        │    9%│     7%│
912 │                                                   unlikely    │      │       │
913 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
914 ])
915 AT_CLEANUP
916
917 AT_SETUP([CTABLES show or hide empty categories])
918 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
919 AT_DATA([ctables.sps],
920 [[GET 'nhtsa.sav'.
921 IF (qn105ba = 2) qn105ba = 1.
922 IF (qns3a = 1) qns3a = 2.
923 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
924 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
925     /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
926 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
927     /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
928 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
929     /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
930 ]])
931 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
932                                   Custom Tables
933 ╭──────────────────────────────────────────────────────────────┬───────────────╮
934 │                                                              │  S3a. GENDER: │
935 │                                                              ├───────┬───────┤
936 │                                                              │  Male │ Female│
937 │                                                              ├───────┼───────┤
938 │                                                              │ Column│ Column│
939 │                                                              │   %   │   %   │
940 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
941 │105b. How likely is it that drivers who have had   Almost     │      .│    32%│
942 │too much to drink to drive safely will A. Get      certain    │       │       │
943 │stopped by the police?                             Very likely│      .│     0%│
944 │                                                   Somewhat   │      .│    40%│
945 │                                                   likely     │       │       │
946 │                                                   Somewhat   │      .│    19%│
947 │                                                   unlikely   │       │       │
948 │                                                   Very       │      .│     9%│
949 │                                                   unlikely   │       │       │
950 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
951
952                                   Custom Tables
953 ╭──────────────────────────────────────────────────────────────┬───────────────╮
954 │                                                              │  S3a. GENDER: │
955 │                                                              ├───────┬───────┤
956 │                                                              │  Male │ Female│
957 │                                                              ├───────┼───────┤
958 │                                                              │ Column│ Column│
959 │                                                              │   %   │   %   │
960 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
961 │105b. How likely is it that drivers who have had   Almost     │      .│    32%│
962 │too much to drink to drive safely will A. Get      certain    │       │       │
963 │stopped by the police?                             Somewhat   │      .│    40%│
964 │                                                   likely     │       │       │
965 │                                                   Somewhat   │      .│    19%│
966 │                                                   unlikely   │       │       │
967 │                                                   Very       │      .│     9%│
968 │                                                   unlikely   │       │       │
969 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
970
971                                   Custom Tables
972 ╭────────────────────────────────────────────────────────────────────┬─────────╮
973 │                                                                    │   S3a.  │
974 │                                                                    │ GENDER: │
975 │                                                                    ├─────────┤
976 │                                                                    │  Female │
977 │                                                                    ├─────────┤
978 │                                                                    │ Column %│
979 ├────────────────────────────────────────────────────────────────────┼─────────┤
980 │105b. How likely is it that drivers who have had too    Almost      │      32%│
981 │much to drink to drive safely will A. Get stopped by    certain     │         │
982 │the police?                                             Very likely │       0%│
983 │                                                        Somewhat    │      40%│
984 │                                                        likely      │         │
985 │                                                        Somewhat    │      19%│
986 │                                                        unlikely    │         │
987 │                                                        Very        │       9%│
988 │                                                        unlikely    │         │
989 ╰────────────────────────────────────────────────────────────────────┴─────────╯
990
991                                   Custom Tables
992 ╭────────────────────────────────────────────────────────────────────┬─────────╮
993 │                                                                    │   S3a.  │
994 │                                                                    │ GENDER: │
995 │                                                                    ├─────────┤
996 │                                                                    │  Female │
997 │                                                                    ├─────────┤
998 │                                                                    │ Column %│
999 ├────────────────────────────────────────────────────────────────────┼─────────┤
1000 │105b. How likely is it that drivers who have had too    Almost      │      32%│
1001 │much to drink to drive safely will A. Get stopped by    certain     │         │
1002 │the police?                                             Somewhat    │      40%│
1003 │                                                        likely      │         │
1004 │                                                        Somewhat    │      19%│
1005 │                                                        unlikely    │         │
1006 │                                                        Very        │       9%│
1007 │                                                        unlikely    │         │
1008 ╰────────────────────────────────────────────────────────────────────┴─────────╯
1009 ])
1010 AT_CLEANUP
1011
1012 AT_SETUP([CTABLES sorting categories])
1013 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1014 AT_DATA([ctables.sps],
1015 [[GET 'nhtsa.sav'.
1016 IF (QND5A=6) QND5A=-1.
1017 IF (QND5A=5) QND5A=-2.
1018 CTABLES /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=A
1019         /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=D
1020         /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=A
1021         /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=D.
1022 ]])
1023 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1024                                   Custom Tables
1025 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1026 │                                                                        │Count│
1027 ├────────────────────────────────────────────────────────────────────────┼─────┤
1028 │D5a. What would you say is your primary ethnic  -2.00                   │   52│
1029 │background?                                     -1.00                   │   78│
1030 │                                                Cuban                   │   20│
1031 │                                                Mexican                 │  311│
1032 │                                                Spanish                 │   48│
1033 │                                                South American          │   34│
1034 │                                                Central American        │    0│
1035 │                                                Puerto Rican, OR        │    0│
1036 │                                                Something else          │   68│
1037 │                                                Multiple - cannot choose│    7│
1038 │                                                one                     │     │
1039 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1040
1041                                   Custom Tables
1042 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1043 │                                                                        │Count│
1044 ├────────────────────────────────────────────────────────────────────────┼─────┤
1045 │D5a. What would you say is your primary ethnic  Multiple - cannot choose│    7│
1046 │background?                                     one                     │     │
1047 │                                                Something else          │   68│
1048 │                                                Puerto Rican, OR        │    0│
1049 │                                                Central American        │    0│
1050 │                                                South American          │   34│
1051 │                                                Spanish                 │   48│
1052 │                                                Mexican                 │  311│
1053 │                                                Cuban                   │   20│
1054 │                                                -1.00                   │   78│
1055 │                                                -2.00                   │   52│
1056 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1057
1058                                   Custom Tables
1059 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1060 │                                                                        │Count│
1061 ├────────────────────────────────────────────────────────────────────────┼─────┤
1062 │D5a. What would you say is your primary ethnic  Central American        │    0│
1063 │background?                                     Cuban                   │   20│
1064 │                                                Mexican                 │  311│
1065 │                                                Multiple - cannot choose│    7│
1066 │                                                one                     │     │
1067 │                                                Puerto Rican, OR        │    0│
1068 │                                                Something else          │   68│
1069 │                                                South American          │   34│
1070 │                                                Spanish                 │   48│
1071 │                                                -2.00                   │   52│
1072 │                                                -1.00                   │   78│
1073 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1074
1075                                   Custom Tables
1076 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1077 │                                                                        │Count│
1078 ├────────────────────────────────────────────────────────────────────────┼─────┤
1079 │D5a. What would you say is your primary ethnic  Spanish                 │   48│
1080 │background?                                     South American          │   34│
1081 │                                                Something else          │   68│
1082 │                                                Puerto Rican, OR        │    0│
1083 │                                                Multiple - cannot choose│    7│
1084 │                                                one                     │     │
1085 │                                                Mexican                 │  311│
1086 │                                                Cuban                   │   20│
1087 │                                                Central American        │    0│
1088 │                                                -1.00                   │   78│
1089 │                                                -2.00                   │   52│
1090 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1091 ])
1092 AT_CLEANUP
1093
1094 AT_SETUP([CTABLES simple nesting])
1095 AT_KEYWORDS([nest nested])
1096 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1097 AT_DATA([ctables.sps],
1098 [[GET 'nhtsa.sav'.
1099 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1100   /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1101 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1102   /CATEGORIES VARIABLES=qns3a TOTAL=YES
1103   /CLABELS ROW=OPPOSITE.
1104 ]])
1105 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1106                                   Custom Tables
1107 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1108 │                                                                 │     │ Table│
1109 │                                                                 │Count│   %  │
1110 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1111 │105b. How likely is it that drivers    Almost     S3a.     Male  │  297│    4%│
1112 │who have had too much to drink to      certain    GENDER:  Female│  403│    6%│
1113 │drive safely will A. Get stopped by                        Total │  700│   10%│
1114 │the police?                           ╶──────────────────────────┼─────┼──────┤
1115 │                                       Very       S3a.     Male  │  660│   10%│
1116 │                                       likely     GENDER:  Female│  842│   12%│
1117 │                                                           Total │ 1502│   22%│
1118 │                                      ╶──────────────────────────┼─────┼──────┤
1119 │                                       Somewhat   S3a.     Male  │ 1174│   17%│
1120 │                                       likely     GENDER:  Female│ 1589│   23%│
1121 │                                                           Total │ 2763│   40%│
1122 │                                      ╶──────────────────────────┼─────┼──────┤
1123 │                                       Somewhat   S3a.     Male  │  640│    9%│
1124 │                                       unlikely   GENDER:  Female│  667│   10%│
1125 │                                                           Total │ 1307│   19%│
1126 │                                      ╶──────────────────────────┼─────┼──────┤
1127 │                                       Very       S3a.     Male  │  311│    5%│
1128 │                                       unlikely   GENDER:  Female│  298│    4%│
1129 │                                                           Total │  609│    9%│
1130 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1131 │105b. How likely is it that drivers    Almost     S3a.     Male  │  429│    6%│
1132 │who have had too much to drink to      certain    GENDER:  Female│  671│   10%│
1133 │drive safely will B. Have an accident?                     Total │ 1100│   16%│
1134 │                                      ╶──────────────────────────┼─────┼──────┤
1135 │                                       Very       S3a.     Male  │ 1104│   16%│
1136 │                                       likely     GENDER:  Female│ 1715│   25%│
1137 │                                                           Total │ 2819│   41%│
1138 │                                      ╶──────────────────────────┼─────┼──────┤
1139 │                                       Somewhat   S3a.     Male  │ 1203│   17%│
1140 │                                       likely     GENDER:  Female│ 1214│   18%│
1141 │                                                           Total │ 2417│   35%│
1142 │                                      ╶──────────────────────────┼─────┼──────┤
1143 │                                       Somewhat   S3a.     Male  │  262│    4%│
1144 │                                       unlikely   GENDER:  Female│  168│    2%│
1145 │                                                           Total │  430│    6%│
1146 │                                      ╶──────────────────────────┼─────┼──────┤
1147 │                                       Very       S3a.     Male  │   81│    1%│
1148 │                                       unlikely   GENDER:  Female│   59│    1%│
1149 │                                                           Total │  140│    2%│
1150 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1151 │105b. How likely is it that drivers    Almost     S3a.     Male  │  539│    8%│
1152 │who have had too much to drink to      certain    GENDER:  Female│  610│    9%│
1153 │drive safely will C. Be convicted for                      Total │ 1149│   17%│
1154 │drunk driving?                        ╶──────────────────────────┼─────┼──────┤
1155 │                                       Very       S3a.     Male  │  988│   14%│
1156 │                                       likely     GENDER:  Female│ 1049│   15%│
1157 │                                                           Total │ 2037│   30%│
1158 │                                      ╶──────────────────────────┼─────┼──────┤
1159 │                                       Somewhat   S3a.     Male  │  822│   12%│
1160 │                                       likely     GENDER:  Female│ 1210│   18%│
1161 │                                                           Total │ 2032│   30%│
1162 │                                      ╶──────────────────────────┼─────┼──────┤
1163 │                                       Somewhat   S3a.     Male  │  446│    7%│
1164 │                                       unlikely   GENDER:  Female│  548│    8%│
1165 │                                                           Total │  994│   15%│
1166 │                                      ╶──────────────────────────┼─────┼──────┤
1167 │                                       Very       S3a.     Male  │  268│    4%│
1168 │                                       unlikely   GENDER:  Female│  354│    5%│
1169 │                                                           Total │  622│    9%│
1170 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1171 │105b. How likely is it that drivers    Almost     S3a.     Male  │  498│    7%│
1172 │who have had too much to drink to      certain    GENDER:  Female│  603│    9%│
1173 │drive safely will D. Be arrested for                       Total │ 1101│   16%│
1174 │drunk driving?                        ╶──────────────────────────┼─────┼──────┤
1175 │                                       Very       S3a.     Male  │  805│   12%│
1176 │                                       likely     GENDER:  Female│ 1029│   15%│
1177 │                                                           Total │ 1834│   27%│
1178 │                                      ╶──────────────────────────┼─────┼──────┤
1179 │                                       Somewhat   S3a.     Male  │  975│   14%│
1180 │                                       likely     GENDER:  Female│ 1332│   19%│
1181 │                                                           Total │ 2307│   34%│
1182 │                                      ╶──────────────────────────┼─────┼──────┤
1183 │                                       Somewhat   S3a.     Male  │  535│    8%│
1184 │                                       unlikely   GENDER:  Female│  560│    8%│
1185 │                                                           Total │ 1095│   16%│
1186 │                                      ╶──────────────────────────┼─────┼──────┤
1187 │                                       Very       S3a.     Male  │  270│    4%│
1188 │                                       unlikely   GENDER:  Female│  279│    4%│
1189 │                                                           Total │  549│    8%│
1190 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1191
1192                                   Custom Tables
1193 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1194 │                                 │ Almost │ Very │ Somewhat│ Somewhat│  Very  │
1195 │                                 │ certain│likely│  likely │ unlikely│unlikely│
1196 │                                 ├────────┼──────┼─────────┼─────────┼────────┤
1197 │                                 │        │ Table│         │         │        │
1198 │                                 │ Table %│   %  │ Table % │ Table % │ Table %│
1199 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1200 │S3a.    Male   105b. How likely  │      4%│   10%│      17%│       9%│      5%│
1201 │GENDER:        is it that drivers│        │      │         │         │        │
1202 │               who have had too  │        │      │         │         │        │
1203 │               much to drink to  │        │      │         │         │        │
1204 │               drive safely will │        │      │         │         │        │
1205 │               A. Get stopped by │        │      │         │         │        │
1206 │               the police?       │        │      │         │         │        │
1207 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1208 │        Female 105b. How likely  │      6%│   12%│      23%│      10%│      4%│
1209 │               is it that drivers│        │      │         │         │        │
1210 │               who have had too  │        │      │         │         │        │
1211 │               much to drink to  │        │      │         │         │        │
1212 │               drive safely will │        │      │         │         │        │
1213 │               A. Get stopped by │        │      │         │         │        │
1214 │               the police?       │        │      │         │         │        │
1215 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1216 │        Total  105b. How likely  │     10%│   22%│      40%│      19%│      9%│
1217 │               is it that drivers│        │      │         │         │        │
1218 │               who have had too  │        │      │         │         │        │
1219 │               much to drink to  │        │      │         │         │        │
1220 │               drive safely will │        │      │         │         │        │
1221 │               A. Get stopped by │        │      │         │         │        │
1222 │               the police?       │        │      │         │         │        │
1223 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1224 │S3a.    Male   105b. How likely  │      6%│   16%│      17%│       4%│      1%│
1225 │GENDER:        is it that drivers│        │      │         │         │        │
1226 │               who have had too  │        │      │         │         │        │
1227 │               much to drink to  │        │      │         │         │        │
1228 │               drive safely will │        │      │         │         │        │
1229 │               B. Have an        │        │      │         │         │        │
1230 │               accident?         │        │      │         │         │        │
1231 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1232 │        Female 105b. How likely  │     10%│   25%│      18%│       2%│      1%│
1233 │               is it that drivers│        │      │         │         │        │
1234 │               who have had too  │        │      │         │         │        │
1235 │               much to drink to  │        │      │         │         │        │
1236 │               drive safely will │        │      │         │         │        │
1237 │               B. Have an        │        │      │         │         │        │
1238 │               accident?         │        │      │         │         │        │
1239 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1240 │        Total  105b. How likely  │     16%│   41%│      35%│       6%│      2%│
1241 │               is it that drivers│        │      │         │         │        │
1242 │               who have had too  │        │      │         │         │        │
1243 │               much to drink to  │        │      │         │         │        │
1244 │               drive safely will │        │      │         │         │        │
1245 │               B. Have an        │        │      │         │         │        │
1246 │               accident?         │        │      │         │         │        │
1247 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1248 │S3a.    Male   105b. How likely  │      8%│   14%│      12%│       7%│      4%│
1249 │GENDER:        is it that drivers│        │      │         │         │        │
1250 │               who have had too  │        │      │         │         │        │
1251 │               much to drink to  │        │      │         │         │        │
1252 │               drive safely will │        │      │         │         │        │
1253 │               C. Be convicted   │        │      │         │         │        │
1254 │               for drunk driving?│        │      │         │         │        │
1255 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1256 │        Female 105b. How likely  │      9%│   15%│      18%│       8%│      5%│
1257 │               is it that drivers│        │      │         │         │        │
1258 │               who have had too  │        │      │         │         │        │
1259 │               much to drink to  │        │      │         │         │        │
1260 │               drive safely will │        │      │         │         │        │
1261 │               C. Be convicted   │        │      │         │         │        │
1262 │               for drunk driving?│        │      │         │         │        │
1263 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1264 │        Total  105b. How likely  │     17%│   30%│      30%│      15%│      9%│
1265 │               is it that drivers│        │      │         │         │        │
1266 │               who have had too  │        │      │         │         │        │
1267 │               much to drink to  │        │      │         │         │        │
1268 │               drive safely will │        │      │         │         │        │
1269 │               C. Be convicted   │        │      │         │         │        │
1270 │               for drunk driving?│        │      │         │         │        │
1271 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1272 │S3a.    Male   105b. How likely  │      7%│   12%│      14%│       8%│      4%│
1273 │GENDER:        is it that drivers│        │      │         │         │        │
1274 │               who have had too  │        │      │         │         │        │
1275 │               much to drink to  │        │      │         │         │        │
1276 │               drive safely will │        │      │         │         │        │
1277 │               D. Be arrested for│        │      │         │         │        │
1278 │               drunk driving?    │        │      │         │         │        │
1279 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1280 │        Female 105b. How likely  │      9%│   15%│      19%│       8%│      4%│
1281 │               is it that drivers│        │      │         │         │        │
1282 │               who have had too  │        │      │         │         │        │
1283 │               much to drink to  │        │      │         │         │        │
1284 │               drive safely will │        │      │         │         │        │
1285 │               D. Be arrested for│        │      │         │         │        │
1286 │               drunk driving?    │        │      │         │         │        │
1287 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1288 │        Total  105b. How likely  │     16%│   27%│      34%│      16%│      8%│
1289 │               is it that drivers│        │      │         │         │        │
1290 │               who have had too  │        │      │         │         │        │
1291 │               much to drink to  │        │      │         │         │        │
1292 │               drive safely will │        │      │         │         │        │
1293 │               D. Be arrested for│        │      │         │         │        │
1294 │               drunk driving?    │        │      │         │         │        │
1295 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1296 ])
1297 AT_CLEANUP
1298
1299 AT_SETUP([CTABLES nesting and scale variables])
1300 AT_KEYWORDS([nest nested])
1301 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1302 AT_DATA([ctables.sps],
1303 [[GET 'nhtsa.sav'.
1304 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1305 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1306 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1307   /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1308 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1309 ]])
1310 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1311                                   Custom Tables
1312 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1313 │                                                                 │S3a. GENDER:│
1314 │                                                                 ├─────┬──────┤
1315 │                                                                 │ Male│Female│
1316 │                                                                 ├─────┼──────┤
1317 │                                                                 │ Mean│ Mean │
1318 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1319 │D1. AGE: What   1. How often do you usually drive Every day      │   46│    46│
1320 │is your age?   a car or other motor vehicle?      Several days a │   51│    59│
1321 │                                                  week           │     │      │
1322 │                                                  Once a week or │   44│    54│
1323 │                                                  less           │     │      │
1324 │                                                  Only certain   │   34│    41│
1325 │                                                  times a year   │     │      │
1326 │                                                  Never          │   39│    55│
1327 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1328
1329                                   Custom Tables
1330 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1331 │                                                         │Minimum│Maximum│Mean│
1332 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1333 │D1. AGE: S3a.     Male   26. During the last 12       Yes│     16│     86│  42│
1334 │What is  GENDER:         months, has there been a        │       │       │    │
1335 │your                     time when you felt you          │       │       │    │
1336 │age?                     should cut down on your      No │     16│     86│  46│
1337 │                         drinking?                       │       │       │    │
1338 │                 ╶───────────────────────────────────────┼───────┼───────┼────┤
1339 │                  Female 26. During the last 12       Yes│     16│     86│  43│
1340 │                         months, has there been a        │       │       │    │
1341 │                         time when you felt you          │       │       │    │
1342 │                         should cut down on your      No │     16│     86│  48│
1343 │                         drinking?                       │       │       │    │
1344 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1345 │D1. AGE: S3a.     Male   27. During the last 12       Yes│     16│     86│  38│
1346 │What is  GENDER:         months, has there been a        │       │       │    │
1347 │your                     time when people criticized  No │     16│     86│  46│
1348 │age?                     your drinking?                  │       │       │    │
1349 │                 ╶───────────────────────────────────────┼───────┼───────┼────┤
1350 │                  Female 27. During the last 12       Yes│     17│     69│  37│
1351 │                         months, has there been a        │       │       │    │
1352 │                         time when people criticized  No │     16│     86│  48│
1353 │                         your drinking?                  │       │       │    │
1354 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1355
1356                                   Custom Tables
1357 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1358 │                             │S1. Including yourself, how many members of this│
1359 │                             │         household are age 16 or older?         │
1360 │                             ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1361 │                             │      │      │      │      │      │      │ 6 or │
1362 │                             │ None │   1  │   2  │   3  │   4  │   5  │ more │
1363 │                             ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1364 │                             │Column│Column│Column│Column│Column│Column│Column│
1365 │                             │   %  │   %  │   %  │   %  │   %  │   %  │   %  │
1366 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1367 │Sa1.    RDD 105b.    Almost  │     .│  9.5%│  8.2%│ 12.4%│  9.9%│ 20.0%│ 23.8%│
1368 │SAMPLE      How      certain │      │      │      │      │      │      │      │
1369 │SOURCE:     likely           │      │      │      │      │      │      │      │
1370 │            is it    Very    │     .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1371 │            that     likely  │      │      │      │      │      │      │      │
1372 │            drivers          │      │      │      │      │      │      │      │
1373 │            who have         │      │      │      │      │      │      │      │
1374 │            had too  Somewhat│     .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1375 │            much to  likely  │      │      │      │      │      │      │      │
1376 │            drink to         │      │      │      │      │      │      │      │
1377 │            drive            │      │      │      │      │      │      │      │
1378 │            safely   Somewhat│     .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│  9.5%│
1379 │            will A.  unlikely│      │      │      │      │      │      │      │
1380 │            Get              │      │      │      │      │      │      │      │
1381 │            stopped  Very    │     .│  9.2%│  9.7%│  8.2%│  9.4%│  7.3%│  9.5%│
1382 │            by the   unlikely│      │      │      │      │      │      │      │
1383 │            police?          │      │      │      │      │      │      │      │
1384 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1385
1386                                   Custom Tables
1387 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1388 │                                                              │    │    Std   │
1389 │                                                              │Mean│ Deviation│
1390 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1391 │Age    16 to 25 20. On how many of the thirty days in this    │ 5.2│       6.0│
1392 │group           typical month did you have one or more        │    │          │
1393 │                alcoholic beverages to drink?                 │    │          │
1394 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1395 │       26 to 35 20. On how many of the thirty days in this    │ 4.7│       5.9│
1396 │                typical month did you have one or more        │    │          │
1397 │                alcoholic beverages to drink?                 │    │          │
1398 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1399 │       36 to 45 20. On how many of the thirty days in this    │ 5.5│       6.8│
1400 │                typical month did you have one or more        │    │          │
1401 │                alcoholic beverages to drink?                 │    │          │
1402 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1403 │       46 to 55 20. On how many of the thirty days in this    │ 5.8│       7.7│
1404 │                typical month did you have one or more        │    │          │
1405 │                alcoholic beverages to drink?                 │    │          │
1406 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1407 │       56 to 65 20. On how many of the thirty days in this    │ 6.3│       8.2│
1408 │                typical month did you have one or more        │    │          │
1409 │                alcoholic beverages to drink?                 │    │          │
1410 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1411 │       66 or    20. On how many of the thirty days in this    │ 7.1│       9.2│
1412 │       older    typical month did you have one or more        │    │          │
1413 │                alcoholic beverages to drink?                 │    │          │
1414 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1415 ])
1416 AT_CLEANUP
1417
1418
1419 AT_SETUP([CTABLES SLABELS])
1420 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1421 AT_DATA([ctables.sps],
1422 [[GET 'nhtsa.sav'.
1423 CTABLES /TABLE qn1 [COUNT COLPCT].
1424 CTABLES /TABLE qn1 [COUNT COLPCT]
1425     /SLABELS POSITION=ROW.
1426 CTABLES /TABLE qn1 [COUNT COLPCT]
1427     /SLABELS POSITION=ROW VISIBLE=NO.
1428 ]])
1429 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1430                                   Custom Tables
1431 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1432 │                                                                │     │ Column│
1433 │                                                                │Count│   %   │
1434 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1435 │ 1. How often do you usually drive a car or  Every day          │ 4667│  66.9%│
1436 │other motor vehicle?                         Several days a week│ 1274│  18.3%│
1437 │                                             Once a week or less│  361│   5.2%│
1438 │                                             Only certain times │  130│   1.9%│
1439 │                                             a year             │     │       │
1440 │                                             Never              │  540│   7.7%│
1441 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1442
1443                                   Custom Tables
1444 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1445 │ 1. How often do you usually drive a car or  Every day           Count  │ 4667│
1446 │other motor vehicle?                                             Column │66.9%│
1447 │                                                                 %      │     │
1448 │                                            ╶───────────────────────────┼─────┤
1449 │                                             Several days a week Count  │ 1274│
1450 │                                                                 Column │18.3%│
1451 │                                                                 %      │     │
1452 │                                            ╶───────────────────────────┼─────┤
1453 │                                             Once a week or less Count  │  361│
1454 │                                                                 Column │ 5.2%│
1455 │                                                                 %      │     │
1456 │                                            ╶───────────────────────────┼─────┤
1457 │                                             Only certain times  Count  │  130│
1458 │                                             a year              Column │ 1.9%│
1459 │                                                                 %      │     │
1460 │                                            ╶───────────────────────────┼─────┤
1461 │                                             Never               Count  │  540│
1462 │                                                                 Column │ 7.7%│
1463 │                                                                 %      │     │
1464 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1465
1466                                   Custom Tables
1467 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1468 │ 1. How often do you usually drive a car or other  Every day            │ 4667│
1469 │motor vehicle?                                                          │66.9%│
1470 │                                                   Several days a week  │ 1274│
1471 │                                                                        │18.3%│
1472 │                                                   Once a week or less  │  361│
1473 │                                                                        │ 5.2%│
1474 │                                                   Only certain times a │  130│
1475 │                                                   year                 │ 1.9%│
1476 │                                                   Never                │  540│
1477 │                                                                        │ 7.7%│
1478 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1479 ])
1480 AT_CLEANUP
1481
1482 AT_SETUP([CTABLES simple totals])
1483 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1484 AT_DATA([ctables.sps],
1485 [[GET 'nhtsa.sav'.
1486 CTABLES /TABLE=qn17
1487     /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1488 DESCRIPTIVES qn18/STATISTICS=MEAN.
1489 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1490     /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1491 ]])
1492 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1493                                   Custom Tables
1494 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1495 │                                                                        │Count│
1496 ├────────────────────────────────────────────────────────────────────────┼─────┤
1497 │17. When you drink alcoholic beverages, which ONE of  OR, something else│    2│
1498 │the following beverages do you drink MOST OFTEN?      Beer              │ 1073│
1499 │                                                      Light beer        │  620│
1500 │                                                      Wine              │ 1418│
1501 │                                                      Wine coolers      │  137│
1502 │                                                      Hard liquor or    │  888│
1503 │                                                      mixed drinks      │     │
1504 │                                                      Flavored malt     │   83│
1505 │                                                      drinks            │     │
1506 │                                                      Number responding │ 4221│
1507 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1508
1509                              Descriptive Statistics
1510 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1511 │                                                                    │  N │Mean│
1512 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1513 │18. When you drink ANSWERFROM(QN17R1), about how many               │4218│4.62│
1514 │ANSWERFROM(QN17R2) do you usually drink per sitting?                │    │    │
1515 │Valid N (listwise)                                                  │6999│    │
1516 │Missing N (listwise)                                                │2781│    │
1517 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1518
1519                                   Custom Tables
1520 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1521 │                                                      │    │     │ Valid│Total│
1522 │                                                      │Mean│Count│   N  │  N  │
1523 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1524 │Region NE       18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│   949│ 1409│
1525 │                about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1526 │                you usually drink per sitting?        │    │     │      │     │
1527 │      ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1528 │       MW       18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│  1027│ 1654│
1529 │                about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1530 │                you usually drink per sitting?        │    │     │      │     │
1531 │      ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1532 │       S        18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│  1287│ 2390│
1533 │                about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1534 │                you usually drink per sitting?        │    │     │      │     │
1535 │      ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1536 │       W        18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│   955│ 1546│
1537 │                about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1538 │                you usually drink per sitting?        │    │     │      │     │
1539 │      ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1540 │       All      18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│  4218│ 6999│
1541 │       regions  about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1542 │                you usually drink per sitting?        │    │     │      │     │
1543 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1544 ])
1545 AT_CLEANUP
1546
1547 AT_SETUP([CTABLES subtotals])
1548 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1549 AT_DATA([ctables.sps],
1550 [[GET 'nhtsa.sav'.
1551 CTABLES /TABLE=qn105ba BY qns1
1552     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1553 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1554     /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1555 CTABLES /TABLE=qn105ba BY qns1
1556     /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1557     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1558 ]])
1559 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1560                                                       Custom Tables
1561 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1562 │                                                         │ S1. Including yourself, how many members of this household │
1563 │                                                         │                    are age 16 or older?                    │
1564 │                                                         ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1565 │                                                         │   1   │   2   │ Subtotal│   3   │    4   │   5  │ Subtotal │
1566 │                                                         ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1567 │                                                         │ Count │ Count │  Count  │ Count │  Count │ Count│   Count  │
1568 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1569 │105b. How likely is it that drivers who have  Almost     │    147│    246│      393│     62│      19│    11│        92│
1570 │had too much to drink to drive safely will A. certain    │       │       │         │       │        │      │          │
1571 │Get stopped by the police?                    Very likely│    384│    552│      936│    120│      51│    14│       185│
1572 │                                              Somewhat   │    590│   1249│     1839│    193│      72│    20│       285│
1573 │                                              likely     │       │       │         │       │        │      │          │
1574 │                                              Somewhat   │    278│    647│      925│     84│      32│     6│       122│
1575 │                                              unlikely   │       │       │         │       │        │      │          │
1576 │                                              Very       │    141│    290│      431│     41│      18│     4│        63│
1577 │                                              unlikely   │       │       │         │       │        │      │          │
1578 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1579
1580                                                       Custom Tables
1581 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1582 │                                                        │  S1. Including yourself, how many members of this household │
1583 │                                                        │                     are age 16 or older?                    │
1584 │                                                        ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1585 │                                                        │        │        │        │        │       │        │  6 or  │
1586 │                                                        │  None  │    1   │    2   │    3   │   4   │    5   │  more  │
1587 │                                                        ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1588 │                                                        │        │        │        │        │ Column│        │        │
1589 │                                                        │Column %│Column %│Column %│Column %│   %   │Column %│Column %│
1590 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1591 │105b. How likely is it that drivers who have Almost     │       .│    9.5%│    8.2%│   12.4%│   9.9%│   20.0%│   23.8%│
1592 │had too much to drink to drive safely will   certain    │        │        │        │        │       │        │        │
1593 │A. Get stopped by the police?                Very likely│       .│   24.9%│   18.5%│   24.0%│  26.6%│   25.5%│   33.3%│
1594 │                                             Somewhat   │       .│   38.3%│   41.9%│   38.6%│  37.5%│   36.4%│   23.8%│
1595 │                                             likely     │        │        │        │        │       │        │        │
1596 │                                             Subtotal   │        │   72.8%│   68.6%│   75.0%│  74.0%│   81.8%│   81.0%│
1597 │                                             Somewhat   │       .│   18.1%│   21.7%│   16.8%│  16.7%│   10.9%│    9.5%│
1598 │                                             unlikely   │        │        │        │        │       │        │        │
1599 │                                             Very       │       .│    9.2%│    9.7%│    8.2%│   9.4%│    7.3%│    9.5%│
1600 │                                             unlikely   │        │        │        │        │       │        │        │
1601 │                                             Subtotal   │        │   27.2%│   31.4%│   25.0%│  26.0%│   18.2%│   19.0%│
1602 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1603
1604                                                       Custom Tables
1605 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1606 │                                                         │ S1. Including yourself, how many members of this household │
1607 │                                                         │                    are age 16 or older?                    │
1608 │                                                         ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1609 │                                                         │   1   │   2   │ Subtotal│   3   │    4   │   5  │ Subtotal │
1610 │                                                         ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1611 │                                                         │ Count │ Count │  Count  │ Count │  Count │ Count│   Count  │
1612 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1613 │105b. How likely is it that drivers who have  Almost     │    147│    246│      393│     62│      19│    11│        92│
1614 │had too much to drink to drive safely will A. certain    │       │       │         │       │        │      │          │
1615 │Get stopped by the police?                    Very likely│    384│    552│      936│    120│      51│    14│       185│
1616 │                                              Somewhat   │    590│   1249│     1839│    193│      72│    20│       285│
1617 │                                              likely     │       │       │         │       │        │      │          │
1618 │                                              Subtotal   │   1121│   2047│     3168│    375│     142│    45│       562│
1619 │                                              Somewhat   │    278│    647│      925│     84│      32│     6│       122│
1620 │                                              unlikely   │       │       │         │       │        │      │          │
1621 │                                              Very       │    141│    290│      431│     41│      18│     4│        63│
1622 │                                              unlikely   │       │       │         │       │        │      │          │
1623 │                                              Subtotal   │    419│    937│     1356│    125│      50│    10│       185│
1624 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1625 ])
1626 AT_CLEANUP
1627
1628 AT_SETUP([CTABLES PCOMPUTE])
1629 AT_KEYWORDS([postcompute])
1630 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1631 AT_DATA([ctables.sps],
1632 [[GET 'nhtsa.sav'.
1633 CTABLES
1634     /PCOMPUTE &x=EXPR([3] + [4])
1635     /PCOMPUTE &y=EXPR([4] + [5])
1636     /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1637     /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]'
1638     /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1639     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1640
1641 * Adding HIDESOURCECATS=YES for one PPROPERTIES.
1642 CTABLES
1643     /PCOMPUTE &x=EXPR([3] + [4])
1644     /PCOMPUTE &y=EXPR([4] + [5])
1645     /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1646     /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]' HIDESOURCECATS=YES
1647     /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1648     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1649 ]])
1650 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1651                                                                 Custom Tables
1652 ╭───────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1653 │                   │                    S1. Including yourself, how many members of this household are age 16 or older?                   │
1654 │                   ├───────────┬───────────┬───────────┬───────────┬──────────┬──────────┬────────────┬──────────┬───────────┬────────────┤
1655 │                   │     1     │     2     │  Subtotal │     3     │     4    │     5    │     3+4    │    4+5   │  Subtotal │    Total   │
1656 │                   ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼─────┬────┼─────┬────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1657 │                   │     │     │     │     │     │     │     │     │     │ Row│     │ Row│      │     │     │ Row│     │     │     │      │
1658 │                   │Count│Row %│Count│Row %│Count│Row %│Count│Row %│Count│  % │Count│  % │ Count│Row %│Count│  % │Count│Row %│Count│ Row %│
1659 ├───────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼────┼─────┼────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1660 │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%│
1661 │likely is  certain │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1662 │it that            │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1663 │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%│
1664 │who have   likely  │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1665 │had too            │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1666 │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%│
1667 │drink to   likely  │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1668 │drive              │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1669 │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%│
1670 │will A.    unlikely│     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1671 │Get                │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1672 │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%│
1673 │the        unlikely│     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1674 │police?            │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1675 ╰───────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴────┴─────┴────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1676
1677                                                                 Custom Tables
1678 ╭─────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────╮
1679 │                                         │         S1. Including yourself, how many members of this household are age 16 or older?        │
1680 │                                         ├───────────┬───────────┬───────────┬───────────┬────────────┬──────────┬───────────┬────────────┤
1681 │                                         │     1     │     2     │  Subtotal │     3     │     3+4    │    4+5   │  Subtotal │    Total   │
1682 │                                         ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1683 │                                         │     │     │     │     │     │     │     │     │      │     │     │ Row│     │     │     │      │
1684 │                                         │Count│Row %│Count│Row %│Count│Row %│Count│Row %│ Count│Row %│Count│  % │Count│Row %│Count│ Row %│
1685 ├─────────────────────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1686 │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%│
1687 │drivers who have had too much  certain   │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1688 │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%│
1689 │A. Get stopped by the police?  likely    │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1690 │                               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%│
1691 │                               likely    │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1692 │                               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%│
1693 │                               unlikely  │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1694 │                               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%│
1695 │                               unlikely  │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1696 ╰─────────────────────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1697 ])
1698 AT_CLEANUP
1699
1700 AT_SETUP([CTABLES PCOMPUTE - OTHERNM and MISSING])
1701 AT_KEYWORDS([postcompute])
1702 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1703 AT_DATA([ctables.sps],
1704 [[GET 'nhtsa.sav'.
1705 CTABLES
1706     /PCOMPUTE &x=EXPR(OTHERNM)
1707     /PCOMPUTE &y=EXPR(MISSING)
1708     /PPROPERTIES &x LABEL='Drivers'
1709     /PPROPERTIES &y LABEL='Missing Values 2'
1710     /TABLE=qn1 BY qns3a
1711     /CATEGORIES VARIABLES=qn1 [OTHERNM, 5, &x, SUBTOTAL='Valid Values', MISSING, SUBTOTAL='Missing Values', &y]
1712 ]])
1713 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1714                                               Custom Tables
1715 ╭──────────────────────────────────────────────────────────────────────────────────────────┬────────────╮
1716 │                                                                                          │S3a. GENDER:│
1717 │                                                                                          ├─────┬──────┤
1718 │                                                                                          │ Male│Female│
1719 │                                                                                          ├─────┼──────┤
1720 │                                                                                          │Count│ Count│
1721 ├──────────────────────────────────────────────────────────────────────────────────────────┼─────┼──────┤
1722 │ 1. How often do you usually drive a car or other motor vehicle? Every day                │ 2305│  2362│
1723 │                                                                 Several days a week      │  440│   834│
1724 │                                                                 Once a week or less      │  125│   236│
1725 │                                                                 Only certain times a year│   58│    72│
1726 │                                                                 Never                    │  192│   348│
1727 │                                                                 Drivers                  │ 2928│  3504│
1728 │                                                                 Valid Values             │ 3120│  3852│
1729 │                                                                 Don't know               │    3│     5│
1730 │                                                                 Refused                  │    9│    10│
1731 │                                                                 Missing Values           │   12│    15│
1732 │                                                                 Missing Values 2         │   12│    15│
1733 ╰──────────────────────────────────────────────────────────────────────────────────────────┴─────┴──────╯
1734 ])
1735 AT_CLEANUP
1736
1737 AT_SETUP([CTABLES PCOMPUTE - THRU])
1738 AT_KEYWORDS([postcompute])
1739 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1740 AT_DATA([ctables.sps],
1741 [[GET 'nhtsa.sav'.
1742 CTABLES
1743     /PCOMPUTE &x=EXPR([1 THRU 2])
1744     /PCOMPUTE &y=EXPR([3 THRU 4])
1745     /PCOMPUTE &z=EXPR([5] + MISSING)
1746     /PPROPERTIES &x LABEL='Frequent Drivers'
1747     /PPROPERTIES &y LABEL='Infrequent Drivers'
1748     /PPROPERTIES &z LABEL='Not Drivers or Missing'
1749     /TABLE=qn1 BY qns3a
1750     /CATEGORIES VARIABLES=qn1 [1 THRU 2, &x, 3 THRU 4, &y, SUBTOTAL='Drivers', 5, MISSING, &z]
1751 ]])
1752 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1753                                               Custom Tables
1754 ╭──────────────────────────────────────────────────────────────────────────────────────────┬────────────╮
1755 │                                                                                          │S3a. GENDER:│
1756 │                                                                                          ├─────┬──────┤
1757 │                                                                                          │ Male│Female│
1758 │                                                                                          ├─────┼──────┤
1759 │                                                                                          │Count│ Count│
1760 ├──────────────────────────────────────────────────────────────────────────────────────────┼─────┼──────┤
1761 │ 1. How often do you usually drive a car or other motor vehicle? Every day                │ 2305│  2362│
1762 │                                                                 Several days a week      │  440│   834│
1763 │                                                                 Frequent Drivers         │ 2745│  3196│
1764 │                                                                 Once a week or less      │  125│   236│
1765 │                                                                 Only certain times a year│   58│    72│
1766 │                                                                 Infrequent Drivers       │  183│   308│
1767 │                                                                 Drivers                  │ 2928│  3504│
1768 │                                                                 Never                    │  192│   348│
1769 │                                                                 Don't know               │    3│     5│
1770 │                                                                 Refused                  │    9│    10│
1771 │                                                                 Not Drivers or Missing   │  204│   363│
1772 ╰──────────────────────────────────────────────────────────────────────────────────────────┴─────┴──────╯
1773 ])
1774 AT_CLEANUP
1775
1776 dnl I'm not sure that this is the correct behavior (see
1777 dnl https://mail.gnu.org/archive/html/pspp-users/2022-07/msg00002.html)
1778 dnl but at least this test will notify us if the behavior changes.
1779 AT_SETUP([CTABLES intersecting PCOMPUTEs])
1780 AT_KEYWORDS([PCOMPUTE postcompute])
1781 AT_DATA([ctables.sps],
1782 [[DATA LIST LIST NOTABLE/x y z.
1783 WEIGHT by z.
1784 FORMATS ALL (F1.0).
1785 VARIABLE LEVEL x y (NOMINAL).
1786 BEGIN DATA.
1787 1 4 5
1788 1 5 2
1789 1 6 9
1790 2 4 2
1791 2 5 3
1792 2 6 4
1793 3 4 1
1794 3 5 6
1795 3 6 1
1796 END DATA.
1797
1798 CTABLES
1799     /PCOMPUTE &a = EXPR([1] + [2])
1800     /PCOMPUTE &b = EXPR([2] + [3])
1801     /PCOMPUTE &c = EXPR([4] * [5])
1802     /PCOMPUTE &d = EXPR([5] * [6])
1803     /TABLE x BY y
1804     /CATEGORIES VARIABLES=x [1, &a, 2, &b, 3]
1805     /CATEGORIES VARIABLES=y [4, &c, 5, &d, 6].
1806 ]])
1807 AT_CHECK([pspp ctables.sps -O box=unicode], [0],
1808 [[                   Custom Tables
1809 ╭───────────┬─────────────────────────────────────╮
1810 │           │                  y                  │
1811 │           ├─────┬─────────┬─────┬─────────┬─────┤
1812 │           │  4  │[4] * [5]│  5  │[5] * [6]│  6  │
1813 │           ├─────┼─────────┼─────┼─────────┼─────┤
1814 │           │Count│  Count  │Count│  Count  │Count│
1815 ├───────────┼─────┼─────────┼─────┼─────────┼─────┤
1816 │x 1        │    5│       10│    2│       18│    9│
1817 │  [1] + [2]│    7│        .│    5│        .│   13│
1818 │  2        │    2│        6│    3│       12│    4│
1819 │  [2] + [3]│    3│        .│    9│        .│    5│
1820 │  3        │    1│        6│    6│        6│    1│
1821 ╰───────────┴─────┴─────────┴─────┴─────────┴─────╯
1822 ]])
1823 AT_CLEANUP
1824
1825 AT_SETUP([CTABLES string and date and time])
1826
1827 weight=1
1828 for gender in F M; do
1829     for month in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do
1830         for wkday in Sun Mon Tue Wed Thu Fri Sat Sun; do
1831             printf "$weight $gender $month $wkday\n"
1832             weight=$(expr \( $weight + 3 \) % 7 + 2)
1833         done
1834     done
1835 done > ctables.txt
1836
1837 AT_DATA([ctables.sps],
1838 [[DATA LIST LIST NOTABLE FILE='ctables.txt'
1839     /w (F5.0) gender (A1) fmon (MONTH3) fday (WKDAY3).
1840 WEIGHT by w.
1841 VARIABLE LEVEL w (SCALE).
1842 VARIABLE LEVEL gender fmon fday (NOMINAL).
1843 VARIABLE LABEL
1844   gender 'Gender'
1845   fmon 'Favorite month'
1846   fday 'Favorite day of the week'.
1847 VALUE LABELS /gender 'M' 'Male' 'F' 'Female'.
1848 CTABLES
1849     /PCOMPUTE &q2 = EXPR(['APR' THRU 'June'])
1850     /PPROPERTIES &q2 LABEL='Q2'
1851     /PCOMPUTE &weekend = EXPR(['sun'] + ['Sat'])
1852     /PPROPERTIES &weekend LABEL='Weekend'
1853     /TABLE fmon BY gender > fday
1854     /CATEGORIES VARIABLES=fmon ['JAN', 'FEB', 'Mar', SUBTOTAL="Q1",
1855                                 4 THRU 6, &q2,
1856                                 'JUL' THRU 'sep', SUBTOTAL="Q3",
1857                                 OTHERNM, SUBTOTAL='Q4']
1858     /CATEGORIES VARIABLES=gender ['M', 'F']
1859     /CATEGORIES VARIABLE=fday ['Sun', 2 THRU 6, 'Sat', &weekend] TOTAL=YES
1860     /SLABELS VISIBLE=NO.
1861 ]])
1862 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1863                                               Custom Tables
1864 ╭──────────────────┬───────────────────────────────────────────────────────────────────────────────────╮
1865 │                  │                                       Gender                                      │
1866 │                  ├─────────────────────────────────────────┬─────────────────────────────────────────┤
1867 │                  │                   Male                  │                  Female                 │
1868 │                  ├─────────────────────────────────────────┼─────────────────────────────────────────┤
1869 │                  │         Favorite day of the week        │         Favorite day of the week        │
1870 │                  ├───┬───┬───┬───┬───┬───┬───┬───────┬─────┼───┬───┬───┬───┬───┬───┬───┬───────┬─────┤
1871 │                  │SUN│MON│TUE│WED│THU│FRI│SAT│Weekend│Total│SUN│MON│TUE│WED│THU│FRI│SAT│Weekend│Total│
1872 ├──────────────────┼───┼───┼───┼───┼───┼───┼───┼───────┼─────┼───┼───┼───┼───┼───┼───┼───┼───────┼─────┤
1873 │Favorite month JAN│ 10│  3│  8│  6│  4│  2│  7│     17│   40│  9│  6│  4│  2│  7│  5│  3│     12│   36│
1874 │               FEB│  6│  8│  6│  4│  2│  7│  5│     11│   38│ 12│  4│  2│  7│  5│  3│  8│     20│   41│
1875 │               MAR│ 16│  6│  4│  2│  7│  5│  3│     19│   43│  8│  2│  7│  5│  3│  8│  6│     14│   39│
1876 │               Q1 │ 32│ 17│ 18│ 12│ 13│ 14│ 15│       │     │ 29│ 12│ 13│ 14│ 15│ 16│ 17│       │     │
1877 │               APR│ 12│  4│  2│  7│  5│  3│  8│     20│   41│  4│  7│  5│  3│  8│  6│  4│      8│   37│
1878 │               MAY│  8│  2│  7│  5│  3│  8│  6│     14│   39│ 14│  5│  3│  8│  6│  4│  2│     16│   42│
1879 │               JUN│  4│  7│  5│  3│  8│  6│  4│      8│   37│ 10│  3│  8│  6│  4│  2│  7│     17│   40│
1880 │               Q2 │ 24│ 13│ 14│ 15│ 16│ 17│ 18│      .│     │ 28│ 15│ 16│ 17│ 18│ 12│ 13│      .│     │
1881 │               JUL│ 14│  5│  3│  8│  6│  4│  2│     16│   42│  6│  8│  6│  4│  2│  7│  5│     11│   38│
1882 │               AUG│ 10│  3│  8│  6│  4│  2│  7│     17│   40│ 16│  6│  4│  2│  7│  5│  3│     19│   43│
1883 │               SEP│  6│  8│  6│  4│  2│  7│  5│     11│   38│ 12│  4│  2│  7│  5│  3│  8│     20│   41│
1884 │               Q3 │ 54│ 29│ 31│ 33│ 28│ 30│ 32│       │     │ 62│ 33│ 28│ 30│ 32│ 27│ 29│       │     │
1885 │               OCT│ 16│  6│  4│  2│  7│  5│  3│     19│   43│  8│  2│  7│  5│  3│  8│  6│     14│   39│
1886 │               NOV│ 12│  4│  2│  7│  5│  3│  8│     20│   41│  4│  7│  5│  3│  8│  6│  4│      8│   37│
1887 │               DEC│  8│  2│  7│  5│  3│  8│  6│     14│   39│ 14│  5│  3│  8│  6│  4│  2│     16│   42│
1888 │               Q4 │ 36│ 12│ 13│ 14│ 15│ 16│ 17│       │     │ 26│ 14│ 15│ 16│ 17│ 18│ 12│       │     │
1889 ╰──────────────────┴───┴───┴───┴───┴───┴───┴───┴───────┴─────┴───┴───┴───┴───┴───┴───┴───┴───────┴─────╯
1890 ])
1891 AT_CLEANUP
1892
1893 AT_SETUP([CTABLES CLABELS])
1894 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
1895 AT_DATA([ctables.sps],
1896 [[GET 'nhtsa.sav'.
1897 CTABLES /TABLE AgeGroup BY qns3a.
1898 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
1899 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
1900 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
1901 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
1902 ]])
1903 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
1904              Custom Tables
1905 ╭───────────────────────┬────────────╮
1906 │                       │S3a. GENDER:│
1907 │                       ├─────┬──────┤
1908 │                       │ Male│Female│
1909 │                       ├─────┼──────┤
1910 │                       │Count│ Count│
1911 ├───────────────────────┼─────┼──────┤
1912 │Age group 15 or younger│    0│     0│
1913 │          16 to 25     │  594│   505│
1914 │          26 to 35     │  476│   491│
1915 │          36 to 45     │  489│   548│
1916 │          46 to 55     │  526│   649│
1917 │          56 to 65     │  516│   731│
1918 │          66 or older  │  531│   943│
1919 ╰───────────────────────┴─────┴──────╯
1920
1921                                                       Custom Tables
1922 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1923 │       │                                                 S3a. GENDER:                                                 │
1924 │       ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
1925 │       │                         Male                         │                         Female                        │
1926 │       ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
1927 │       │  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 │
1928 │       │ younger │   25  │  35  │  45  │  55  │   65  │ older │  younger │  25  │   35  │  45  │  55  │  65  │  older │
1929 │       ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1930 │       │  Count  │ Count │ Count│ Count│ Count│ Count │ Count │   Count  │ Count│ Count │ Count│ Count│ Count│  Count │
1931 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
1932 │Age    │        0│    594│   476│   489│   526│    516│    531│         0│   505│    491│   548│   649│   731│     943│
1933 │group  │         │       │      │      │      │       │       │          │      │       │      │      │      │        │
1934 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
1935
1936                 Custom Tables
1937 ╭──────────────────────────────┬────────────╮
1938 │                              │S3a. GENDER:│
1939 │                              ├────────────┤
1940 │                              │    Count   │
1941 ├──────────────────────────────┼────────────┤
1942 │Age group 15 or younger Male  │           0│
1943 │                        Female│           0│
1944 │         ╶────────────────────┼────────────┤
1945 │          16 to 25      Male  │         594│
1946 │                        Female│         505│
1947 │         ╶────────────────────┼────────────┤
1948 │          26 to 35      Male  │         476│
1949 │                        Female│         491│
1950 │         ╶────────────────────┼────────────┤
1951 │          36 to 45      Male  │         489│
1952 │                        Female│         548│
1953 │         ╶────────────────────┼────────────┤
1954 │          46 to 55      Male  │         526│
1955 │                        Female│         649│
1956 │         ╶────────────────────┼────────────┤
1957 │          56 to 65      Male  │         516│
1958 │                        Female│         731│
1959 │         ╶────────────────────┼────────────┤
1960 │          66 or older   Male  │         531│
1961 │                        Female│         943│
1962 ╰──────────────────────────────┴────────────╯
1963
1964       Custom Tables
1965 15 or younger
1966 ╭─────────┬────────────╮
1967 │         │S3a. GENDER:│
1968 │         ├─────┬──────┤
1969 │         │ Male│Female│
1970 │         ├─────┼──────┤
1971 │         │Count│ Count│
1972 ├─────────┼─────┼──────┤
1973 │Age group│    0│     0│
1974 ╰─────────┴─────┴──────╯
1975
1976       Custom Tables
1977 16 to 25
1978 ╭─────────┬────────────╮
1979 │         │S3a. GENDER:│
1980 │         ├─────┬──────┤
1981 │         │ Male│Female│
1982 │         ├─────┼──────┤
1983 │         │Count│ Count│
1984 ├─────────┼─────┼──────┤
1985 │Age group│  594│   505│
1986 ╰─────────┴─────┴──────╯
1987
1988       Custom Tables
1989 26 to 35
1990 ╭─────────┬────────────╮
1991 │         │S3a. GENDER:│
1992 │         ├─────┬──────┤
1993 │         │ Male│Female│
1994 │         ├─────┼──────┤
1995 │         │Count│ Count│
1996 ├─────────┼─────┼──────┤
1997 │Age group│  476│   491│
1998 ╰─────────┴─────┴──────╯
1999
2000       Custom Tables
2001 36 to 45
2002 ╭─────────┬────────────╮
2003 │         │S3a. GENDER:│
2004 │         ├─────┬──────┤
2005 │         │ Male│Female│
2006 │         ├─────┼──────┤
2007 │         │Count│ Count│
2008 ├─────────┼─────┼──────┤
2009 │Age group│  489│   548│
2010 ╰─────────┴─────┴──────╯
2011
2012       Custom Tables
2013 46 to 55
2014 ╭─────────┬────────────╮
2015 │         │S3a. GENDER:│
2016 │         ├─────┬──────┤
2017 │         │ Male│Female│
2018 │         ├─────┼──────┤
2019 │         │Count│ Count│
2020 ├─────────┼─────┼──────┤
2021 │Age group│  526│   649│
2022 ╰─────────┴─────┴──────╯
2023
2024       Custom Tables
2025 56 to 65
2026 ╭─────────┬────────────╮
2027 │         │S3a. GENDER:│
2028 │         ├─────┬──────┤
2029 │         │ Male│Female│
2030 │         ├─────┼──────┤
2031 │         │Count│ Count│
2032 ├─────────┼─────┼──────┤
2033 │Age group│  516│   731│
2034 ╰─────────┴─────┴──────╯
2035
2036       Custom Tables
2037 66 or older
2038 ╭─────────┬────────────╮
2039 │         │S3a. GENDER:│
2040 │         ├─────┬──────┤
2041 │         │ Male│Female│
2042 │         ├─────┼──────┤
2043 │         │Count│ Count│
2044 ├─────────┼─────┼──────┤
2045 │Age group│  531│   943│
2046 ╰─────────┴─────┴──────╯
2047
2048              Custom Tables
2049 Male
2050 ╭───────────────────────┬────────────╮
2051 │                       │S3a. GENDER:│
2052 │                       ├────────────┤
2053 │                       │    Count   │
2054 ├───────────────────────┼────────────┤
2055 │Age group 15 or younger│           0│
2056 │          16 to 25     │         594│
2057 │          26 to 35     │         476│
2058 │          36 to 45     │         489│
2059 │          46 to 55     │         526│
2060 │          56 to 65     │         516│
2061 │          66 or older  │         531│
2062 ╰───────────────────────┴────────────╯
2063
2064              Custom Tables
2065 Female
2066 ╭───────────────────────┬────────────╮
2067 │                       │S3a. GENDER:│
2068 │                       ├────────────┤
2069 │                       │    Count   │
2070 ├───────────────────────┼────────────┤
2071 │Age group 15 or younger│           0│
2072 │          16 to 25     │         505│
2073 │          26 to 35     │         491│
2074 │          36 to 45     │         548│
2075 │          46 to 55     │         649│
2076 │          56 to 65     │         731│
2077 │          66 or older  │         943│
2078 ╰───────────────────────┴────────────╯
2079 ])
2080 AT_CLEANUP
2081
2082 AT_SETUP([CTABLES missing values])
2083 AT_DATA([ctables.sps],
2084 [[DATA LIST LIST NOTABLE/x y.
2085 BEGIN DATA.
2086 1 1
2087 1 2
2088 1 3
2089 1 4
2090 1 5
2091 1 .
2092 2 1
2093 2 2
2094 2 3
2095 2 4
2096 2 5
2097 2 .
2098 3 1
2099 3 2
2100 3 3
2101 3 4
2102 3 5
2103 3 .
2104 4 1
2105 4 2
2106 4 3
2107 4 4
2108 4 5
2109 4 .
2110 5 1
2111 5 2
2112 5 3
2113 5 4
2114 5 5
2115 5 .
2116 . 1
2117 . 2
2118 . 3
2119 . 4
2120 . 5
2121 . .
2122 END DATA.
2123 MISSING VALUES x (1, 2) y (2, 3).
2124 VARIABLE LEVEL ALL (NOMINAL).
2125
2126 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
2127                  TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
2128     /CATEGORIES VARIABLES=ALL TOTAL=YES.
2129 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
2130                  TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
2131     /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
2132 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2133                       TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2134     /CATEGORIES VARIABLES=ALL TOTAL=YES
2135     /SLABELS POSITION=ROW.
2136 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2137                       TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2138     /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
2139     /SLABELS POSITION=ROW.
2140 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2141                       TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2142     /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES 
2143     /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES 
2144     /SLABELS POSITION=ROW.
2145 ]])
2146 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2147                                Custom Tables
2148 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
2149 │       │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
2150 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
2151 │x 3.00 │    6│   33.3%│           33.3%│           16.7%│       │       │
2152 │  4.00 │    6│   33.3%│           33.3%│           16.7%│       │       │
2153 │  5.00 │    6│   33.3%│           33.3%│           16.7%│       │       │
2154 │  Total│   18│  100.0%│          100.0%│          100.0%│     18│     36│
2155 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
2156 dnl Note that Column Total N % doesn't add up to 100 because missing
2157 dnl values are included in the total but not shown as a category and this
2158 dnl is expected behavior.
2159
2160                                Custom Tables
2161 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
2162 │       │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
2163 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
2164 │x 1.00 │    6│   20.0%│             .0%│           16.7%│       │       │
2165 │  2.00 │    6│   20.0%│             .0%│           16.7%│       │       │
2166 │  3.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
2167 │  4.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
2168 │  5.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
2169 │  Total│   30│  100.0%│          100.0%│          100.0%│     18│     36│
2170 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
2171 dnl Note that Column Total N % doesn't add up to 100 because system-missing
2172 dnl values are included in the total but not shown as a category and this
2173 dnl is expected behavior.
2174
2175                      Custom Tables
2176 ╭────────────────────────┬───────────────────────────╮
2177 │                        │             y             │
2178 │                        ├──────┬──────┬──────┬──────┤
2179 │                        │ 1.00 │ 4.00 │ 5.00 │ Total│
2180 ├────────────────────────┼──────┼──────┼──────┼──────┤
2181 │x 3.00  Count           │     1│     1│     1│     3│
2182 │        Column %        │ 33.3%│ 33.3%│ 33.3%│     .│
2183 │        Column Valid N %│ 33.3%│ 33.3%│ 33.3%│     .│
2184 │        Column Total N %│ 33.3%│ 33.3%│ 33.3%│     .│
2185 │        Row %           │ 33.3%│ 33.3%│ 33.3%│100.0%│
2186 │        Row Valid N %   │ 33.3%│ 33.3%│ 33.3%│100.0%│
2187 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│100.0%│
2188 │        Valid N         │      │      │      │     3│
2189 │        Total N         │      │      │      │     6│
2190 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2191 │  4.00  Count           │     1│     1│     1│     3│
2192 │        Column %        │ 33.3%│ 33.3%│ 33.3%│     .│
2193 │        Column Valid N %│ 33.3%│ 33.3%│ 33.3%│     .│
2194 │        Column Total N %│ 33.3%│ 33.3%│ 33.3%│     .│
2195 │        Row %           │ 33.3%│ 33.3%│ 33.3%│100.0%│
2196 │        Row Valid N %   │ 33.3%│ 33.3%│ 33.3%│100.0%│
2197 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│100.0%│
2198 │        Valid N         │      │      │      │     3│
2199 │        Total N         │      │      │      │     6│
2200 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2201 │  5.00  Count           │     1│     1│     1│     3│
2202 │        Column %        │ 33.3%│ 33.3%│ 33.3%│     .│
2203 │        Column Valid N %│ 33.3%│ 33.3%│ 33.3%│     .│
2204 │        Column Total N %│ 33.3%│ 33.3%│ 33.3%│     .│
2205 │        Row %           │ 33.3%│ 33.3%│ 33.3%│100.0%│
2206 │        Row Valid N %   │ 33.3%│ 33.3%│ 33.3%│100.0%│
2207 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│100.0%│
2208 │        Valid N         │      │      │      │     3│
2209 │        Total N         │      │      │      │     6│
2210 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2211 │  Total Count           │     3│     3│     3│     9│
2212 │        Column %        │100.0%│100.0%│100.0%│     .│
2213 │        Column Valid N %│100.0%│100.0%│100.0%│     .│
2214 │        Column Total N %│100.0%│100.0%│100.0%│     .│
2215 │        Row %           │     .│     .│     .│     .│
2216 │        Row Valid N %   │     .│     .│     .│     .│
2217 │        Row Total N %   │     .│     .│     .│     .│
2218 │        Valid N         │     3│     3│     3│     9│
2219 │        Total N         │     3│     3│     3│    18│
2220 ╰────────────────────────┴──────┴──────┴──────┴──────╯
2221
2222                             Custom Tables
2223 ╭────────────────────────┬─────────────────────────────────────────╮
2224 │                        │                    y                    │
2225 │                        ├──────┬──────┬──────┬──────┬──────┬──────┤
2226 │                        │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2227 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2228 │x 1.00  Count           │     1│     1│     1│     1│     1│     5│
2229 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2230 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2231 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2232 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2233 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2234 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2235 │        Valid N         │      │      │      │      │      │     3│
2236 │        Total N         │      │      │      │      │      │     6│
2237 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2238 │  2.00  Count           │     1│     1│     1│     1│     1│     5│
2239 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2240 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2241 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2242 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2243 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2244 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2245 │        Valid N         │      │      │      │      │      │     3│
2246 │        Total N         │      │      │      │      │      │     6│
2247 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2248 │  3.00  Count           │     1│     1│     1│     1│     1│     5│
2249 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2250 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2251 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2252 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2253 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2254 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2255 │        Valid N         │      │      │      │      │      │     3│
2256 │        Total N         │      │      │      │      │      │     6│
2257 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2258 │  4.00  Count           │     1│     1│     1│     1│     1│     5│
2259 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2260 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2261 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2262 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2263 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2264 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2265 │        Valid N         │      │      │      │      │      │     3│
2266 │        Total N         │      │      │      │      │      │     6│
2267 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2268 │  5.00  Count           │     1│     1│     1│     1│     1│     5│
2269 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2270 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2271 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2272 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2273 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2274 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2275 │        Valid N         │      │      │      │      │      │     3│
2276 │        Total N         │      │      │      │      │      │     6│
2277 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2278 │  Total Count           │     5│     5│     5│     5│     5│    25│
2279 │        Column %        │100.0%│100.0%│100.0%│100.0%│100.0%│     .│
2280 │        Column Valid N %│100.0%│     .│     .│100.0%│100.0%│     .│
2281 │        Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│     .│
2282 │        Row %           │     .│     .│     .│     .│     .│     .│
2283 │        Row Valid N %   │     .│     .│     .│     .│     .│     .│
2284 │        Row Total N %   │     .│     .│     .│     .│     .│     .│
2285 │        Valid N         │     5│     0│     0│     5│     5│    15│
2286 │        Total N         │     5│     5│     5│     5│     5│    30│
2287 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
2288
2289                         Custom Tables
2290 ╭────────────────────────┬──────────────────────────────────╮
2291 │                        │                 y                │
2292 │                        ├──────┬──────┬──────┬──────┬──────┤
2293 │                        │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2294 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
2295 │x 1.00  Count           │     1│     1│     1│     1│     4│
2296 │        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2297 │        Column Valid N %│ 25.0%│     .│ 25.0%│ 25.0%│     .│
2298 │        Column Total N %│ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2299 │        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2300 │        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
2301 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2302 │        Valid N         │      │      │      │      │     3│
2303 │        Total N         │      │      │      │      │     6│
2304 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2305 │  2.00  Count           │     1│     1│     1│     1│     4│
2306 │        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2307 │        Column Valid N %│ 25.0%│     .│ 25.0%│ 25.0%│     .│
2308 │        Column Total N %│ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2309 │        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2310 │        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
2311 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2312 │        Valid N         │      │      │      │      │     3│
2313 │        Total N         │      │      │      │      │     6│
2314 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2315 │  3.00  Count           │     1│     1│     1│     1│     4│
2316 │        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2317 │        Column Valid N %│ 25.0%│     .│ 25.0%│ 25.0%│     .│
2318 │        Column Total N %│ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2319 │        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2320 │        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
2321 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2322 │        Valid N         │      │      │      │      │     3│
2323 │        Total N         │      │      │      │      │     6│
2324 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2325 │  4.00  Count           │     1│     1│     1│     1│     4│
2326 │        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2327 │        Column Valid N %│ 25.0%│     .│ 25.0%│ 25.0%│     .│
2328 │        Column Total N %│ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2329 │        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2330 │        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
2331 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2332 │        Valid N         │      │      │      │      │     3│
2333 │        Total N         │      │      │      │      │     6│
2334 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2335 │  Total Count           │     4│     4│     4│     4│    16│
2336 │        Column %        │100.0%│100.0%│100.0%│100.0%│     .│
2337 │        Column Valid N %│100.0%│     .│100.0%│100.0%│     .│
2338 │        Column Total N %│100.0%│100.0%│100.0%│100.0%│     .│
2339 │        Row %           │     .│     .│     .│     .│     .│
2340 │        Row Valid N %   │     .│     .│     .│     .│     .│
2341 │        Row Total N %   │     .│     .│     .│     .│     .│
2342 │        Valid N         │     4│     0│     4│     4│    12│
2343 │        Total N         │     4│     4│     4│     4│    24│
2344 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2345 ])
2346 AT_CLEANUP
2347
2348 AT_SETUP([CTABLES SMISSING=LISTWISE])
2349 AT_KEYWORDS([SMISSING LISTWISE])
2350 AT_DATA([ctables.sps],
2351 [[DATA LIST LIST NOTABLE/x y z.
2352 BEGIN DATA.
2353 1  . 40
2354 1 10 50
2355 1 20 60
2356 1  .  .
2357 1 30  .
2358 END DATA.
2359 VARIABLE LEVEL x (NOMINAL).
2360
2361 CTABLES /TABLE (y + z) > x.
2362 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2363
2364 * The following doesn't come out as listwise because the tables are
2365 separate, not linked by an > operator.
2366 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2367 ]])
2368 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2369   Custom Tables
2370 ╭────────┬─────╮
2371 │        │ Mean│
2372 ├────────┼─────┤
2373 │y x 1.00│20.00│
2374 ├────────┼─────┤
2375 │z x 1.00│50.00│
2376 ╰────────┴─────╯
2377
2378   Custom Tables
2379 ╭────────┬─────╮
2380 │        │ Mean│
2381 ├────────┼─────┤
2382 │y x 1.00│15.00│
2383 ├────────┼─────┤
2384 │z x 1.00│55.00│
2385 ╰────────┴─────╯
2386
2387   Custom Tables
2388 ╭────────┬─────╮
2389 │        │ Mean│
2390 ├────────┼─────┤
2391 │y x 1.00│20.00│
2392 ├────────┼─────┤
2393 │z x 1.00│50.00│
2394 ╰────────┴─────╯
2395 ])
2396 AT_CLEANUP
2397
2398 AT_SETUP([CTABLES VLABELS - variables on different axes])
2399 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2400 AT_DATA([ctables.sps],
2401 [[GET 'nhtsa.sav'.
2402 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
2403 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME    /TABLE qnd5a BY qns3a.
2404 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL   /TABLE qnd5a BY qns3a.
2405 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH    /TABLE qnd5a BY qns3a.
2406 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE    /TABLE qnd5a BY qns3a.
2407 ]])
2408 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2409                                  Custom Tables
2410 ╭────────────────────────────────────────────────────────────────┬────────────╮
2411 │                                                                │S3a. GENDER:│
2412 │                                                                ├─────┬──────┤
2413 │                                                                │ Male│Female│
2414 │                                                                ├─────┼──────┤
2415 │                                                                │Count│ Count│
2416 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2417 │D5a. What would you say is your primary    Cuban                │   13│     7│
2418 │ethnic background?                         Mexican              │  175│   136│
2419 │                                           Spanish              │   20│    28│
2420 │                                           South American       │   21│    13│
2421 │                                           Central American     │   27│    25│
2422 │                                           Puerto Rican, OR     │   37│    41│
2423 │                                           Something else       │   35│    33│
2424 │                                           Multiple - cannot    │    2│     5│
2425 │                                           choose one           │     │      │
2426 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2427
2428                   Custom Tables
2429 ╭──────────────────────────────────┬────────────╮
2430 │                                  │    QNS3A   │
2431 │                                  ├─────┬──────┤
2432 │                                  │ Male│Female│
2433 │                                  ├─────┼──────┤
2434 │                                  │Count│ Count│
2435 ├──────────────────────────────────┼─────┼──────┤
2436 │QND5A Cuban                       │   13│     7│
2437 │      Mexican                     │  175│   136│
2438 │      Spanish                     │   20│    28│
2439 │      South American              │   21│    13│
2440 │      Central American            │   27│    25│
2441 │      Puerto Rican, OR            │   37│    41│
2442 │      Something else              │   35│    33│
2443 │      Multiple - cannot choose one│    2│     5│
2444 ╰──────────────────────────────────┴─────┴──────╯
2445
2446                                  Custom Tables
2447 ╭────────────────────────────────────────────────────────────────┬────────────╮
2448 │                                                                │S3a. GENDER:│
2449 │                                                                ├─────┬──────┤
2450 │                                                                │ Male│Female│
2451 │                                                                ├─────┼──────┤
2452 │                                                                │Count│ Count│
2453 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2454 │D5a. What would you say is your primary    Cuban                │   13│     7│
2455 │ethnic background?                         Mexican              │  175│   136│
2456 │                                           Spanish              │   20│    28│
2457 │                                           South American       │   21│    13│
2458 │                                           Central American     │   27│    25│
2459 │                                           Puerto Rican, OR     │   37│    41│
2460 │                                           Something else       │   35│    33│
2461 │                                           Multiple - cannot    │    2│     5│
2462 │                                           choose one           │     │      │
2463 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2464
2465                                  Custom Tables
2466 ╭────────────────────────────────────────────────────────────┬────────────────╮
2467 │                                                            │   QNS3A S3a.   │
2468 │                                                            │     GENDER:    │
2469 │                                                            ├───────┬────────┤
2470 │                                                            │  Male │ Female │
2471 │                                                            ├───────┼────────┤
2472 │                                                            │ Count │  Count │
2473 ├────────────────────────────────────────────────────────────┼───────┼────────┤
2474 │QND5A D5a. What would you say is your    Cuban              │     13│       7│
2475 │primary ethnic background?               Mexican            │    175│     136│
2476 │                                         Spanish            │     20│      28│
2477 │                                         South American     │     21│      13│
2478 │                                         Central American   │     27│      25│
2479 │                                         Puerto Rican, OR   │     37│      41│
2480 │                                         Something else     │     35│      33│
2481 │                                         Multiple - cannot  │      2│       5│
2482 │                                         choose one         │       │        │
2483 ╰────────────────────────────────────────────────────────────┴───────┴────────╯
2484
2485                Custom Tables
2486 ╭────────────────────────────┬─────┬──────╮
2487 │                            │ Male│Female│
2488 │                            ├─────┼──────┤
2489 │                            │Count│ Count│
2490 ├────────────────────────────┼─────┼──────┤
2491 │Cuban                       │   13│     7│
2492 │Mexican                     │  175│   136│
2493 │Spanish                     │   20│    28│
2494 │South American              │   21│    13│
2495 │Central American            │   27│    25│
2496 │Puerto Rican, OR            │   37│    41│
2497 │Something else              │   35│    33│
2498 │Multiple - cannot choose one│    2│     5│
2499 ╰────────────────────────────┴─────┴──────╯
2500 ])
2501 AT_CLEANUP
2502
2503 AT_SETUP([CTABLES VLABELS - stacked variables])
2504 AT_KEYWORDS([stack stacking])
2505 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2506 AT_DATA([ctables.sps],
2507 [[GET 'nhtsa.sav'.
2508 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a + qns3a.
2509 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a + qns3a.
2510 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a + qns3a.
2511 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2512 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2513 ]])
2514 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2515                                  Custom Tables
2516 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2517 │                                                                       │Count│
2518 ├───────────────────────────────────────────────────────────────────────┼─────┤
2519 │D5a. What would you say is your primary ethnic  Cuban                  │   20│
2520 │background?                                     Mexican                │  311│
2521 │                                                Spanish                │   48│
2522 │                                                South American         │   34│
2523 │                                                Central American       │   52│
2524 │                                                Puerto Rican, OR       │   78│
2525 │                                                Something else         │   68│
2526 │                                                Multiple - cannot      │    7│
2527 │                                                choose one             │     │
2528 ├───────────────────────────────────────────────────────────────────────┼─────┤
2529 │QNS3A                                           Male                   │ 3132│
2530 │                                                Female                 │ 3867│
2531 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2532
2533                   Custom Tables
2534 ╭─────────────────────────────────────────┬─────╮
2535 │                                         │Count│
2536 ├─────────────────────────────────────────┼─────┤
2537 │QND5A        Cuban                       │   20│
2538 │             Mexican                     │  311│
2539 │             Spanish                     │   48│
2540 │             South American              │   34│
2541 │             Central American            │   52│
2542 │             Puerto Rican, OR            │   78│
2543 │             Something else              │   68│
2544 │             Multiple - cannot choose one│    7│
2545 ├─────────────────────────────────────────┼─────┤
2546 │S3a. GENDER: Male                        │ 3132│
2547 │             Female                      │ 3867│
2548 ╰─────────────────────────────────────────┴─────╯
2549
2550                                  Custom Tables
2551 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2552 │                                                                       │Count│
2553 ├───────────────────────────────────────────────────────────────────────┼─────┤
2554 │D5a. What would you say is your primary ethnic  Cuban                  │   20│
2555 │background?                                     Mexican                │  311│
2556 │                                                Spanish                │   48│
2557 │                                                South American         │   34│
2558 │                                                Central American       │   52│
2559 │                                                Puerto Rican, OR       │   78│
2560 │                                                Something else         │   68│
2561 │                                                Multiple - cannot      │    7│
2562 │                                                choose one             │     │
2563 ├───────────────────────────────────────────────────────────────────────┼─────┤
2564 │Male                                                                   │ 3132│
2565 ├───────────────────────────────────────────────────────────────────────┼─────┤
2566 │Female                                                                 │ 3867│
2567 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2568
2569             Custom Tables
2570 ╭─────────────────────────────┬─────╮
2571 │                             │Count│
2572 ├─────────────────────────────┼─────┤
2573 │Cuban                        │   20│
2574 ├─────────────────────────────┼─────┤
2575 │Mexican                      │  311│
2576 ├─────────────────────────────┼─────┤
2577 │Spanish                      │   48│
2578 ├─────────────────────────────┼─────┤
2579 │South American               │   34│
2580 ├─────────────────────────────┼─────┤
2581 │Central American             │   52│
2582 ├─────────────────────────────┼─────┤
2583 │Puerto Rican, OR             │   78│
2584 ├─────────────────────────────┼─────┤
2585 │Something else               │   68│
2586 ├─────────────────────────────┼─────┤
2587 │Multiple - cannot choose one │    7│
2588 ├─────────────────────────────┼─────┤
2589 │S3a. GENDER:     Male        │ 3132│
2590 │                 Female      │ 3867│
2591 ╰─────────────────────────────┴─────╯
2592
2593             Custom Tables
2594 ╭────────────────────────────┬─────╮
2595 │                            │Count│
2596 ├────────────────────────────┼─────┤
2597 │Cuban                       │   20│
2598 │Mexican                     │  311│
2599 │Spanish                     │   48│
2600 │South American              │   34│
2601 │Central American            │   52│
2602 │Puerto Rican, OR            │   78│
2603 │Something else              │   68│
2604 │Multiple - cannot choose one│    7│
2605 │Male                        │ 3132│
2606 │Female                      │ 3867│
2607 ╰────────────────────────────┴─────╯
2608 ])
2609 AT_CLEANUP
2610
2611 AT_SETUP([CTABLES VLABELS - nested variables])
2612 AT_KEYWORDS([nest nesting])
2613 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2614 AT_DATA([ctables.sps],
2615 [[GET 'nhtsa.sav'.
2616 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a > qns3a.
2617 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a > qns3a.
2618 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a > qns3a.
2619 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2620 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2621 ]])
2622 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2623                                  Custom Tables
2624 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2625 │                                                                       │Count│
2626 ├───────────────────────────────────────────────────────────────────────┼─────┤
2627 │D5a. What would you say is your       Cuban                QNS3A Male  │   13│
2628 │primary ethnic background?                                       Female│    7│
2629 │                                     ╶─────────────────────────────────┼─────┤
2630 │                                      Mexican              QNS3A Male  │  175│
2631 │                                                                 Female│  136│
2632 │                                     ╶─────────────────────────────────┼─────┤
2633 │                                      Spanish              QNS3A Male  │   20│
2634 │                                                                 Female│   28│
2635 │                                     ╶─────────────────────────────────┼─────┤
2636 │                                      South American       QNS3A Male  │   21│
2637 │                                                                 Female│   13│
2638 │                                     ╶─────────────────────────────────┼─────┤
2639 │                                      Central American     QNS3A Male  │   27│
2640 │                                                                 Female│   25│
2641 │                                     ╶─────────────────────────────────┼─────┤
2642 │                                      Puerto Rican, OR     QNS3A Male  │   37│
2643 │                                                                 Female│   41│
2644 │                                     ╶─────────────────────────────────┼─────┤
2645 │                                      Something else       QNS3A Male  │   35│
2646 │                                                                 Female│   33│
2647 │                                     ╶─────────────────────────────────┼─────┤
2648 │                                      Multiple - cannot    QNS3A Male  │    2│
2649 │                                      choose one                 Female│    5│
2650 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2651
2652                          Custom Tables
2653 ╭──────────────────────────────────────────────────────┬─────╮
2654 │                                                      │Count│
2655 ├──────────────────────────────────────────────────────┼─────┤
2656 │QND5A Cuban                        S3a. GENDER: Male  │   13│
2657 │                                                Female│    7│
2658 │     ╶────────────────────────────────────────────────┼─────┤
2659 │      Mexican                      S3a. GENDER: Male  │  175│
2660 │                                                Female│  136│
2661 │     ╶────────────────────────────────────────────────┼─────┤
2662 │      Spanish                      S3a. GENDER: Male  │   20│
2663 │                                                Female│   28│
2664 │     ╶────────────────────────────────────────────────┼─────┤
2665 │      South American               S3a. GENDER: Male  │   21│
2666 │                                                Female│   13│
2667 │     ╶────────────────────────────────────────────────┼─────┤
2668 │      Central American             S3a. GENDER: Male  │   27│
2669 │                                                Female│   25│
2670 │     ╶────────────────────────────────────────────────┼─────┤
2671 │      Puerto Rican, OR             S3a. GENDER: Male  │   37│
2672 │                                                Female│   41│
2673 │     ╶────────────────────────────────────────────────┼─────┤
2674 │      Something else               S3a. GENDER: Male  │   35│
2675 │                                                Female│   33│
2676 │     ╶────────────────────────────────────────────────┼─────┤
2677 │      Multiple - cannot choose one S3a. GENDER: Male  │    2│
2678 │                                                Female│    5│
2679 ╰──────────────────────────────────────────────────────┴─────╯
2680
2681                                  Custom Tables
2682 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2683 │                                                                       │Count│
2684 ├───────────────────────────────────────────────────────────────────────┼─────┤
2685 │D5a. What would you say is your primary    Cuban                 Male  │   13│
2686 │ethnic background?                                               Female│    7│
2687 │                                          ╶────────────────────────────┼─────┤
2688 │                                           Mexican               Male  │  175│
2689 │                                                                 Female│  136│
2690 │                                          ╶────────────────────────────┼─────┤
2691 │                                           Spanish               Male  │   20│
2692 │                                                                 Female│   28│
2693 │                                          ╶────────────────────────────┼─────┤
2694 │                                           South American        Male  │   21│
2695 │                                                                 Female│   13│
2696 │                                          ╶────────────────────────────┼─────┤
2697 │                                           Central American      Male  │   27│
2698 │                                                                 Female│   25│
2699 │                                          ╶────────────────────────────┼─────┤
2700 │                                           Puerto Rican, OR      Male  │   37│
2701 │                                                                 Female│   41│
2702 │                                          ╶────────────────────────────┼─────┤
2703 │                                           Something else        Male  │   35│
2704 │                                                                 Female│   33│
2705 │                                          ╶────────────────────────────┼─────┤
2706 │                                           Multiple - cannot     Male  │    2│
2707 │                                           choose one            Female│    5│
2708 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2709
2710                       Custom Tables
2711 ╭────────────────────────────────────────────────┬─────╮
2712 │                                                │Count│
2713 ├────────────────────────────────────────────────┼─────┤
2714 │Cuban                        S3a. GENDER: Male  │   13│
2715 │                                          Female│    7│
2716 ├────────────────────────────────────────────────┼─────┤
2717 │Mexican                      S3a. GENDER: Male  │  175│
2718 │                                          Female│  136│
2719 ├────────────────────────────────────────────────┼─────┤
2720 │Spanish                      S3a. GENDER: Male  │   20│
2721 │                                          Female│   28│
2722 ├────────────────────────────────────────────────┼─────┤
2723 │South American               S3a. GENDER: Male  │   21│
2724 │                                          Female│   13│
2725 ├────────────────────────────────────────────────┼─────┤
2726 │Central American             S3a. GENDER: Male  │   27│
2727 │                                          Female│   25│
2728 ├────────────────────────────────────────────────┼─────┤
2729 │Puerto Rican, OR             S3a. GENDER: Male  │   37│
2730 │                                          Female│   41│
2731 ├────────────────────────────────────────────────┼─────┤
2732 │Something else               S3a. GENDER: Male  │   35│
2733 │                                          Female│   33│
2734 ├────────────────────────────────────────────────┼─────┤
2735 │Multiple - cannot choose one S3a. GENDER: Male  │    2│
2736 │                                          Female│    5│
2737 ╰────────────────────────────────────────────────┴─────╯
2738
2739                Custom Tables
2740 ╭───────────────────────────────────┬─────╮
2741 │                                   │Count│
2742 ├───────────────────────────────────┼─────┤
2743 │Cuban                        Male  │   13│
2744 │                             Female│    7│
2745 ├───────────────────────────────────┼─────┤
2746 │Mexican                      Male  │  175│
2747 │                             Female│  136│
2748 ├───────────────────────────────────┼─────┤
2749 │Spanish                      Male  │   20│
2750 │                             Female│   28│
2751 ├───────────────────────────────────┼─────┤
2752 │South American               Male  │   21│
2753 │                             Female│   13│
2754 ├───────────────────────────────────┼─────┤
2755 │Central American             Male  │   27│
2756 │                             Female│   25│
2757 ├───────────────────────────────────┼─────┤
2758 │Puerto Rican, OR             Male  │   37│
2759 │                             Female│   41│
2760 ├───────────────────────────────────┼─────┤
2761 │Something else               Male  │   35│
2762 │                             Female│   33│
2763 ├───────────────────────────────────┼─────┤
2764 │Multiple - cannot choose one Male  │    2│
2765 │                             Female│    5│
2766 ╰───────────────────────────────────┴─────╯
2767 ])
2768 AT_CLEANUP
2769
2770 AT_SETUP([CTABLES FORMAT EMPTY])
2771 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2772 AT_DATA([ctables.sps],
2773 [[GET 'nhtsa.sav'.
2774 CTABLES /FORMAT EMPTY=ZERO /TABLE qnd5a BY qnd5.
2775 CTABLES /FORMAT EMPTY=BLANK /TABLE qnd5a BY qnd5.
2776 CTABLES /FORMAT EMPTY='n/a' /TABLE qnd5a BY qnd5.
2777 ]])
2778 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
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│              0│
2790 │your primary ethnic          Mexican         │            311│              0│
2791 │background?                  Spanish         │             48│              0│
2792 │                             South American  │             34│              0│
2793 │                             Central American│             52│              0│
2794 │                             Puerto Rican, OR│             78│              0│
2795 │                             Something else  │             68│              0│
2796 │                             Multiple -      │              7│              0│
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│               │
2812 │your primary ethnic          Mexican         │            311│               │
2813 │background?                  Spanish         │             48│               │
2814 │                             South American  │             34│               │
2815 │                             Central American│             52│               │
2816 │                             Puerto Rican, OR│             78│               │
2817 │                             Something else  │             68│               │
2818 │                             Multiple -      │              7│               │
2819 │                             cannot choose   │               │               │
2820 │                             one             │               │               │
2821 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2822
2823                                  Custom Tables
2824 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2825 │                                             │   D5. ETHNICITY: Are you of   │
2826 │                                             │  Hispanic or Latino origin or │
2827 │                                             │            descent?           │
2828 │                                             ├───────────────┬───────────────┤
2829 │                                             │      Yes      │       No      │
2830 │                                             ├───────────────┼───────────────┤
2831 │                                             │     Count     │     Count     │
2832 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2833 │D5a. What would you say is   Cuban           │             20│n/a            │
2834 │your primary ethnic          Mexican         │            311│n/a            │
2835 │background?                  Spanish         │             48│n/a            │
2836 │                             South American  │             34│n/a            │
2837 │                             Central American│             52│n/a            │
2838 │                             Puerto Rican, OR│             78│n/a            │
2839 │                             Something else  │             68│n/a            │
2840 │                             Multiple -      │              7│n/a            │
2841 │                             cannot choose   │               │               │
2842 │                             one             │               │               │
2843 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2844 ])
2845 AT_CLEANUP
2846
2847 AT_SETUP([CTABLES FORMAT MISSING])
2848 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2849 AT_DATA([ctables.sps],
2850 [[GET 'nhtsa.sav'.
2851 CTABLES /FORMAT MISSING='(no data)' /TABLE qnd5a[COLPCT] BY qnd5.
2852 ]])
2853 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2854                                  Custom Tables
2855 ╭─────────────────────────────────────────────┬───────────────────────────────╮
2856 │                                             │   D5. ETHNICITY: Are you of   │
2857 │                                             │  Hispanic or Latino origin or │
2858 │                                             │            descent?           │
2859 │                                             ├───────────────┬───────────────┤
2860 │                                             │      Yes      │       No      │
2861 │                                             ├───────────────┼───────────────┤
2862 │                                             │    Column %   │    Column %   │
2863 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
2864 │D5a. What would you say is   Cuban           │           3.2%│(no data)      │
2865 │your primary ethnic          Mexican         │          50.3%│(no data)      │
2866 │background?                  Spanish         │           7.8%│(no data)      │
2867 │                             South American  │           5.5%│(no data)      │
2868 │                             Central American│           8.4%│(no data)      │
2869 │                             Puerto Rican, OR│          12.6%│(no data)      │
2870 │                             Something else  │          11.0%│(no data)      │
2871 │                             Multiple -      │           1.1%│(no data)      │
2872 │                             cannot choose   │               │               │
2873 │                             one             │               │               │
2874 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
2875 ])
2876 AT_CLEANUP
2877
2878 AT_SETUP([CTABLES HIDESMALLCOUNTS])
2879 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2880 AT_DATA([ctables.sps],
2881 [[GET 'nhtsa.sav'.
2882 CTABLES /TABLE qn38[c][COUNT, COLPCT].
2883 CTABLES /HIDESMALLCOUNTS /TABLE qn38[c][COUNT, COLPCT].
2884 CTABLES /HIDESMALLCOUNTS COUNT=10 /TABLE qn38[c][COUNT, COLPCT].
2885 ]])
2886 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2887                                  Custom Tables
2888 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2889 │                                                              │Count│Column %│
2890 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2891 │38. How many drinks did you have on that         Less than one│    7│     .5%│
2892 │occasion?                                        1            │  491│   34.9%│
2893 │                                                 2            │  462│   32.9%│
2894 │                                                 3            │  229│   16.3%│
2895 │                                                 4            │   82│    5.8%│
2896 │                                                 5            │   56│    4.0%│
2897 │                                                 6            │   32│    2.3%│
2898 │                                                 7            │    9│     .6%│
2899 │                                                 8            │    8│     .6%│
2900 │                                                 9            │    4│     .3%│
2901 │                                                 10           │    6│     .4%│
2902 │                                                 11           │    2│     .1%│
2903 │                                                 12           │    5│     .4%│
2904 │                                                 14           │    1│     .1%│
2905 │                                                 15           │    1│     .1%│
2906 │                                                 18           │    1│     .1%│
2907 │                                                 20           │    4│     .3%│
2908 │                                                 25           │    1│     .1%│
2909 │                                                 30           │    3│     .2%│
2910 │                                                 60           │    1│     .1%│
2911 │                                                 99+          │    0│     .0%│
2912 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2913
2914                                  Custom Tables
2915 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2916 │                                                              │Count│Column %│
2917 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2918 │38. How many drinks did you have on that         Less than one│    7│     .5%│
2919 │occasion?                                        1            │  491│   34.9%│
2920 │                                                 2            │  462│   32.9%│
2921 │                                                 3            │  229│   16.3%│
2922 │                                                 4            │   82│    5.8%│
2923 │                                                 5            │   56│    4.0%│
2924 │                                                 6            │   32│    2.3%│
2925 │                                                 7            │    9│     .6%│
2926 │                                                 8            │    8│     .6%│
2927 │                                                 9            │<5   │     .3%│
2928 │                                                 10           │    6│     .4%│
2929 │                                                 11           │<5   │     .1%│
2930 │                                                 12           │    5│     .4%│
2931 │                                                 14           │<5   │     .1%│
2932 │                                                 15           │<5   │     .1%│
2933 │                                                 18           │<5   │     .1%│
2934 │                                                 20           │<5   │     .3%│
2935 │                                                 25           │<5   │     .1%│
2936 │                                                 30           │<5   │     .2%│
2937 │                                                 60           │<5   │     .1%│
2938 │                                                 99+          │<5   │     .0%│
2939 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2940
2941                                  Custom Tables
2942 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
2943 │                                                              │Count│Column %│
2944 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
2945 │38. How many drinks did you have on that         Less than one│<10  │     .5%│
2946 │occasion?                                        1            │  491│   34.9%│
2947 │                                                 2            │  462│   32.9%│
2948 │                                                 3            │  229│   16.3%│
2949 │                                                 4            │   82│    5.8%│
2950 │                                                 5            │   56│    4.0%│
2951 │                                                 6            │   32│    2.3%│
2952 │                                                 7            │<10  │     .6%│
2953 │                                                 8            │<10  │     .6%│
2954 │                                                 9            │<10  │     .3%│
2955 │                                                 10           │<10  │     .4%│
2956 │                                                 11           │<10  │     .1%│
2957 │                                                 12           │<10  │     .4%│
2958 │                                                 14           │<10  │     .1%│
2959 │                                                 15           │<10  │     .1%│
2960 │                                                 18           │<10  │     .1%│
2961 │                                                 20           │<10  │     .3%│
2962 │                                                 25           │<10  │     .1%│
2963 │                                                 30           │<10  │     .2%│
2964 │                                                 60           │<10  │     .1%│
2965 │                                                 99+          │<10  │     .0%│
2966 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
2967 ])
2968 AT_CLEANUP
2969
2970 AT_SETUP([CTABLES FORMAT MINCOLWIDTH MAXCOLWIDTH])
2971 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2972 AT_DATA([ctables.sps],
2973 [[GET 'nhtsa.sav'.
2974 CTABLES /FORMAT MINCOLWIDTH=1 MAXCOLWIDTH=2 UNITS=INCHES /TABLE BY qns3a.
2975 ]])
2976 AT_CHECK([pspp ctables.sps -o - -O box=unicode -o pspp.spv], [0], [dnl
2977  Custom Tables
2978 ╭────────────╮
2979 │S3a. GENDER:│
2980 ├─────┬──────┤
2981 │ Male│Female│
2982 ├─────┼──────┤
2983 │Count│ Count│
2984 ├─────┼──────┤
2985 │ 3132│  3867│
2986 ╰─────┴──────╯
2987 ])
2988 AT_CHECK([pspp-output get-table-look pspp.spv pspp.stt])
2989 AT_CHECK([sed 's/ /\n/g' pspp.stt | grep ColumnWidth | sort], [0], [dnl
2990 maximumColumnWidth="192"
2991 minimumColumnWidth="96"
2992 ])
2993 AT_CLEANUP
2994
2995 AT_SETUP([CTABLES special formats])
2996 AT_KEYWORDS([NEGPAREN NEQUAL PAREN PCTPAREN])
2997 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
2998 AT_DATA([ctables.sps],
2999 [[GET 'nhtsa.sav'.
3000 COMPUTE x = qnd3 - 4.
3001 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].
3002 ]])
3003 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
3004                            Custom Tables
3005 ╭─┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────╮
3006 │ │Minimum│Minimum│Minimum│Minimum│Maximum│Maximum│Maximum│Maximum│
3007 ├─┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
3008 │x│(3.0)  │N=-3.0 │(-3.0) │(-3.0%)│8.0    │N=8.0  │(8.0)  │(8.0%) │
3009 ╰─┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────╯
3010 ])
3011 AT_CLEANUP
3012
3013 AT_SETUP([CTABLES TITLES])
3014 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3015 AT_DATA([ctables.sps],
3016 [[GET 'nhtsa.sav'.
3017 CTABLES
3018     /VLABELS VARIABLES=qn1 DISPLAY=NONE
3019     /TABLE ((qn1[c][COUNT])) BY qns3a[c] > qnd5
3020     /TITLES TITLE='How often do you drive?'
3021             CAPTION='Generated )TIME on )DATE'
3022             CORNER=')TABLE'.
3023 ]])
3024 AT_CHECK([pspp ctables.sps -O box=unicode | sed 's/..:..:../HH:MM:SS/
3025 s&../../..&MM/DD/YY&'], [0], [dnl
3026                             How often do you drive?
3027 ╭───────────────────────────────────┬─────────────────────────────────────────╮
3028 │                                   │               S3a. GENDER:              │
3029 │                                   ├────────────────────┬────────────────────┤
3030 │                                   │        Male        │       Female       │
3031 │                                   ├────────────────────┼────────────────────┤
3032 │                                   │ D5. ETHNICITY: Are │ D5. ETHNICITY: Are │
3033 │                                   │ you of Hispanic or │ you of Hispanic or │
3034 │                                   │  Latino origin or  │  Latino origin or  │
3035 │( ( 1. How often do you usually    │      descent?      │      descent?      │
3036 │drive a car or other motor         ├─────────┬──────────┼─────────┬──────────┤
3037 │vehicle?) ) BY S3a. GENDER: > D5.  │   Yes   │    No    │   Yes   │    No    │
3038 │ETHNICITY: Are you of Hispanic or  ├─────────┼──────────┼─────────┼──────────┤
3039 │Latino origin or descent?          │  Count  │   Count  │  Count  │   Count  │
3040 ├───────────────────────────────────┼─────────┼──────────┼─────────┼──────────┤
3041 │Every day                          │      218│      2066│      166│      2175│
3042 │Several days a week                │       44│       391│       45│       782│
3043 │Once a week or less                │       16│       109│       12│       223│
3044 │Only certain times a year          │       15│        41│       11│        61│
3045 │Never                              │       39│       150│       56│       278│
3046 ╰───────────────────────────────────┴─────────┴──────────┴─────────┴──────────╯
3047 Generated HH:MM:SS on MM/DD/YY
3048 ])
3049 AT_CLEANUP
3050
3051 AT_SETUP([CTABLES area definitions])
3052 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3053 AT_DATA([ctables.sps],
3054 [[GET 'nhtsa.sav'.
3055 CTABLES
3056     /VLABELS VARIABLES=ALL DISPLAY=NAME
3057     /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3058     /SLABELS POSITION=ROW
3059     /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[ROWID, LAYERROWID]
3060     /SLABELS POSITION=ROW
3061     /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[COLID, LAYERCOLID]
3062     /SLABELS POSITION=ROW.
3063 ]])
3064 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=80], [0], [dnl
3065                     Custom Tables
3066 Male
3067 ╭─────────────────────────────┬─────────────┬──────╮
3068 │                             │    QND7A    │ QN64B│
3069 │                             ├──────┬──────┼───┬──┤
3070 │                             │  Yes │  No  │   │  │
3071 │                             ├──────┼──────┤   │  │
3072 │                             │ QN86 │ QN86 │   │  │
3073 │                             ├───┬──┼───┬──┤   │  │
3074 │                             │Yes│No│Yes│No│Yes│No│
3075 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
3076 │QN61 Yes QN57 Yes Table ID   │  1│ 1│  1│ 1│  2│ 2│
3077 │                  Layer ID   │  1│ 1│  1│ 1│  2│ 2│
3078 │                  Subtable ID│  1│ 1│  2│ 2│  3│ 3│
3079 │             ╶───────────────┼───┼──┼───┼──┼───┼──┤
3080 │              No  Table ID   │  1│ 1│  1│ 1│  2│ 2│
3081 │                  Layer ID   │  1│ 1│  1│ 1│  2│ 2│
3082 │                  Subtable ID│  1│ 1│  2│ 2│  3│ 3│
3083 │    ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
3084 │     No  QN57 Yes Table ID   │  1│ 1│  1│ 1│  2│ 2│
3085 │                  Layer ID   │  1│ 1│  1│ 1│  2│ 2│
3086 │                  Subtable ID│  4│ 4│  5│ 5│  6│ 6│
3087 │             ╶───────────────┼───┼──┼───┼──┼───┼──┤
3088 │              No  Table ID   │  1│ 1│  1│ 1│  2│ 2│
3089 │                  Layer ID   │  1│ 1│  1│ 1│  2│ 2│
3090 │                  Subtable ID│  4│ 4│  5│ 5│  6│ 6│
3091 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
3092
3093                     Custom Tables
3094 Female
3095 ╭─────────────────────────────┬─────────────┬──────╮
3096 │                             │    QND7A    │ QN64B│
3097 │                             ├──────┬──────┼───┬──┤
3098 │                             │  Yes │  No  │   │  │
3099 │                             ├──────┼──────┤   │  │
3100 │                             │ QN86 │ QN86 │   │  │
3101 │                             ├───┬──┼───┬──┤   │  │
3102 │                             │Yes│No│Yes│No│Yes│No│
3103 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
3104 │QN61 Yes QN57 Yes Table ID   │  1│ 1│  1│ 1│  2│ 2│
3105 │                  Layer ID   │  3│ 3│  3│ 3│  4│ 4│
3106 │                  Subtable ID│  7│ 7│  8│ 8│  9│ 9│
3107 │             ╶───────────────┼───┼──┼───┼──┼───┼──┤
3108 │              No  Table ID   │  1│ 1│  1│ 1│  2│ 2│
3109 │                  Layer ID   │  3│ 3│  3│ 3│  4│ 4│
3110 │                  Subtable ID│  7│ 7│  8│ 8│  9│ 9│
3111 │    ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
3112 │     No  QN57 Yes Table ID   │  1│ 1│  1│ 1│  2│ 2│
3113 │                  Layer ID   │  3│ 3│  3│ 3│  4│ 4│
3114 │                  Subtable ID│ 10│10│ 11│11│ 12│12│
3115 │             ╶───────────────┼───┼──┼───┼──┼───┼──┤
3116 │              No  Table ID   │  1│ 1│  1│ 1│  2│ 2│
3117 │                  Layer ID   │  3│ 3│  3│ 3│  4│ 4│
3118 │                  Subtable ID│ 10│10│ 11│11│ 12│12│
3119 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
3120
3121                     Custom Tables
3122 Male
3123 ╭──────────────────────────────┬─────────────┬──────╮
3124 │                              │    QND7A    │ QN64B│
3125 │                              ├──────┬──────┼───┬──┤
3126 │                              │  Yes │  No  │   │  │
3127 │                              ├──────┼──────┤   │  │
3128 │                              │ QN86 │ QN86 │   │  │
3129 │                              ├───┬──┼───┬──┤   │  │
3130 │                              │Yes│No│Yes│No│Yes│No│
3131 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
3132 │QN61 Yes QN57 Yes Row ID      │  1│ 1│  2│ 2│  3│ 3│
3133 │                  Layer Row ID│  1│ 1│  1│ 1│  2│ 2│
3134 │             ╶────────────────┼───┼──┼───┼──┼───┼──┤
3135 │              No  Row ID      │  4│ 4│  5│ 5│  6│ 6│
3136 │                  Layer Row ID│  3│ 3│  3│ 3│  4│ 4│
3137 │    ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
3138 │     No  QN57 Yes Row ID      │  7│ 7│  8│ 8│  9│ 9│
3139 │                  Layer Row ID│  5│ 5│  5│ 5│  6│ 6│
3140 │             ╶────────────────┼───┼──┼───┼──┼───┼──┤
3141 │              No  Row ID      │ 10│10│ 11│11│ 12│12│
3142 │                  Layer Row ID│  7│ 7│  7│ 7│  8│ 8│
3143 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
3144
3145                     Custom Tables
3146 Female
3147 ╭──────────────────────────────┬─────────────┬──────╮
3148 │                              │    QND7A    │ QN64B│
3149 │                              ├──────┬──────┼───┬──┤
3150 │                              │  Yes │  No  │   │  │
3151 │                              ├──────┼──────┤   │  │
3152 │                              │ QN86 │ QN86 │   │  │
3153 │                              ├───┬──┼───┬──┤   │  │
3154 │                              │Yes│No│Yes│No│Yes│No│
3155 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
3156 │QN61 Yes QN57 Yes Row ID      │ 13│13│ 14│14│ 15│15│
3157 │                  Layer Row ID│  9│ 9│  9│ 9│ 10│10│
3158 │             ╶────────────────┼───┼──┼───┼──┼───┼──┤
3159 │              No  Row ID      │ 16│16│ 17│17│ 18│18│
3160 │                  Layer Row ID│ 11│11│ 11│11│ 12│12│
3161 │    ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
3162 │     No  QN57 Yes Row ID      │ 19│19│ 20│20│ 21│21│
3163 │                  Layer Row ID│ 13│13│ 13│13│ 14│14│
3164 │             ╶────────────────┼───┼──┼───┼──┼───┼──┤
3165 │              No  Row ID      │ 22│22│ 23│23│ 24│24│
3166 │                  Layer Row ID│ 15│15│ 15│15│ 16│16│
3167 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
3168
3169                       Custom Tables
3170 Male
3171 ╭─────────────────────────────────┬─────────────┬──────╮
3172 │                                 │    QND7A    │ QN64B│
3173 │                                 ├──────┬──────┼───┬──┤
3174 │                                 │  Yes │  No  │   │  │
3175 │                                 ├──────┼──────┤   │  │
3176 │                                 │ QN86 │ QN86 │   │  │
3177 │                                 ├───┬──┼───┬──┤   │  │
3178 │                                 │Yes│No│Yes│No│Yes│No│
3179 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
3180 │QN61 Yes QN57 Yes Column ID      │  1│ 2│  3│ 4│  5│ 6│
3181 │                  Layer Column ID│  1│ 2│  3│ 4│  5│ 6│
3182 │             ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3183 │              No  Column ID      │  1│ 2│  3│ 4│  5│ 6│
3184 │                  Layer Column ID│  1│ 2│  3│ 4│  5│ 6│
3185 │    ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3186 │     No  QN57 Yes Column ID      │  7│ 8│  9│10│ 11│12│
3187 │                  Layer Column ID│  1│ 2│  3│ 4│  5│ 6│
3188 │             ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3189 │              No  Column ID      │  7│ 8│  9│10│ 11│12│
3190 │                  Layer Column ID│  1│ 2│  3│ 4│  5│ 6│
3191 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3192
3193                       Custom Tables
3194 Female
3195 ╭─────────────────────────────────┬─────────────┬──────╮
3196 │                                 │    QND7A    │ QN64B│
3197 │                                 ├──────┬──────┼───┬──┤
3198 │                                 │  Yes │  No  │   │  │
3199 │                                 ├──────┼──────┤   │  │
3200 │                                 │ QN86 │ QN86 │   │  │
3201 │                                 ├───┬──┼───┬──┤   │  │
3202 │                                 │Yes│No│Yes│No│Yes│No│
3203 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
3204 │QN61 Yes QN57 Yes Column ID      │ 13│14│ 15│16│ 17│18│
3205 │                  Layer Column ID│  7│ 8│  9│10│ 11│12│
3206 │             ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3207 │              No  Column ID      │ 13│14│ 15│16│ 17│18│
3208 │                  Layer Column ID│  7│ 8│  9│10│ 11│12│
3209 │    ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3210 │     No  QN57 Yes Column ID      │ 19│20│ 21│22│ 23│24│
3211 │                  Layer Column ID│  7│ 8│  9│10│ 11│12│
3212 │             ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3213 │              No  Column ID      │ 19│20│ 21│22│ 23│24│
3214 │                  Layer Column ID│  7│ 8│  9│10│ 11│12│
3215 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3216 ])
3217 AT_CLEANUP
3218
3219 AT_SETUP([CTABLES area definitions with CLABELS ROWLABELS=OPPOSITE])
3220 AT_KEYWORDS([ROWLABELS OPPOSITE])
3221 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3222 AT_DATA([ctables.sps],
3223 [[GET 'nhtsa.sav'.
3224 CTABLES
3225     /VLABELS VARIABLES=ALL DISPLAY=NAME
3226     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3227     /SLABELS POSITION=ROW
3228     /CLABELS ROWLABELS=OPPOSITE
3229     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3230     /SLABELS POSITION=ROW
3231     /CLABELS ROWLABELS=OPPOSITE
3232     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3233     /SLABELS POSITION=ROW
3234     /CLABELS ROWLABELS=OPPOSITE.
3235 ]])
3236 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3237                                         Custom Tables
3238 Male
3239 ╭──────────────────────────────────┬───────────────────────────────────────────────────────╮
3240 │                                  │                          QN27                         │
3241 │                                  ├───────────────────────────┬───────────────────────────┤
3242 │                                  │            Yes            │             No            │
3243 │                                  ├───────────────────────────┼───────────────────────────┤
3244 │                                  │           QND7A           │           QND7A           │
3245 │                                  ├─────────────┬─────────────┼─────────────┬─────────────┤
3246 │                                  │     Yes     │      No     │     Yes     │      No     │
3247 │                                  ├─────────────┼─────────────┼─────────────┼─────────────┤
3248 │                                  │     QN86    │     QN86    │     QN86    │     QN86    │
3249 │                                  ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3250 │                                  │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3251 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3252 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3253 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3254 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3255 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3256 │                       Subtable ID│  1│ 1│  2│ 2│  3│ 3│  4│ 4│  5│ 5│  6│ 6│  7│ 7│  8│ 8│
3257 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3258 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3259 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3260 │                       Subtable ID│  1│ 1│  2│ 2│  3│ 3│  4│ 4│  5│ 5│  6│ 6│  7│ 7│  8│ 8│
3261 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3262 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3263 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3264 │                       Subtable ID│  9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3265 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3266 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3267 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3268 │                       Subtable ID│  9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3269 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3270
3271                                         Custom Tables
3272 Female
3273 ╭──────────────────────────────────┬───────────────────────────────────────────────────────╮
3274 │                                  │                          QN27                         │
3275 │                                  ├───────────────────────────┬───────────────────────────┤
3276 │                                  │            Yes            │             No            │
3277 │                                  ├───────────────────────────┼───────────────────────────┤
3278 │                                  │           QND7A           │           QND7A           │
3279 │                                  ├─────────────┬─────────────┼─────────────┬─────────────┤
3280 │                                  │     Yes     │      No     │     Yes     │      No     │
3281 │                                  ├─────────────┼─────────────┼─────────────┼─────────────┤
3282 │                                  │     QN86    │     QN86    │     QN86    │     QN86    │
3283 │                                  ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3284 │                                  │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3285 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3286 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3287 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3288 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3289 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3290 │                       Subtable ID│ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3291 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3292 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3293 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3294 │                       Subtable ID│ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3295 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3296 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3297 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3298 │                       Subtable ID│ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3299 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3300 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3301 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3302 │                       Subtable ID│ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3303 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3304
3305                                         Custom Tables
3306 Male
3307 ╭───────────────────────────────────┬───────────────────────────────────────────────────────╮
3308 │                                   │                          QN27                         │
3309 │                                   ├───────────────────────────┬───────────────────────────┤
3310 │                                   │            Yes            │             No            │
3311 │                                   ├───────────────────────────┼───────────────────────────┤
3312 │                                   │           QND7A           │           QND7A           │
3313 │                                   ├─────────────┬─────────────┼─────────────┬─────────────┤
3314 │                                   │     Yes     │      No     │     Yes     │      No     │
3315 │                                   ├─────────────┼─────────────┼─────────────┼─────────────┤
3316 │                                   │     QN86    │     QN86    │     QN86    │     QN86    │
3317 │                                   ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3318 │                                   │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3319 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3320 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3321 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3322 │QN26 Yes QN61 Yes QN57 Row ID      │  1│ 1│  2│ 2│  3│ 3│  4│ 4│  5│ 5│  6│ 6│  7│ 7│  8│ 8│
3323 │                       Layer Row ID│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3324 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3325 │              No  QN57 Row ID      │  9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3326 │                       Layer Row ID│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3327 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3328 │     No  QN61 Yes QN57 Row ID      │ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3329 │                       Layer Row ID│  3│ 3│  3│ 3│  3│ 3│  3│ 3│  3│ 3│  3│ 3│  3│ 3│  3│ 3│
3330 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3331 │              No  QN57 Row ID      │ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3332 │                       Layer Row ID│  4│ 4│  4│ 4│  4│ 4│  4│ 4│  4│ 4│  4│ 4│  4│ 4│  4│ 4│
3333 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3334
3335                                         Custom Tables
3336 Female
3337 ╭───────────────────────────────────┬───────────────────────────────────────────────────────╮
3338 │                                   │                          QN27                         │
3339 │                                   ├───────────────────────────┬───────────────────────────┤
3340 │                                   │            Yes            │             No            │
3341 │                                   ├───────────────────────────┼───────────────────────────┤
3342 │                                   │           QND7A           │           QND7A           │
3343 │                                   ├─────────────┬─────────────┼─────────────┬─────────────┤
3344 │                                   │     Yes     │      No     │     Yes     │      No     │
3345 │                                   ├─────────────┼─────────────┼─────────────┼─────────────┤
3346 │                                   │     QN86    │     QN86    │     QN86    │     QN86    │
3347 │                                   ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3348 │                                   │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3349 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3350 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3351 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3352 │QN26 Yes QN61 Yes QN57 Row ID      │ 33│33│ 34│34│ 35│35│ 36│36│ 37│37│ 38│38│ 39│39│ 40│40│
3353 │                       Layer Row ID│  5│ 5│  5│ 5│  5│ 5│  5│ 5│  5│ 5│  5│ 5│  5│ 5│  5│ 5│
3354 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3355 │              No  QN57 Row ID      │ 41│41│ 42│42│ 43│43│ 44│44│ 45│45│ 46│46│ 47│47│ 48│48│
3356 │                       Layer Row ID│  6│ 6│  6│ 6│  6│ 6│  6│ 6│  6│ 6│  6│ 6│  6│ 6│  6│ 6│
3357 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3358 │     No  QN61 Yes QN57 Row ID      │ 49│49│ 50│50│ 51│51│ 52│52│ 53│53│ 54│54│ 55│55│ 56│56│
3359 │                       Layer Row ID│  7│ 7│  7│ 7│  7│ 7│  7│ 7│  7│ 7│  7│ 7│  7│ 7│  7│ 7│
3360 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3361 │              No  QN57 Row ID      │ 57│57│ 58│58│ 59│59│ 60│60│ 61│61│ 62│62│ 63│63│ 64│64│
3362 │                       Layer Row ID│  8│ 8│  8│ 8│  8│ 8│  8│ 8│  8│ 8│  8│ 8│  8│ 8│  8│ 8│
3363 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3364
3365                                           Custom Tables
3366 Male
3367 ╭──────────────────────────────────────┬───────────────────────────────────────────────────────╮
3368 │                                      │                          QN27                         │
3369 │                                      ├───────────────────────────┬───────────────────────────┤
3370 │                                      │            Yes            │             No            │
3371 │                                      ├───────────────────────────┼───────────────────────────┤
3372 │                                      │           QND7A           │           QND7A           │
3373 │                                      ├─────────────┬─────────────┼─────────────┬─────────────┤
3374 │                                      │     Yes     │      No     │     Yes     │      No     │
3375 │                                      ├─────────────┼─────────────┼─────────────┼─────────────┤
3376 │                                      │     QN86    │     QN86    │     QN86    │     QN86    │
3377 │                                      ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3378 │                                      │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3379 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3380 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3381 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3382 │QN26 Yes QN61 Yes QN57 Column ID      │  2│ 1│  4│ 3│  6│ 5│  7│ 8│ 10│ 9│ 11│12│ 14│13│ 15│16│
3383 │                       Layer Column ID│  2│ 1│  4│ 3│  6│ 5│  7│ 8│ 10│ 9│ 11│12│ 14│13│ 15│16│
3384 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3385 │              No  QN57 Column ID      │  2│ 1│  4│ 3│  6│ 5│  7│ 8│ 10│ 9│ 11│12│ 14│13│ 15│16│
3386 │                       Layer Column ID│  2│ 1│  4│ 3│  6│ 5│  7│ 8│ 10│ 9│ 11│12│ 14│13│ 15│16│
3387 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3388 │     No  QN61 Yes QN57 Column ID      │ 18│17│ 19│20│ 21│22│ 23│24│ 25│26│ 28│27│ 29│30│ 32│31│
3389 │                       Layer Column ID│  2│ 1│  4│ 3│  6│ 5│  7│ 8│ 10│ 9│ 11│12│ 14│13│ 15│16│
3390 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3391 │              No  QN57 Column ID      │ 18│17│ 19│20│ 21│22│ 23│24│ 25│26│ 28│27│ 29│30│ 32│31│
3392 │                       Layer Column ID│  2│ 1│  4│ 3│  6│ 5│  7│ 8│ 10│ 9│ 11│12│ 14│13│ 15│16│
3393 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3394
3395                                           Custom Tables
3396 Female
3397 ╭──────────────────────────────────────┬───────────────────────────────────────────────────────╮
3398 │                                      │                          QN27                         │
3399 │                                      ├───────────────────────────┬───────────────────────────┤
3400 │                                      │            Yes            │             No            │
3401 │                                      ├───────────────────────────┼───────────────────────────┤
3402 │                                      │           QND7A           │           QND7A           │
3403 │                                      ├─────────────┬─────────────┼─────────────┬─────────────┤
3404 │                                      │     Yes     │      No     │     Yes     │      No     │
3405 │                                      ├─────────────┼─────────────┼─────────────┼─────────────┤
3406 │                                      │     QN86    │     QN86    │     QN86    │     QN86    │
3407 │                                      ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3408 │                                      │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3409 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3410 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3411 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3412 │QN26 Yes QN61 Yes QN57 Column ID      │ 34│33│ 35│36│ 37│38│ 39│40│ 41│42│ 44│43│ 45│46│ 47│48│
3413 │                       Layer Column ID│ 18│17│ 19│20│ 21│22│ 23│24│ 25│26│ 28│27│ 29│30│ 31│32│
3414 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3415 │              No  QN57 Column ID      │ 34│33│ 35│36│ 37│38│ 39│40│ 41│42│ 44│43│ 45│46│ 47│48│
3416 │                       Layer Column ID│ 18│17│ 19│20│ 21│22│ 23│24│ 25│26│ 28│27│ 29│30│ 31│32│
3417 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3418 │     No  QN61 Yes QN57 Column ID      │ 50│49│ 51│52│ 53│54│ 55│56│ 57│58│ 59│60│ 62│61│ 64│63│
3419 │                       Layer Column ID│ 18│17│ 19│20│ 21│22│ 23│24│ 25│26│ 28│27│ 29│30│ 31│32│
3420 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3421 │              No  QN57 Column ID      │ 50│49│ 51│52│ 53│54│ 55│56│ 57│58│ 59│60│ 62│61│ 64│63│
3422 │                       Layer Column ID│ 18│17│ 19│20│ 21│22│ 23│24│ 25│26│ 28│27│ 29│30│ 31│32│
3423 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3424 ])
3425 AT_CLEANUP
3426
3427 AT_SETUP([CTABLES area definitions with CLABELS COLLABELS=OPPOSITE])
3428 AT_KEYWORDS([COLLABELS OPPOSITE])
3429 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3430 AT_DATA([ctables.sps],
3431 [[GET 'nhtsa.sav'.
3432 CTABLES
3433     /VLABELS VARIABLES=ALL DISPLAY=NAME
3434     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3435     /SLABELS POSITION=ROW
3436     /CLABELS COLLABELS=OPPOSITE
3437     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3438     /SLABELS POSITION=ROW
3439     /CLABELS COLLABELS=OPPOSITE
3440     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3441     /SLABELS POSITION=ROW
3442     /CLABELS COLLABELS=OPPOSITE.
3443 ]])
3444 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3445                           Custom Tables
3446 Male
3447 ╭──────────────────────────────────────────┬───────────────────╮
3448 │                                          │        QN27       │
3449 │                                          ├─────────┬─────────┤
3450 │                                          │   Yes   │    No   │
3451 │                                          ├─────────┼─────────┤
3452 │                                          │  QND7A  │  QND7A  │
3453 │                                          ├────┬────┼────┬────┤
3454 │                                          │ Yes│ No │ Yes│ No │
3455 │                                          ├────┼────┼────┼────┤
3456 │                                          │QN86│QN86│QN86│QN86│
3457 ├──────────────────────────────────────────┼────┼────┼────┼────┤
3458 │QN26 Yes QN61 Yes QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3459 │                               Layer ID   │   1│   1│   1│   1│
3460 │                               Subtable ID│   1│   1│   2│   2│
3461 │                          ╶───────────────┼────┼────┼────┼────┤
3462 │                           No  Table ID   │   1│   1│   1│   1│
3463 │                               Layer ID   │   1│   1│   1│   1│
3464 │                               Subtable ID│   1│   1│   2│   2│
3465 │                      ╶───────────────────┼────┼────┼────┼────┤
3466 │                       No  Yes Table ID   │   1│   1│   1│   1│
3467 │                               Layer ID   │   1│   1│   1│   1│
3468 │                               Subtable ID│   3│   3│   4│   4│
3469 │                          ╶───────────────┼────┼────┼────┼────┤
3470 │                           No  Table ID   │   1│   1│   1│   1│
3471 │                               Layer ID   │   1│   1│   1│   1│
3472 │                               Subtable ID│   3│   3│   4│   4│
3473 │             ╶────────────────────────────┼────┼────┼────┼────┤
3474 │              No  QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3475 │                               Layer ID   │   1│   1│   1│   1│
3476 │                               Subtable ID│   5│   5│   6│   6│
3477 │                          ╶───────────────┼────┼────┼────┼────┤
3478 │                           No  Table ID   │   1│   1│   1│   1│
3479 │                               Layer ID   │   1│   1│   1│   1│
3480 │                               Subtable ID│   5│   5│   6│   6│
3481 │                      ╶───────────────────┼────┼────┼────┼────┤
3482 │                       No  Yes Table ID   │   1│   1│   1│   1│
3483 │                               Layer ID   │   1│   1│   1│   1│
3484 │                               Subtable ID│   7│   7│   8│   8│
3485 │                          ╶───────────────┼────┼────┼────┼────┤
3486 │                           No  Table ID   │   1│   1│   1│   1│
3487 │                               Layer ID   │   1│   1│   1│   1│
3488 │                               Subtable ID│   7│   7│   8│   8│
3489 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
3490 │     No  QN61 Yes QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3491 │                               Layer ID   │   1│   1│   1│   1│
3492 │                               Subtable ID│   9│   9│  10│  10│
3493 │                          ╶───────────────┼────┼────┼────┼────┤
3494 │                           No  Table ID   │   1│   1│   1│   1│
3495 │                               Layer ID   │   1│   1│   1│   1│
3496 │                               Subtable ID│   9│   9│  10│  10│
3497 │                      ╶───────────────────┼────┼────┼────┼────┤
3498 │                       No  Yes Table ID   │   1│   1│   1│   1│
3499 │                               Layer ID   │   1│   1│   1│   1│
3500 │                               Subtable ID│  11│  11│  12│  12│
3501 │                          ╶───────────────┼────┼────┼────┼────┤
3502 │                           No  Table ID   │   1│   1│   1│   1│
3503 │                               Layer ID   │   1│   1│   1│   1│
3504 │                               Subtable ID│  11│  11│  12│  12│
3505 │             ╶────────────────────────────┼────┼────┼────┼────┤
3506 │              No  QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3507 │                               Layer ID   │   1│   1│   1│   1│
3508 │                               Subtable ID│  13│  13│  14│  14│
3509 │                          ╶───────────────┼────┼────┼────┼────┤
3510 │                           No  Table ID   │   1│   1│   1│   1│
3511 │                               Layer ID   │   1│   1│   1│   1│
3512 │                               Subtable ID│  13│  13│  14│  14│
3513 │                      ╶───────────────────┼────┼────┼────┼────┤
3514 │                       No  Yes Table ID   │   1│   1│   1│   1│
3515 │                               Layer ID   │   1│   1│   1│   1│
3516 │                               Subtable ID│  15│  15│  16│  16│
3517 │                          ╶───────────────┼────┼────┼────┼────┤
3518 │                           No  Table ID   │   1│   1│   1│   1│
3519 │                               Layer ID   │   1│   1│   1│   1│
3520 │                               Subtable ID│  15│  15│  16│  16│
3521 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
3522
3523                           Custom Tables
3524 Female
3525 ╭──────────────────────────────────────────┬───────────────────╮
3526 │                                          │        QN27       │
3527 │                                          ├─────────┬─────────┤
3528 │                                          │   Yes   │    No   │
3529 │                                          ├─────────┼─────────┤
3530 │                                          │  QND7A  │  QND7A  │
3531 │                                          ├────┬────┼────┬────┤
3532 │                                          │ Yes│ No │ Yes│ No │
3533 │                                          ├────┼────┼────┼────┤
3534 │                                          │QN86│QN86│QN86│QN86│
3535 ├──────────────────────────────────────────┼────┼────┼────┼────┤
3536 │QN26 Yes QN61 Yes QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3537 │                               Layer ID   │   2│   2│   2│   2│
3538 │                               Subtable ID│  17│  17│  18│  18│
3539 │                          ╶───────────────┼────┼────┼────┼────┤
3540 │                           No  Table ID   │   1│   1│   1│   1│
3541 │                               Layer ID   │   2│   2│   2│   2│
3542 │                               Subtable ID│  17│  17│  18│  18│
3543 │                      ╶───────────────────┼────┼────┼────┼────┤
3544 │                       No  Yes Table ID   │   1│   1│   1│   1│
3545 │                               Layer ID   │   2│   2│   2│   2│
3546 │                               Subtable ID│  19│  19│  20│  20│
3547 │                          ╶───────────────┼────┼────┼────┼────┤
3548 │                           No  Table ID   │   1│   1│   1│   1│
3549 │                               Layer ID   │   2│   2│   2│   2│
3550 │                               Subtable ID│  19│  19│  20│  20│
3551 │             ╶────────────────────────────┼────┼────┼────┼────┤
3552 │              No  QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3553 │                               Layer ID   │   2│   2│   2│   2│
3554 │                               Subtable ID│  21│  21│  22│  22│
3555 │                          ╶───────────────┼────┼────┼────┼────┤
3556 │                           No  Table ID   │   1│   1│   1│   1│
3557 │                               Layer ID   │   2│   2│   2│   2│
3558 │                               Subtable ID│  21│  21│  22│  22│
3559 │                      ╶───────────────────┼────┼────┼────┼────┤
3560 │                       No  Yes Table ID   │   1│   1│   1│   1│
3561 │                               Layer ID   │   2│   2│   2│   2│
3562 │                               Subtable ID│  23│  23│  24│  24│
3563 │                          ╶───────────────┼────┼────┼────┼────┤
3564 │                           No  Table ID   │   1│   1│   1│   1│
3565 │                               Layer ID   │   2│   2│   2│   2│
3566 │                               Subtable ID│  23│  23│  24│  24│
3567 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
3568 │     No  QN61 Yes QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3569 │                               Layer ID   │   2│   2│   2│   2│
3570 │                               Subtable ID│  25│  25│  26│  26│
3571 │                          ╶───────────────┼────┼────┼────┼────┤
3572 │                           No  Table ID   │   1│   1│   1│   1│
3573 │                               Layer ID   │   2│   2│   2│   2│
3574 │                               Subtable ID│  25│  25│  26│  26│
3575 │                      ╶───────────────────┼────┼────┼────┼────┤
3576 │                       No  Yes Table ID   │   1│   1│   1│   1│
3577 │                               Layer ID   │   2│   2│   2│   2│
3578 │                               Subtable ID│  27│  27│  28│  28│
3579 │                          ╶───────────────┼────┼────┼────┼────┤
3580 │                           No  Table ID   │   1│   1│   1│   1│
3581 │                               Layer ID   │   2│   2│   2│   2│
3582 │                               Subtable ID│  27│  27│  28│  28│
3583 │             ╶────────────────────────────┼────┼────┼────┼────┤
3584 │              No  QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3585 │                               Layer ID   │   2│   2│   2│   2│
3586 │                               Subtable ID│  29│  29│  30│  30│
3587 │                          ╶───────────────┼────┼────┼────┼────┤
3588 │                           No  Table ID   │   1│   1│   1│   1│
3589 │                               Layer ID   │   2│   2│   2│   2│
3590 │                               Subtable ID│  29│  29│  30│  30│
3591 │                      ╶───────────────────┼────┼────┼────┼────┤
3592 │                       No  Yes Table ID   │   1│   1│   1│   1│
3593 │                               Layer ID   │   2│   2│   2│   2│
3594 │                               Subtable ID│  31│  31│  32│  32│
3595 │                          ╶───────────────┼────┼────┼────┼────┤
3596 │                           No  Table ID   │   1│   1│   1│   1│
3597 │                               Layer ID   │   2│   2│   2│   2│
3598 │                               Subtable ID│  31│  31│  32│  32│
3599 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
3600
3601                           Custom Tables
3602 Male
3603 ╭───────────────────────────────────────────┬───────────────────╮
3604 │                                           │        QN27       │
3605 │                                           ├─────────┬─────────┤
3606 │                                           │   Yes   │    No   │
3607 │                                           ├─────────┼─────────┤
3608 │                                           │  QND7A  │  QND7A  │
3609 │                                           ├────┬────┼────┬────┤
3610 │                                           │ Yes│ No │ Yes│ No │
3611 │                                           ├────┼────┼────┼────┤
3612 │                                           │QN86│QN86│QN86│QN86│
3613 ├───────────────────────────────────────────┼────┼────┼────┼────┤
3614 │QN26 Yes QN61 Yes QN57 Yes Yes Row ID      │   2│   2│   3│   3│
3615 │                               Layer Row ID│   2│   2│   2│   2│
3616 │                          ╶────────────────┼────┼────┼────┼────┤
3617 │                           No  Row ID      │   1│   1│   4│   4│
3618 │                               Layer Row ID│   1│   1│   1│   1│
3619 │                      ╶────────────────────┼────┼────┼────┼────┤
3620 │                       No  Yes Row ID      │   5│   5│   7│   7│
3621 │                               Layer Row ID│   3│   3│   3│   3│
3622 │                          ╶────────────────┼────┼────┼────┼────┤
3623 │                           No  Row ID      │   6│   6│   8│   8│
3624 │                               Layer Row ID│   4│   4│   4│   4│
3625 │             ╶─────────────────────────────┼────┼────┼────┼────┤
3626 │              No  QN57 Yes Yes Row ID      │  10│  10│  11│  11│
3627 │                               Layer Row ID│   6│   6│   6│   6│
3628 │                          ╶────────────────┼────┼────┼────┼────┤
3629 │                           No  Row ID      │   9│   9│  12│  12│
3630 │                               Layer Row ID│   5│   5│   5│   5│
3631 │                      ╶────────────────────┼────┼────┼────┼────┤
3632 │                       No  Yes Row ID      │  14│  14│  16│  16│
3633 │                               Layer Row ID│   8│   8│   8│   8│
3634 │                          ╶────────────────┼────┼────┼────┼────┤
3635 │                           No  Row ID      │  13│  13│  15│  15│
3636 │                               Layer Row ID│   7│   7│   7│   7│
3637 │    ╶──────────────────────────────────────┼────┼────┼────┼────┤
3638 │     No  QN61 Yes QN57 Yes Yes Row ID      │  17│  17│  19│  19│
3639 │                               Layer Row ID│   9│   9│   9│   9│
3640 │                          ╶────────────────┼────┼────┼────┼────┤
3641 │                           No  Row ID      │  18│  18│  20│  20│
3642 │                               Layer Row ID│  10│  10│  10│  10│
3643 │                      ╶────────────────────┼────┼────┼────┼────┤
3644 │                       No  Yes Row ID      │  21│  21│  23│  23│
3645 │                               Layer Row ID│  11│  11│  11│  11│
3646 │                          ╶────────────────┼────┼────┼────┼────┤
3647 │                           No  Row ID      │  22│  22│  24│  24│
3648 │                               Layer Row ID│  12│  12│  12│  12│
3649 │             ╶─────────────────────────────┼────┼────┼────┼────┤
3650 │              No  QN57 Yes Yes Row ID      │  26│  26│  28│  28│
3651 │                               Layer Row ID│  14│  14│  14│  14│
3652 │                          ╶────────────────┼────┼────┼────┼────┤
3653 │                           No  Row ID      │  25│  25│  27│  27│
3654 │                               Layer Row ID│  13│  13│  13│  13│
3655 │                      ╶────────────────────┼────┼────┼────┼────┤
3656 │                       No  Yes Row ID      │  30│  30│  32│  32│
3657 │                               Layer Row ID│  16│  16│  16│  16│
3658 │                          ╶────────────────┼────┼────┼────┼────┤
3659 │                           No  Row ID      │  29│  29│  31│  31│
3660 │                               Layer Row ID│  15│  15│  15│  15│
3661 ╰───────────────────────────────────────────┴────┴────┴────┴────╯
3662
3663                           Custom Tables
3664 Female
3665 ╭───────────────────────────────────────────┬───────────────────╮
3666 │                                           │        QN27       │
3667 │                                           ├─────────┬─────────┤
3668 │                                           │   Yes   │    No   │
3669 │                                           ├─────────┼─────────┤
3670 │                                           │  QND7A  │  QND7A  │
3671 │                                           ├────┬────┼────┬────┤
3672 │                                           │ Yes│ No │ Yes│ No │
3673 │                                           ├────┼────┼────┼────┤
3674 │                                           │QN86│QN86│QN86│QN86│
3675 ├───────────────────────────────────────────┼────┼────┼────┼────┤
3676 │QN26 Yes QN61 Yes QN57 Yes Yes Row ID      │  33│  33│  36│  36│
3677 │                               Layer Row ID│  17│  17│  17│  17│
3678 │                          ╶────────────────┼────┼────┼────┼────┤
3679 │                           No  Row ID      │  34│  34│  35│  35│
3680 │                               Layer Row ID│  18│  18│  18│  18│
3681 │                      ╶────────────────────┼────┼────┼────┼────┤
3682 │                       No  Yes Row ID      │  37│  37│  39│  39│
3683 │                               Layer Row ID│  19│  19│  19│  19│
3684 │                          ╶────────────────┼────┼────┼────┼────┤
3685 │                           No  Row ID      │  38│  38│  40│  40│
3686 │                               Layer Row ID│  20│  20│  20│  20│
3687 │             ╶─────────────────────────────┼────┼────┼────┼────┤
3688 │              No  QN57 Yes Yes Row ID      │  41│  41│  44│  44│
3689 │                               Layer Row ID│  21│  21│  21│  21│
3690 │                          ╶────────────────┼────┼────┼────┼────┤
3691 │                           No  Row ID      │  42│  42│  43│  43│
3692 │                               Layer Row ID│  22│  22│  22│  22│
3693 │                      ╶────────────────────┼────┼────┼────┼────┤
3694 │                       No  Yes Row ID      │  45│  45│  48│  48│
3695 │                               Layer Row ID│  23│  23│  23│  23│
3696 │                          ╶────────────────┼────┼────┼────┼────┤
3697 │                           No  Row ID      │  46│  46│  47│  47│
3698 │                               Layer Row ID│  24│  24│  24│  24│
3699 │    ╶──────────────────────────────────────┼────┼────┼────┼────┤
3700 │     No  QN61 Yes QN57 Yes Yes Row ID      │  49│  49│  52│  52│
3701 │                               Layer Row ID│  25│  25│  25│  25│
3702 │                          ╶────────────────┼────┼────┼────┼────┤
3703 │                           No  Row ID      │  50│  50│  51│  51│
3704 │                               Layer Row ID│  26│  26│  26│  26│
3705 │                      ╶────────────────────┼────┼────┼────┼────┤
3706 │                       No  Yes Row ID      │  53│  53│  55│  55│
3707 │                               Layer Row ID│  27│  27│  27│  27│
3708 │                          ╶────────────────┼────┼────┼────┼────┤
3709 │                           No  Row ID      │  54│  54│  56│  56│
3710 │                               Layer Row ID│  28│  28│  28│  28│
3711 │             ╶─────────────────────────────┼────┼────┼────┼────┤
3712 │              No  QN57 Yes Yes Row ID      │  58│  58│  59│  59│
3713 │                               Layer Row ID│  30│  30│  30│  30│
3714 │                          ╶────────────────┼────┼────┼────┼────┤
3715 │                           No  Row ID      │  57│  57│  60│  60│
3716 │                               Layer Row ID│  29│  29│  29│  29│
3717 │                      ╶────────────────────┼────┼────┼────┼────┤
3718 │                       No  Yes Row ID      │  62│  62│  64│  64│
3719 │                               Layer Row ID│  32│  32│  32│  32│
3720 │                          ╶────────────────┼────┼────┼────┼────┤
3721 │                           No  Row ID      │  61│  61│  63│  63│
3722 │                               Layer Row ID│  31│  31│  31│  31│
3723 ╰───────────────────────────────────────────┴────┴────┴────┴────╯
3724
3725                             Custom Tables
3726 Male
3727 ╭──────────────────────────────────────────────┬───────────────────╮
3728 │                                              │        QN27       │
3729 │                                              ├─────────┬─────────┤
3730 │                                              │   Yes   │    No   │
3731 │                                              ├─────────┼─────────┤
3732 │                                              │  QND7A  │  QND7A  │
3733 │                                              ├────┬────┼────┬────┤
3734 │                                              │ Yes│ No │ Yes│ No │
3735 │                                              ├────┼────┼────┼────┤
3736 │                                              │QN86│QN86│QN86│QN86│
3737 ├──────────────────────────────────────────────┼────┼────┼────┼────┤
3738 │QN26 Yes QN61 Yes QN57 Yes Yes Column ID      │   1│   2│   3│   4│
3739 │                               Layer Column ID│   1│   2│   3│   4│
3740 │                          ╶───────────────────┼────┼────┼────┼────┤
3741 │                           No  Column ID      │   1│   2│   3│   4│
3742 │                               Layer Column ID│   1│   2│   3│   4│
3743 │                      ╶───────────────────────┼────┼────┼────┼────┤
3744 │                       No  Yes Column ID      │   5│   6│   7│   8│
3745 │                               Layer Column ID│   1│   2│   3│   4│
3746 │                          ╶───────────────────┼────┼────┼────┼────┤
3747 │                           No  Column ID      │   5│   6│   7│   8│
3748 │                               Layer Column ID│   1│   2│   3│   4│
3749 │             ╶────────────────────────────────┼────┼────┼────┼────┤
3750 │              No  QN57 Yes Yes Column ID      │   9│  10│  11│  12│
3751 │                               Layer Column ID│   1│   2│   3│   4│
3752 │                          ╶───────────────────┼────┼────┼────┼────┤
3753 │                           No  Column ID      │   9│  10│  11│  12│
3754 │                               Layer Column ID│   1│   2│   3│   4│
3755 │                      ╶───────────────────────┼────┼────┼────┼────┤
3756 │                       No  Yes Column ID      │  13│  14│  15│  16│
3757 │                               Layer Column ID│   1│   2│   3│   4│
3758 │                          ╶───────────────────┼────┼────┼────┼────┤
3759 │                           No  Column ID      │  13│  14│  15│  16│
3760 │                               Layer Column ID│   1│   2│   3│   4│
3761 │    ╶─────────────────────────────────────────┼────┼────┼────┼────┤
3762 │     No  QN61 Yes QN57 Yes Yes Column ID      │  17│  18│  19│  20│
3763 │                               Layer Column ID│   1│   2│   3│   4│
3764 │                          ╶───────────────────┼────┼────┼────┼────┤
3765 │                           No  Column ID      │  17│  18│  19│  20│
3766 │                               Layer Column ID│   1│   2│   3│   4│
3767 │                      ╶───────────────────────┼────┼────┼────┼────┤
3768 │                       No  Yes Column ID      │  21│  22│  23│  24│
3769 │                               Layer Column ID│   1│   2│   3│   4│
3770 │                          ╶───────────────────┼────┼────┼────┼────┤
3771 │                           No  Column ID      │  21│  22│  23│  24│
3772 │                               Layer Column ID│   1│   2│   3│   4│
3773 │             ╶────────────────────────────────┼────┼────┼────┼────┤
3774 │              No  QN57 Yes Yes Column ID      │  25│  26│  27│  28│
3775 │                               Layer Column ID│   1│   2│   3│   4│
3776 │                          ╶───────────────────┼────┼────┼────┼────┤
3777 │                           No  Column ID      │  25│  26│  27│  28│
3778 │                               Layer Column ID│   1│   2│   3│   4│
3779 │                      ╶───────────────────────┼────┼────┼────┼────┤
3780 │                       No  Yes Column ID      │  29│  30│  31│  32│
3781 │                               Layer Column ID│   1│   2│   3│   4│
3782 │                          ╶───────────────────┼────┼────┼────┼────┤
3783 │                           No  Column ID      │  29│  30│  31│  32│
3784 │                               Layer Column ID│   1│   2│   3│   4│
3785 ╰──────────────────────────────────────────────┴────┴────┴────┴────╯
3786
3787                             Custom Tables
3788 Female
3789 ╭──────────────────────────────────────────────┬───────────────────╮
3790 │                                              │        QN27       │
3791 │                                              ├─────────┬─────────┤
3792 │                                              │   Yes   │    No   │
3793 │                                              ├─────────┼─────────┤
3794 │                                              │  QND7A  │  QND7A  │
3795 │                                              ├────┬────┼────┬────┤
3796 │                                              │ Yes│ No │ Yes│ No │
3797 │                                              ├────┼────┼────┼────┤
3798 │                                              │QN86│QN86│QN86│QN86│
3799 ├──────────────────────────────────────────────┼────┼────┼────┼────┤
3800 │QN26 Yes QN61 Yes QN57 Yes Yes Column ID      │  33│  34│  35│  36│
3801 │                               Layer Column ID│   5│   6│   7│   8│
3802 │                          ╶───────────────────┼────┼────┼────┼────┤
3803 │                           No  Column ID      │  33│  34│  35│  36│
3804 │                               Layer Column ID│   5│   6│   7│   8│
3805 │                      ╶───────────────────────┼────┼────┼────┼────┤
3806 │                       No  Yes Column ID      │  37│  38│  39│  40│
3807 │                               Layer Column ID│   5│   6│   7│   8│
3808 │                          ╶───────────────────┼────┼────┼────┼────┤
3809 │                           No  Column ID      │  37│  38│  39│  40│
3810 │                               Layer Column ID│   5│   6│   7│   8│
3811 │             ╶────────────────────────────────┼────┼────┼────┼────┤
3812 │              No  QN57 Yes Yes Column ID      │  41│  42│  43│  44│
3813 │                               Layer Column ID│   5│   6│   7│   8│
3814 │                          ╶───────────────────┼────┼────┼────┼────┤
3815 │                           No  Column ID      │  41│  42│  43│  44│
3816 │                               Layer Column ID│   5│   6│   7│   8│
3817 │                      ╶───────────────────────┼────┼────┼────┼────┤
3818 │                       No  Yes Column ID      │  45│  46│  47│  48│
3819 │                               Layer Column ID│   5│   6│   7│   8│
3820 │                          ╶───────────────────┼────┼────┼────┼────┤
3821 │                           No  Column ID      │  45│  46│  47│  48│
3822 │                               Layer Column ID│   5│   6│   7│   8│
3823 │    ╶─────────────────────────────────────────┼────┼────┼────┼────┤
3824 │     No  QN61 Yes QN57 Yes Yes Column ID      │  49│  50│  51│  52│
3825 │                               Layer Column ID│   5│   6│   7│   8│
3826 │                          ╶───────────────────┼────┼────┼────┼────┤
3827 │                           No  Column ID      │  49│  50│  51│  52│
3828 │                               Layer Column ID│   5│   6│   7│   8│
3829 │                      ╶───────────────────────┼────┼────┼────┼────┤
3830 │                       No  Yes Column ID      │  53│  54│  55│  56│
3831 │                               Layer Column ID│   5│   6│   7│   8│
3832 │                          ╶───────────────────┼────┼────┼────┼────┤
3833 │                           No  Column ID      │  53│  54│  55│  56│
3834 │                               Layer Column ID│   5│   6│   7│   8│
3835 │             ╶────────────────────────────────┼────┼────┼────┼────┤
3836 │              No  QN57 Yes Yes Column ID      │  57│  58│  59│  60│
3837 │                               Layer Column ID│   5│   6│   7│   8│
3838 │                          ╶───────────────────┼────┼────┼────┼────┤
3839 │                           No  Column ID      │  57│  58│  59│  60│
3840 │                               Layer Column ID│   5│   6│   7│   8│
3841 │                      ╶───────────────────────┼────┼────┼────┼────┤
3842 │                       No  Yes Column ID      │  61│  62│  63│  64│
3843 │                               Layer Column ID│   5│   6│   7│   8│
3844 │                          ╶───────────────────┼────┼────┼────┼────┤
3845 │                           No  Column ID      │  61│  62│  63│  64│
3846 │                               Layer Column ID│   5│   6│   7│   8│
3847 ╰──────────────────────────────────────────────┴────┴────┴────┴────╯
3848 ])
3849 AT_CLEANUP
3850
3851 AT_SETUP([CTABLES area definitions with CLABELS ROWLABELS=LAYER])
3852 AT_KEYWORDS([ROWLABELS LAYER])
3853 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
3854 AT_DATA([ctables.sps],
3855 [[GET 'nhtsa.sav'.
3856 CTABLES
3857     /VLABELS VARIABLES=ALL DISPLAY=NAME
3858     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3859     /SLABELS POSITION=ROW
3860     /CLABELS ROWLABELS=LAYER
3861     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3862     /SLABELS POSITION=ROW
3863     /CLABELS ROWLABELS=LAYER
3864     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3865     /SLABELS POSITION=ROW
3866     /CLABELS ROWLABELS=LAYER.
3867 ]])
3868 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3869                           Custom Tables
3870 Male
3871 Yes
3872 ╭──────────────────────────────────┬───────────────────────────╮
3873 │                                  │            QN27           │
3874 │                                  ├─────────────┬─────────────┤
3875 │                                  │     Yes     │      No     │
3876 │                                  ├─────────────┼─────────────┤
3877 │                                  │    QND7A    │    QND7A    │
3878 │                                  ├──────┬──────┼──────┬──────┤
3879 │                                  │  Yes │  No  │  Yes │  No  │
3880 │                                  ├──────┼──────┼──────┼──────┤
3881 │                                  │ QN86 │ QN86 │ QN86 │ QN86 │
3882 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┤
3883 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│
3884 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3885 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3886 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3887 │                       Subtable ID│  2│ 2│  3│ 3│  5│ 5│  7│ 7│
3888 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3889 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3890 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3891 │                       Subtable ID│  2│ 2│  3│ 3│  5│ 5│  7│ 7│
3892 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3893 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3894 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3895 │                       Subtable ID│ 10│10│ 12│12│ 13│13│ 16│16│
3896 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3897 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3898 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3899 │                       Subtable ID│ 10│10│ 12│12│ 13│13│ 16│16│
3900 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3901
3902                           Custom Tables
3903 Male
3904 No
3905 ╭──────────────────────────────────┬───────────────────────────╮
3906 │                                  │            QN27           │
3907 │                                  ├─────────────┬─────────────┤
3908 │                                  │     Yes     │      No     │
3909 │                                  ├─────────────┼─────────────┤
3910 │                                  │    QND7A    │    QND7A    │
3911 │                                  ├──────┬──────┼──────┬──────┤
3912 │                                  │  Yes │  No  │  Yes │  No  │
3913 │                                  ├──────┼──────┼──────┼──────┤
3914 │                                  │ QN86 │ QN86 │ QN86 │ QN86 │
3915 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┤
3916 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│
3917 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3918 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3919 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3920 │                       Subtable ID│  1│ 1│  4│ 4│  6│ 6│  8│ 8│
3921 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3922 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3923 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3924 │                       Subtable ID│  1│ 1│  4│ 4│  6│ 6│  8│ 8│
3925 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3926 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3927 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3928 │                       Subtable ID│  9│ 9│ 11│11│ 14│14│ 15│15│
3929 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3930 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3931 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3932 │                       Subtable ID│  9│ 9│ 11│11│ 14│14│ 15│15│
3933 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3934
3935                           Custom Tables
3936 Female
3937 Yes
3938 ╭──────────────────────────────────┬───────────────────────────╮
3939 │                                  │            QN27           │
3940 │                                  ├─────────────┬─────────────┤
3941 │                                  │     Yes     │      No     │
3942 │                                  ├─────────────┼─────────────┤
3943 │                                  │    QND7A    │    QND7A    │
3944 │                                  ├──────┬──────┼──────┬──────┤
3945 │                                  │  Yes │  No  │  Yes │  No  │
3946 │                                  ├──────┼──────┼──────┼──────┤
3947 │                                  │ QN86 │ QN86 │ QN86 │ QN86 │
3948 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┤
3949 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│
3950 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3951 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3952 │                       Layer ID   │  3│ 3│  3│ 3│  3│ 3│  3│ 3│
3953 │                       Subtable ID│ 17│17│ 19│19│ 21│21│ 23│23│
3954 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3955 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3956 │                       Layer ID   │  3│ 3│  3│ 3│  3│ 3│  3│ 3│
3957 │                       Subtable ID│ 17│17│ 19│19│ 21│21│ 23│23│
3958 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3959 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3960 │                       Layer ID   │  3│ 3│  3│ 3│  3│ 3│  3│ 3│
3961 │                       Subtable ID│ 25│25│ 28│28│ 29│29│ 32│32│
3962 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3963 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3964 │                       Layer ID   │  3│ 3│  3│ 3│  3│ 3│  3│ 3│
3965 │                       Subtable ID│ 25│25│ 28│28│ 29│29│ 32│32│
3966 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
3967
3968                           Custom Tables
3969 Female
3970 No
3971 ╭──────────────────────────────────┬───────────────────────────╮
3972 │                                  │            QN27           │
3973 │                                  ├─────────────┬─────────────┤
3974 │                                  │     Yes     │      No     │
3975 │                                  ├─────────────┼─────────────┤
3976 │                                  │    QND7A    │    QND7A    │
3977 │                                  ├──────┬──────┼──────┬──────┤
3978 │                                  │  Yes │  No  │  Yes │  No  │
3979 │                                  ├──────┼──────┼──────┼──────┤
3980 │                                  │ QN86 │ QN86 │ QN86 │ QN86 │
3981 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┤
3982 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│
3983 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3984 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3985 │                       Layer ID   │  4│ 4│  4│ 4│  4│ 4│  4│ 4│
3986 │                       Subtable ID│ 18│18│ 20│20│ 22│22│ 24│24│
3987 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3988 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3989 │                       Layer ID   │  4│ 4│  4│ 4│  4│ 4│  4│ 4│
3990 │                       Subtable ID│ 18│18│ 20│20│ 22│22│ 24│24│
3991 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3992 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3993 │                       Layer ID   │  4│ 4│  4│ 4│  4│ 4│  4│ 4│
3994 │                       Subtable ID│ 26│26│ 27│27│ 30│30│ 31│31│
3995 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
3996 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3997 │                       Layer ID   │  4│ 4│  4│ 4│  4│ 4│  4│ 4│
3998 │                       Subtable ID│ 26│26│ 27│27│ 30│30│ 31│31│
3999 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4000
4001                           Custom Tables
4002 Male
4003 Yes
4004 ╭───────────────────────────────────┬───────────────────────────╮
4005 │                                   │            QN27           │
4006 │                                   ├─────────────┬─────────────┤
4007 │                                   │     Yes     │      No     │
4008 │                                   ├─────────────┼─────────────┤
4009 │                                   │    QND7A    │    QND7A    │
4010 │                                   ├──────┬──────┼──────┬──────┤
4011 │                                   │  Yes │  No  │  Yes │  No  │
4012 │                                   ├──────┼──────┼──────┼──────┤
4013 │                                   │ QN86 │ QN86 │ QN86 │ QN86 │
4014 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┤
4015 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│
4016 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4017 │QN26 Yes QN61 Yes QN57 Row ID      │  1│ 1│  3│ 3│  6│ 6│  8│ 8│
4018 │                       Layer Row ID│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4019 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4020 │              No  QN57 Row ID      │  9│ 9│ 11│11│ 14│14│ 15│15│
4021 │                       Layer Row ID│  3│ 3│  3│ 3│  3│ 3│  3│ 3│
4022 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4023 │     No  QN61 Yes QN57 Row ID      │ 18│18│ 20│20│ 22│22│ 23│23│
4024 │                       Layer Row ID│  6│ 6│  6│ 6│  6│ 6│  6│ 6│
4025 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4026 │              No  QN57 Row ID      │ 26│26│ 28│28│ 29│29│ 32│32│
4027 │                       Layer Row ID│  8│ 8│  8│ 8│  8│ 8│  8│ 8│
4028 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4029
4030                           Custom Tables
4031 Male
4032 No
4033 ╭───────────────────────────────────┬───────────────────────────╮
4034 │                                   │            QN27           │
4035 │                                   ├─────────────┬─────────────┤
4036 │                                   │     Yes     │      No     │
4037 │                                   ├─────────────┼─────────────┤
4038 │                                   │    QND7A    │    QND7A    │
4039 │                                   ├──────┬──────┼──────┬──────┤
4040 │                                   │  Yes │  No  │  Yes │  No  │
4041 │                                   ├──────┼──────┼──────┼──────┤
4042 │                                   │ QN86 │ QN86 │ QN86 │ QN86 │
4043 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┤
4044 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│
4045 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4046 │QN26 Yes QN61 Yes QN57 Row ID      │  2│ 2│  4│ 4│  5│ 5│  7│ 7│
4047 │                       Layer Row ID│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
4048 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4049 │              No  QN57 Row ID      │ 10│10│ 12│12│ 13│13│ 16│16│
4050 │                       Layer Row ID│  4│ 4│  4│ 4│  4│ 4│  4│ 4│
4051 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4052 │     No  QN61 Yes QN57 Row ID      │ 17│17│ 19│19│ 21│21│ 24│24│
4053 │                       Layer Row ID│  5│ 5│  5│ 5│  5│ 5│  5│ 5│
4054 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4055 │              No  QN57 Row ID      │ 25│25│ 27│27│ 30│30│ 31│31│
4056 │                       Layer Row ID│  7│ 7│  7│ 7│  7│ 7│  7│ 7│
4057 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4058
4059                           Custom Tables
4060 Female
4061 Yes
4062 ╭───────────────────────────────────┬───────────────────────────╮
4063 │                                   │            QN27           │
4064 │                                   ├─────────────┬─────────────┤
4065 │                                   │     Yes     │      No     │
4066 │                                   ├─────────────┼─────────────┤
4067 │                                   │    QND7A    │    QND7A    │
4068 │                                   ├──────┬──────┼──────┬──────┤
4069 │                                   │  Yes │  No  │  Yes │  No  │
4070 │                                   ├──────┼──────┼──────┼──────┤
4071 │                                   │ QN86 │ QN86 │ QN86 │ QN86 │
4072 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┤
4073 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│
4074 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4075 │QN26 Yes QN61 Yes QN57 Row ID      │ 33│33│ 36│36│ 38│38│ 40│40│
4076 │                       Layer Row ID│  9│ 9│  9│ 9│  9│ 9│  9│ 9│
4077 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4078 │              No  QN57 Row ID      │ 42│42│ 43│43│ 45│45│ 47│47│
4079 │                       Layer Row ID│ 12│12│ 12│12│ 12│12│ 12│12│
4080 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4081 │     No  QN61 Yes QN57 Row ID      │ 50│50│ 52│52│ 53│53│ 56│56│
4082 │                       Layer Row ID│ 14│14│ 14│14│ 14│14│ 14│14│
4083 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4084 │              No  QN57 Row ID      │ 57│57│ 60│60│ 61│61│ 63│63│
4085 │                       Layer Row ID│ 15│15│ 15│15│ 15│15│ 15│15│
4086 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4087
4088                           Custom Tables
4089 Female
4090 No
4091 ╭───────────────────────────────────┬───────────────────────────╮
4092 │                                   │            QN27           │
4093 │                                   ├─────────────┬─────────────┤
4094 │                                   │     Yes     │      No     │
4095 │                                   ├─────────────┼─────────────┤
4096 │                                   │    QND7A    │    QND7A    │
4097 │                                   ├──────┬──────┼──────┬──────┤
4098 │                                   │  Yes │  No  │  Yes │  No  │
4099 │                                   ├──────┼──────┼──────┼──────┤
4100 │                                   │ QN86 │ QN86 │ QN86 │ QN86 │
4101 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┤
4102 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│
4103 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4104 │QN26 Yes QN61 Yes QN57 Row ID      │ 34│34│ 35│35│ 37│37│ 39│39│
4105 │                       Layer Row ID│ 10│10│ 10│10│ 10│10│ 10│10│
4106 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4107 │              No  QN57 Row ID      │ 41│41│ 44│44│ 46│46│ 48│48│
4108 │                       Layer Row ID│ 11│11│ 11│11│ 11│11│ 11│11│
4109 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4110 │     No  QN61 Yes QN57 Row ID      │ 49│49│ 51│51│ 54│54│ 55│55│
4111 │                       Layer Row ID│ 13│13│ 13│13│ 13│13│ 13│13│
4112 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4113 │              No  QN57 Row ID      │ 58│58│ 59│59│ 62│62│ 64│64│
4114 │                       Layer Row ID│ 16│16│ 16│16│ 16│16│ 16│16│
4115 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4116
4117                             Custom Tables
4118 Male
4119 Yes
4120 ╭──────────────────────────────────────┬───────────────────────────╮
4121 │                                      │            QN27           │
4122 │                                      ├─────────────┬─────────────┤
4123 │                                      │     Yes     │      No     │
4124 │                                      ├─────────────┼─────────────┤
4125 │                                      │    QND7A    │    QND7A    │
4126 │                                      ├──────┬──────┼──────┬──────┤
4127 │                                      │  Yes │  No  │  Yes │  No  │
4128 │                                      ├──────┼──────┼──────┼──────┤
4129 │                                      │ QN86 │ QN86 │ QN86 │ QN86 │
4130 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┤
4131 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│
4132 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4133 │QN26 Yes QN61 Yes QN57 Column ID      │  2│ 4│  6│ 7│ 10│11│ 14│15│
4134 │                       Layer Column ID│  2│ 4│  6│ 7│ 10│11│ 14│15│
4135 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4136 │              No  QN57 Column ID      │  2│ 4│  6│ 7│ 10│11│ 14│15│
4137 │                       Layer Column ID│  2│ 4│  6│ 7│ 10│11│ 14│15│
4138 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4139 │     No  QN61 Yes QN57 Column ID      │ 18│19│ 21│23│ 25│28│ 29│32│
4140 │                       Layer Column ID│  2│ 4│  6│ 7│ 10│11│ 14│15│
4141 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4142 │              No  QN57 Column ID      │ 18│19│ 21│23│ 25│28│ 29│32│
4143 │                       Layer Column ID│  2│ 4│  6│ 7│ 10│11│ 14│15│
4144 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4145
4146                             Custom Tables
4147 Male
4148 No
4149 ╭──────────────────────────────────────┬───────────────────────────╮
4150 │                                      │            QN27           │
4151 │                                      ├─────────────┬─────────────┤
4152 │                                      │     Yes     │      No     │
4153 │                                      ├─────────────┼─────────────┤
4154 │                                      │    QND7A    │    QND7A    │
4155 │                                      ├──────┬──────┼──────┬──────┤
4156 │                                      │  Yes │  No  │  Yes │  No  │
4157 │                                      ├──────┼──────┼──────┼──────┤
4158 │                                      │ QN86 │ QN86 │ QN86 │ QN86 │
4159 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┤
4160 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│
4161 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4162 │QN26 Yes QN61 Yes QN57 Column ID      │  1│ 3│  5│ 8│  9│12│ 13│16│
4163 │                       Layer Column ID│  1│ 3│  5│ 8│  9│12│ 13│16│
4164 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4165 │              No  QN57 Column ID      │  1│ 3│  5│ 8│  9│12│ 13│16│
4166 │                       Layer Column ID│  1│ 3│  5│ 8│  9│12│ 13│16│
4167 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4168 │     No  QN61 Yes QN57 Column ID      │ 17│20│ 22│24│ 26│27│ 30│31│
4169 │                       Layer Column ID│  1│ 3│  5│ 8│  9│12│ 13│16│
4170 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4171 │              No  QN57 Column ID      │ 17│20│ 22│24│ 26│27│ 30│31│
4172 │                       Layer Column ID│  1│ 3│  5│ 8│  9│12│ 13│16│
4173 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4174
4175                             Custom Tables
4176 Female
4177 Yes
4178 ╭──────────────────────────────────────┬───────────────────────────╮
4179 │                                      │            QN27           │
4180 │                                      ├─────────────┬─────────────┤
4181 │                                      │     Yes     │      No     │
4182 │                                      ├─────────────┼─────────────┤
4183 │                                      │    QND7A    │    QND7A    │
4184 │                                      ├──────┬──────┼──────┬──────┤
4185 │                                      │  Yes │  No  │  Yes │  No  │
4186 │                                      ├──────┼──────┼──────┼──────┤
4187 │                                      │ QN86 │ QN86 │ QN86 │ QN86 │
4188 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┤
4189 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│
4190 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4191 │QN26 Yes QN61 Yes QN57 Column ID      │ 34│35│ 37│39│ 41│44│ 45│47│
4192 │                       Layer Column ID│ 18│19│ 21│23│ 25│28│ 29│31│
4193 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4194 │              No  QN57 Column ID      │ 34│35│ 37│39│ 41│44│ 45│47│
4195 │                       Layer Column ID│ 18│19│ 21│23│ 25│28│ 29│31│
4196 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4197 │     No  QN61 Yes QN57 Column ID      │ 50│51│ 53│55│ 57│59│ 62│64│
4198 │                       Layer Column ID│ 18│19│ 21│23│ 25│28│ 29│31│
4199 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4200 │              No  QN57 Column ID      │ 50│51│ 53│55│ 57│59│ 62│64│
4201 │                       Layer Column ID│ 18│19│ 21│23│ 25│28│ 29│31│
4202 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4203
4204                             Custom Tables
4205 Female
4206 No
4207 ╭──────────────────────────────────────┬───────────────────────────╮
4208 │                                      │            QN27           │
4209 │                                      ├─────────────┬─────────────┤
4210 │                                      │     Yes     │      No     │
4211 │                                      ├─────────────┼─────────────┤
4212 │                                      │    QND7A    │    QND7A    │
4213 │                                      ├──────┬──────┼──────┬──────┤
4214 │                                      │  Yes │  No  │  Yes │  No  │
4215 │                                      ├──────┼──────┼──────┼──────┤
4216 │                                      │ QN86 │ QN86 │ QN86 │ QN86 │
4217 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┤
4218 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│
4219 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4220 │QN26 Yes QN61 Yes QN57 Column ID      │ 33│36│ 38│40│ 42│43│ 46│48│
4221 │                       Layer Column ID│ 17│20│ 22│24│ 26│27│ 30│32│
4222 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4223 │              No  QN57 Column ID      │ 33│36│ 38│40│ 42│43│ 46│48│
4224 │                       Layer Column ID│ 17│20│ 22│24│ 26│27│ 30│32│
4225 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4226 │     No  QN61 Yes QN57 Column ID      │ 49│52│ 54│56│ 58│60│ 61│63│
4227 │                       Layer Column ID│ 17│20│ 22│24│ 26│27│ 30│32│
4228 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4229 │              No  QN57 Column ID      │ 49│52│ 54│56│ 58│60│ 61│63│
4230 │                       Layer Column ID│ 17│20│ 22│24│ 26│27│ 30│32│
4231 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4232 ])
4233 AT_CLEANUP
4234
4235 AT_SETUP([CTABLES area definitions with CLABELS COLLABELS=LAYER])
4236 AT_KEYWORDS([COLLABELS LAYER])
4237 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4238 AT_DATA([ctables.sps],
4239 [[GET 'nhtsa.sav'.
4240 CTABLES
4241     /VLABELS VARIABLES=ALL DISPLAY=NAME
4242     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
4243     /SLABELS POSITION=ROW
4244     /CLABELS COLLABELS=LAYER
4245     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
4246     /SLABELS POSITION=ROW
4247     /CLABELS COLLABELS=LAYER
4248     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
4249     /SLABELS POSITION=ROW
4250     /CLABELS COLLABELS=LAYER.
4251 ]])
4252 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
4253                         Custom Tables
4254 Male
4255 Yes
4256 ╭──────────────────────────────────────┬───────────────────╮
4257 │                                      │        QN27       │
4258 │                                      ├─────────┬─────────┤
4259 │                                      │   Yes   │    No   │
4260 │                                      ├─────────┼─────────┤
4261 │                                      │  QND7A  │  QND7A  │
4262 │                                      ├────┬────┼────┬────┤
4263 │                                      │ Yes│ No │ Yes│ No │
4264 │                                      ├────┼────┼────┼────┤
4265 │                                      │QN86│QN86│QN86│QN86│
4266 ├──────────────────────────────────────┼────┼────┼────┼────┤
4267 │QN26 Yes QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4268 │                           Layer ID   │   2│   2│   2│   2│
4269 │                           Subtable ID│   2│   2│   4│   4│
4270 │                      ╶───────────────┼────┼────┼────┼────┤
4271 │                       No  Table ID   │   1│   1│   1│   1│
4272 │                           Layer ID   │   2│   2│   2│   2│
4273 │                           Subtable ID│   2│   2│   4│   4│
4274 │             ╶────────────────────────┼────┼────┼────┼────┤
4275 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4276 │                           Layer ID   │   2│   2│   2│   2│
4277 │                           Subtable ID│   5│   5│   7│   7│
4278 │                      ╶───────────────┼────┼────┼────┼────┤
4279 │                       No  Table ID   │   1│   1│   1│   1│
4280 │                           Layer ID   │   2│   2│   2│   2│
4281 │                           Subtable ID│   5│   5│   7│   7│
4282 │    ╶─────────────────────────────────┼────┼────┼────┼────┤
4283 │     No  QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4284 │                           Layer ID   │   2│   2│   2│   2│
4285 │                           Subtable ID│  10│  10│  12│  12│
4286 │                      ╶───────────────┼────┼────┼────┼────┤
4287 │                       No  Table ID   │   1│   1│   1│   1│
4288 │                           Layer ID   │   2│   2│   2│   2│
4289 │                           Subtable ID│  10│  10│  12│  12│
4290 │             ╶────────────────────────┼────┼────┼────┼────┤
4291 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4292 │                           Layer ID   │   2│   2│   2│   2│
4293 │                           Subtable ID│  13│  13│  15│  15│
4294 │                      ╶───────────────┼────┼────┼────┼────┤
4295 │                       No  Table ID   │   1│   1│   1│   1│
4296 │                           Layer ID   │   2│   2│   2│   2│
4297 │                           Subtable ID│  13│  13│  15│  15│
4298 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4299
4300                         Custom Tables
4301 Male
4302 No
4303 ╭──────────────────────────────────────┬───────────────────╮
4304 │                                      │        QN27       │
4305 │                                      ├─────────┬─────────┤
4306 │                                      │   Yes   │    No   │
4307 │                                      ├─────────┼─────────┤
4308 │                                      │  QND7A  │  QND7A  │
4309 │                                      ├────┬────┼────┬────┤
4310 │                                      │ Yes│ No │ Yes│ No │
4311 │                                      ├────┼────┼────┼────┤
4312 │                                      │QN86│QN86│QN86│QN86│
4313 ├──────────────────────────────────────┼────┼────┼────┼────┤
4314 │QN26 Yes QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4315 │                           Layer ID   │   1│   1│   1│   1│
4316 │                           Subtable ID│   1│   1│   3│   3│
4317 │                      ╶───────────────┼────┼────┼────┼────┤
4318 │                       No  Table ID   │   1│   1│   1│   1│
4319 │                           Layer ID   │   1│   1│   1│   1│
4320 │                           Subtable ID│   1│   1│   3│   3│
4321 │             ╶────────────────────────┼────┼────┼────┼────┤
4322 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4323 │                           Layer ID   │   1│   1│   1│   1│
4324 │                           Subtable ID│   6│   6│   8│   8│
4325 │                      ╶───────────────┼────┼────┼────┼────┤
4326 │                       No  Table ID   │   1│   1│   1│   1│
4327 │                           Layer ID   │   1│   1│   1│   1│
4328 │                           Subtable ID│   6│   6│   8│   8│
4329 │    ╶─────────────────────────────────┼────┼────┼────┼────┤
4330 │     No  QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4331 │                           Layer ID   │   1│   1│   1│   1│
4332 │                           Subtable ID│   9│   9│  11│  11│
4333 │                      ╶───────────────┼────┼────┼────┼────┤
4334 │                       No  Table ID   │   1│   1│   1│   1│
4335 │                           Layer ID   │   1│   1│   1│   1│
4336 │                           Subtable ID│   9│   9│  11│  11│
4337 │             ╶────────────────────────┼────┼────┼────┼────┤
4338 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4339 │                           Layer ID   │   1│   1│   1│   1│
4340 │                           Subtable ID│  14│  14│  16│  16│
4341 │                      ╶───────────────┼────┼────┼────┼────┤
4342 │                       No  Table ID   │   1│   1│   1│   1│
4343 │                           Layer ID   │   1│   1│   1│   1│
4344 │                           Subtable ID│  14│  14│  16│  16│
4345 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4346
4347                         Custom Tables
4348 Female
4349 Yes
4350 ╭──────────────────────────────────────┬───────────────────╮
4351 │                                      │        QN27       │
4352 │                                      ├─────────┬─────────┤
4353 │                                      │   Yes   │    No   │
4354 │                                      ├─────────┼─────────┤
4355 │                                      │  QND7A  │  QND7A  │
4356 │                                      ├────┬────┼────┬────┤
4357 │                                      │ Yes│ No │ Yes│ No │
4358 │                                      ├────┼────┼────┼────┤
4359 │                                      │QN86│QN86│QN86│QN86│
4360 ├──────────────────────────────────────┼────┼────┼────┼────┤
4361 │QN26 Yes QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4362 │                           Layer ID   │   4│   4│   4│   4│
4363 │                           Subtable ID│  18│  18│  19│  19│
4364 │                      ╶───────────────┼────┼────┼────┼────┤
4365 │                       No  Table ID   │   1│   1│   1│   1│
4366 │                           Layer ID   │   4│   4│   4│   4│
4367 │                           Subtable ID│  18│  18│  19│  19│
4368 │             ╶────────────────────────┼────┼────┼────┼────┤
4369 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4370 │                           Layer ID   │   4│   4│   4│   4│
4371 │                           Subtable ID│  22│  22│  23│  23│
4372 │                      ╶───────────────┼────┼────┼────┼────┤
4373 │                       No  Table ID   │   1│   1│   1│   1│
4374 │                           Layer ID   │   4│   4│   4│   4│
4375 │                           Subtable ID│  22│  22│  23│  23│
4376 │    ╶─────────────────────────────────┼────┼────┼────┼────┤
4377 │     No  QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4378 │                           Layer ID   │   4│   4│   4│   4│
4379 │                           Subtable ID│  26│  26│  28│  28│
4380 │                      ╶───────────────┼────┼────┼────┼────┤
4381 │                       No  Table ID   │   1│   1│   1│   1│
4382 │                           Layer ID   │   4│   4│   4│   4│
4383 │                           Subtable ID│  26│  26│  28│  28│
4384 │             ╶────────────────────────┼────┼────┼────┼────┤
4385 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4386 │                           Layer ID   │   4│   4│   4│   4│
4387 │                           Subtable ID│  29│  29│  31│  31│
4388 │                      ╶───────────────┼────┼────┼────┼────┤
4389 │                       No  Table ID   │   1│   1│   1│   1│
4390 │                           Layer ID   │   4│   4│   4│   4│
4391 │                           Subtable ID│  29│  29│  31│  31│
4392 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4393
4394                         Custom Tables
4395 Female
4396 No
4397 ╭──────────────────────────────────────┬───────────────────╮
4398 │                                      │        QN27       │
4399 │                                      ├─────────┬─────────┤
4400 │                                      │   Yes   │    No   │
4401 │                                      ├─────────┼─────────┤
4402 │                                      │  QND7A  │  QND7A  │
4403 │                                      ├────┬────┼────┬────┤
4404 │                                      │ Yes│ No │ Yes│ No │
4405 │                                      ├────┼────┼────┼────┤
4406 │                                      │QN86│QN86│QN86│QN86│
4407 ├──────────────────────────────────────┼────┼────┼────┼────┤
4408 │QN26 Yes QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4409 │                           Layer ID   │   3│   3│   3│   3│
4410 │                           Subtable ID│  17│  17│  20│  20│
4411 │                      ╶───────────────┼────┼────┼────┼────┤
4412 │                       No  Table ID   │   1│   1│   1│   1│
4413 │                           Layer ID   │   3│   3│   3│   3│
4414 │                           Subtable ID│  17│  17│  20│  20│
4415 │             ╶────────────────────────┼────┼────┼────┼────┤
4416 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4417 │                           Layer ID   │   3│   3│   3│   3│
4418 │                           Subtable ID│  21│  21│  24│  24│
4419 │                      ╶───────────────┼────┼────┼────┼────┤
4420 │                       No  Table ID   │   1│   1│   1│   1│
4421 │                           Layer ID   │   3│   3│   3│   3│
4422 │                           Subtable ID│  21│  21│  24│  24│
4423 │    ╶─────────────────────────────────┼────┼────┼────┼────┤
4424 │     No  QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4425 │                           Layer ID   │   3│   3│   3│   3│
4426 │                           Subtable ID│  25│  25│  27│  27│
4427 │                      ╶───────────────┼────┼────┼────┼────┤
4428 │                       No  Table ID   │   1│   1│   1│   1│
4429 │                           Layer ID   │   3│   3│   3│   3│
4430 │                           Subtable ID│  25│  25│  27│  27│
4431 │             ╶────────────────────────┼────┼────┼────┼────┤
4432 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4433 │                           Layer ID   │   3│   3│   3│   3│
4434 │                           Subtable ID│  30│  30│  32│  32│
4435 │                      ╶───────────────┼────┼────┼────┼────┤
4436 │                       No  Table ID   │   1│   1│   1│   1│
4437 │                           Layer ID   │   3│   3│   3│   3│
4438 │                           Subtable ID│  30│  30│  32│  32│
4439 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4440
4441                         Custom Tables
4442 Male
4443 Yes
4444 ╭───────────────────────────────────────┬───────────────────╮
4445 │                                       │        QN27       │
4446 │                                       ├─────────┬─────────┤
4447 │                                       │   Yes   │    No   │
4448 │                                       ├─────────┼─────────┤
4449 │                                       │  QND7A  │  QND7A  │
4450 │                                       ├────┬────┼────┬────┤
4451 │                                       │ Yes│ No │ Yes│ No │
4452 │                                       ├────┼────┼────┼────┤
4453 │                                       │QN86│QN86│QN86│QN86│
4454 ├───────────────────────────────────────┼────┼────┼────┼────┤
4455 │QN26 Yes QN61 Yes QN57 Yes Row ID      │   2│   2│   3│   3│
4456 │                           Layer Row ID│   2│   2│   2│   2│
4457 │                      ╶────────────────┼────┼────┼────┼────┤
4458 │                       No  Row ID      │   5│   5│   7│   7│
4459 │                           Layer Row ID│   3│   3│   3│   3│
4460 │             ╶─────────────────────────┼────┼────┼────┼────┤
4461 │              No  QN57 Yes Row ID      │  10│  10│  11│  11│
4462 │                           Layer Row ID│   6│   6│   6│   6│
4463 │                      ╶────────────────┼────┼────┼────┼────┤
4464 │                       No  Row ID      │  14│  14│  16│  16│
4465 │                           Layer Row ID│   8│   8│   8│   8│
4466 │    ╶──────────────────────────────────┼────┼────┼────┼────┤
4467 │     No  QN61 Yes QN57 Yes Row ID      │  17│  17│  19│  19│
4468 │                           Layer Row ID│   9│   9│   9│   9│
4469 │                      ╶────────────────┼────┼────┼────┼────┤
4470 │                       No  Row ID      │  21│  21│  23│  23│
4471 │                           Layer Row ID│  11│  11│  11│  11│
4472 │             ╶─────────────────────────┼────┼────┼────┼────┤
4473 │              No  QN57 Yes Row ID      │  26│  26│  28│  28│
4474 │                           Layer Row ID│  14│  14│  14│  14│
4475 │                      ╶────────────────┼────┼────┼────┼────┤
4476 │                       No  Row ID      │  30│  30│  32│  32│
4477 │                           Layer Row ID│  16│  16│  16│  16│
4478 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4479
4480                         Custom Tables
4481 Male
4482 No
4483 ╭───────────────────────────────────────┬───────────────────╮
4484 │                                       │        QN27       │
4485 │                                       ├─────────┬─────────┤
4486 │                                       │   Yes   │    No   │
4487 │                                       ├─────────┼─────────┤
4488 │                                       │  QND7A  │  QND7A  │
4489 │                                       ├────┬────┼────┬────┤
4490 │                                       │ Yes│ No │ Yes│ No │
4491 │                                       ├────┼────┼────┼────┤
4492 │                                       │QN86│QN86│QN86│QN86│
4493 ├───────────────────────────────────────┼────┼────┼────┼────┤
4494 │QN26 Yes QN61 Yes QN57 Yes Row ID      │   1│   1│   4│   4│
4495 │                           Layer Row ID│   1│   1│   1│   1│
4496 │                      ╶────────────────┼────┼────┼────┼────┤
4497 │                       No  Row ID      │   6│   6│   8│   8│
4498 │                           Layer Row ID│   4│   4│   4│   4│
4499 │             ╶─────────────────────────┼────┼────┼────┼────┤
4500 │              No  QN57 Yes Row ID      │   9│   9│  12│  12│
4501 │                           Layer Row ID│   5│   5│   5│   5│
4502 │                      ╶────────────────┼────┼────┼────┼────┤
4503 │                       No  Row ID      │  13│  13│  15│  15│
4504 │                           Layer Row ID│   7│   7│   7│   7│
4505 │    ╶──────────────────────────────────┼────┼────┼────┼────┤
4506 │     No  QN61 Yes QN57 Yes Row ID      │  18│  18│  20│  20│
4507 │                           Layer Row ID│  10│  10│  10│  10│
4508 │                      ╶────────────────┼────┼────┼────┼────┤
4509 │                       No  Row ID      │  22│  22│  24│  24│
4510 │                           Layer Row ID│  12│  12│  12│  12│
4511 │             ╶─────────────────────────┼────┼────┼────┼────┤
4512 │              No  QN57 Yes Row ID      │  25│  25│  27│  27│
4513 │                           Layer Row ID│  13│  13│  13│  13│
4514 │                      ╶────────────────┼────┼────┼────┼────┤
4515 │                       No  Row ID      │  29│  29│  31│  31│
4516 │                           Layer Row ID│  15│  15│  15│  15│
4517 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4518
4519                         Custom Tables
4520 Female
4521 Yes
4522 ╭───────────────────────────────────────┬───────────────────╮
4523 │                                       │        QN27       │
4524 │                                       ├─────────┬─────────┤
4525 │                                       │   Yes   │    No   │
4526 │                                       ├─────────┼─────────┤
4527 │                                       │  QND7A  │  QND7A  │
4528 │                                       ├────┬────┼────┬────┤
4529 │                                       │ Yes│ No │ Yes│ No │
4530 │                                       ├────┼────┼────┼────┤
4531 │                                       │QN86│QN86│QN86│QN86│
4532 ├───────────────────────────────────────┼────┼────┼────┼────┤
4533 │QN26 Yes QN61 Yes QN57 Yes Row ID      │  33│  33│  36│  36│
4534 │                           Layer Row ID│  17│  17│  17│  17│
4535 │                      ╶────────────────┼────┼────┼────┼────┤
4536 │                       No  Row ID      │  37│  37│  39│  39│
4537 │                           Layer Row ID│  19│  19│  19│  19│
4538 │             ╶─────────────────────────┼────┼────┼────┼────┤
4539 │              No  QN57 Yes Row ID      │  41│  41│  44│  44│
4540 │                           Layer Row ID│  21│  21│  21│  21│
4541 │                      ╶────────────────┼────┼────┼────┼────┤
4542 │                       No  Row ID      │  45│  45│  48│  48│
4543 │                           Layer Row ID│  23│  23│  23│  23│
4544 │    ╶──────────────────────────────────┼────┼────┼────┼────┤
4545 │     No  QN61 Yes QN57 Yes Row ID      │  49│  49│  52│  52│
4546 │                           Layer Row ID│  25│  25│  25│  25│
4547 │                      ╶────────────────┼────┼────┼────┼────┤
4548 │                       No  Row ID      │  53│  53│  55│  55│
4549 │                           Layer Row ID│  27│  27│  27│  27│
4550 │             ╶─────────────────────────┼────┼────┼────┼────┤
4551 │              No  QN57 Yes Row ID      │  58│  58│  59│  59│
4552 │                           Layer Row ID│  30│  30│  30│  30│
4553 │                      ╶────────────────┼────┼────┼────┼────┤
4554 │                       No  Row ID      │  62│  62│  64│  64│
4555 │                           Layer Row ID│  32│  32│  32│  32│
4556 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4557
4558                         Custom Tables
4559 Female
4560 No
4561 ╭───────────────────────────────────────┬───────────────────╮
4562 │                                       │        QN27       │
4563 │                                       ├─────────┬─────────┤
4564 │                                       │   Yes   │    No   │
4565 │                                       ├─────────┼─────────┤
4566 │                                       │  QND7A  │  QND7A  │
4567 │                                       ├────┬────┼────┬────┤
4568 │                                       │ Yes│ No │ Yes│ No │
4569 │                                       ├────┼────┼────┼────┤
4570 │                                       │QN86│QN86│QN86│QN86│
4571 ├───────────────────────────────────────┼────┼────┼────┼────┤
4572 │QN26 Yes QN61 Yes QN57 Yes Row ID      │  34│  34│  35│  35│
4573 │                           Layer Row ID│  18│  18│  18│  18│
4574 │                      ╶────────────────┼────┼────┼────┼────┤
4575 │                       No  Row ID      │  38│  38│  40│  40│
4576 │                           Layer Row ID│  20│  20│  20│  20│
4577 │             ╶─────────────────────────┼────┼────┼────┼────┤
4578 │              No  QN57 Yes Row ID      │  42│  42│  43│  43│
4579 │                           Layer Row ID│  22│  22│  22│  22│
4580 │                      ╶────────────────┼────┼────┼────┼────┤
4581 │                       No  Row ID      │  46│  46│  47│  47│
4582 │                           Layer Row ID│  24│  24│  24│  24│
4583 │    ╶──────────────────────────────────┼────┼────┼────┼────┤
4584 │     No  QN61 Yes QN57 Yes Row ID      │  50│  50│  51│  51│
4585 │                           Layer Row ID│  26│  26│  26│  26│
4586 │                      ╶────────────────┼────┼────┼────┼────┤
4587 │                       No  Row ID      │  54│  54│  56│  56│
4588 │                           Layer Row ID│  28│  28│  28│  28│
4589 │             ╶─────────────────────────┼────┼────┼────┼────┤
4590 │              No  QN57 Yes Row ID      │  57│  57│  60│  60│
4591 │                           Layer Row ID│  29│  29│  29│  29│
4592 │                      ╶────────────────┼────┼────┼────┼────┤
4593 │                       No  Row ID      │  61│  61│  63│  63│
4594 │                           Layer Row ID│  31│  31│  31│  31│
4595 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4596
4597                           Custom Tables
4598 Male
4599 Yes
4600 ╭──────────────────────────────────────────┬───────────────────╮
4601 │                                          │        QN27       │
4602 │                                          ├─────────┬─────────┤
4603 │                                          │   Yes   │    No   │
4604 │                                          ├─────────┼─────────┤
4605 │                                          │  QND7A  │  QND7A  │
4606 │                                          ├────┬────┼────┬────┤
4607 │                                          │ Yes│ No │ Yes│ No │
4608 │                                          ├────┼────┼────┼────┤
4609 │                                          │QN86│QN86│QN86│QN86│
4610 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4611 │QN26 Yes QN61 Yes QN57 Yes Column ID      │   1│   4│   5│   7│
4612 │                           Layer Column ID│   1│   4│   5│   7│
4613 │                      ╶───────────────────┼────┼────┼────┼────┤
4614 │                       No  Column ID      │   1│   4│   5│   7│
4615 │                           Layer Column ID│   1│   4│   5│   7│
4616 │             ╶────────────────────────────┼────┼────┼────┼────┤
4617 │              No  QN57 Yes Column ID      │   9│  12│  14│  15│
4618 │                           Layer Column ID│   1│   4│   5│   7│
4619 │                      ╶───────────────────┼────┼────┼────┼────┤
4620 │                       No  Column ID      │   9│  12│  14│  15│
4621 │                           Layer Column ID│   1│   4│   5│   7│
4622 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
4623 │     No  QN61 Yes QN57 Yes Column ID      │  18│  20│  22│  24│
4624 │                           Layer Column ID│   1│   4│   5│   7│
4625 │                      ╶───────────────────┼────┼────┼────┼────┤
4626 │                       No  Column ID      │  18│  20│  22│  24│
4627 │                           Layer Column ID│   1│   4│   5│   7│
4628 │             ╶────────────────────────────┼────┼────┼────┼────┤
4629 │              No  QN57 Yes Column ID      │  26│  27│  30│  31│
4630 │                           Layer Column ID│   1│   4│   5│   7│
4631 │                      ╶───────────────────┼────┼────┼────┼────┤
4632 │                       No  Column ID      │  26│  27│  30│  31│
4633 │                           Layer Column ID│   1│   4│   5│   7│
4634 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4635
4636                           Custom Tables
4637 Male
4638 No
4639 ╭──────────────────────────────────────────┬───────────────────╮
4640 │                                          │        QN27       │
4641 │                                          ├─────────┬─────────┤
4642 │                                          │   Yes   │    No   │
4643 │                                          ├─────────┼─────────┤
4644 │                                          │  QND7A  │  QND7A  │
4645 │                                          ├────┬────┼────┬────┤
4646 │                                          │ Yes│ No │ Yes│ No │
4647 │                                          ├────┼────┼────┼────┤
4648 │                                          │QN86│QN86│QN86│QN86│
4649 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4650 │QN26 Yes QN61 Yes QN57 Yes Column ID      │   2│   3│   6│   8│
4651 │                           Layer Column ID│   2│   3│   6│   8│
4652 │                      ╶───────────────────┼────┼────┼────┼────┤
4653 │                       No  Column ID      │   2│   3│   6│   8│
4654 │                           Layer Column ID│   2│   3│   6│   8│
4655 │             ╶────────────────────────────┼────┼────┼────┼────┤
4656 │              No  QN57 Yes Column ID      │  10│  11│  13│  16│
4657 │                           Layer Column ID│   2│   3│   6│   8│
4658 │                      ╶───────────────────┼────┼────┼────┼────┤
4659 │                       No  Column ID      │  10│  11│  13│  16│
4660 │                           Layer Column ID│   2│   3│   6│   8│
4661 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
4662 │     No  QN61 Yes QN57 Yes Column ID      │  17│  19│  21│  23│
4663 │                           Layer Column ID│   2│   3│   6│   8│
4664 │                      ╶───────────────────┼────┼────┼────┼────┤
4665 │                       No  Column ID      │  17│  19│  21│  23│
4666 │                           Layer Column ID│   2│   3│   6│   8│
4667 │             ╶────────────────────────────┼────┼────┼────┼────┤
4668 │              No  QN57 Yes Column ID      │  25│  28│  29│  32│
4669 │                           Layer Column ID│   2│   3│   6│   8│
4670 │                      ╶───────────────────┼────┼────┼────┼────┤
4671 │                       No  Column ID      │  25│  28│  29│  32│
4672 │                           Layer Column ID│   2│   3│   6│   8│
4673 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4674
4675                           Custom Tables
4676 Female
4677 Yes
4678 ╭──────────────────────────────────────────┬───────────────────╮
4679 │                                          │        QN27       │
4680 │                                          ├─────────┬─────────┤
4681 │                                          │   Yes   │    No   │
4682 │                                          ├─────────┼─────────┤
4683 │                                          │  QND7A  │  QND7A  │
4684 │                                          ├────┬────┼────┬────┤
4685 │                                          │ Yes│ No │ Yes│ No │
4686 │                                          ├────┼────┼────┼────┤
4687 │                                          │QN86│QN86│QN86│QN86│
4688 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4689 │QN26 Yes QN61 Yes QN57 Yes Column ID      │  34│  36│  37│  39│
4690 │                           Layer Column ID│  10│  12│  13│  15│
4691 │                      ╶───────────────────┼────┼────┼────┼────┤
4692 │                       No  Column ID      │  34│  36│  37│  39│
4693 │                           Layer Column ID│  10│  12│  13│  15│
4694 │             ╶────────────────────────────┼────┼────┼────┼────┤
4695 │              No  QN57 Yes Column ID      │  41│  43│  46│  48│
4696 │                           Layer Column ID│  10│  12│  13│  15│
4697 │                      ╶───────────────────┼────┼────┼────┼────┤
4698 │                       No  Column ID      │  41│  43│  46│  48│
4699 │                           Layer Column ID│  10│  12│  13│  15│
4700 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
4701 │     No  QN61 Yes QN57 Yes Column ID      │  50│  51│  53│  55│
4702 │                           Layer Column ID│  10│  12│  13│  15│
4703 │                      ╶───────────────────┼────┼────┼────┼────┤
4704 │                       No  Column ID      │  50│  51│  53│  55│
4705 │                           Layer Column ID│  10│  12│  13│  15│
4706 │             ╶────────────────────────────┼────┼────┼────┼────┤
4707 │              No  QN57 Yes Column ID      │  58│  60│  62│  64│
4708 │                           Layer Column ID│  10│  12│  13│  15│
4709 │                      ╶───────────────────┼────┼────┼────┼────┤
4710 │                       No  Column ID      │  58│  60│  62│  64│
4711 │                           Layer Column ID│  10│  12│  13│  15│
4712 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4713
4714                           Custom Tables
4715 Female
4716 No
4717 ╭──────────────────────────────────────────┬───────────────────╮
4718 │                                          │        QN27       │
4719 │                                          ├─────────┬─────────┤
4720 │                                          │   Yes   │    No   │
4721 │                                          ├─────────┼─────────┤
4722 │                                          │  QND7A  │  QND7A  │
4723 │                                          ├────┬────┼────┬────┤
4724 │                                          │ Yes│ No │ Yes│ No │
4725 │                                          ├────┼────┼────┼────┤
4726 │                                          │QN86│QN86│QN86│QN86│
4727 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4728 │QN26 Yes QN61 Yes QN57 Yes Column ID      │  33│  35│  38│  40│
4729 │                           Layer Column ID│   9│  11│  14│  16│
4730 │                      ╶───────────────────┼────┼────┼────┼────┤
4731 │                       No  Column ID      │  33│  35│  38│  40│
4732 │                           Layer Column ID│   9│  11│  14│  16│
4733 │             ╶────────────────────────────┼────┼────┼────┼────┤
4734 │              No  QN57 Yes Column ID      │  42│  44│  45│  47│
4735 │                           Layer Column ID│   9│  11│  14│  16│
4736 │                      ╶───────────────────┼────┼────┼────┼────┤
4737 │                       No  Column ID      │  42│  44│  45│  47│
4738 │                           Layer Column ID│   9│  11│  14│  16│
4739 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
4740 │     No  QN61 Yes QN57 Yes Column ID      │  49│  52│  54│  56│
4741 │                           Layer Column ID│   9│  11│  14│  16│
4742 │                      ╶───────────────────┼────┼────┼────┼────┤
4743 │                       No  Column ID      │  49│  52│  54│  56│
4744 │                           Layer Column ID│   9│  11│  14│  16│
4745 │             ╶────────────────────────────┼────┼────┼────┼────┤
4746 │              No  QN57 Yes Column ID      │  57│  59│  61│  63│
4747 │                           Layer Column ID│   9│  11│  14│  16│
4748 │                      ╶───────────────────┼────┼────┼────┼────┤
4749 │                       No  Column ID      │  57│  59│  61│  63│
4750 │                           Layer Column ID│   9│  11│  14│  16│
4751 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4752 ])
4753 AT_CLEANUP
4754
4755 AT_SETUP([CTABLES categorical summary functions])
4756 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4757 AT_DATA([ctables.sps],
4758 [[GET 'nhtsa.sav'.
4759 CTABLES
4760     /TABLE region BY qnd5a[COUNT, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTAL[COUNT, VALIDN, TOTALN]]
4761     /CATEGORIES VARIABLES=qnd5a TOTAL=YES MISSING=INCLUDE
4762     /SLABELS POSITION=ROW.
4763 ]])
4764 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
4765                                                       Custom Tables
4766 ╭─────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────╮
4767 │                 │                     D5a. What would you say is your primary ethnic background?                     │
4768 │                 ├─────┬───────┬───────┬──────────┬──────────┬─────────┬──────────┬──────────────┬──────┬───────┬─────┤
4769 │                 │     │       │       │          │          │         │          │  Multiple -  │      │       │     │
4770 │                 │     │       │       │   South  │  Central │  Puerto │ Something│ cannot choose│ Don't│       │     │
4771 │                 │Cuban│Mexican│Spanish│ American │ American │Rican, OR│   else   │      one     │ know │Refused│Total│
4772 ├─────────────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4773 │Region NE Count  │    6│      8│      8│        11│         7│       39│        23│             2│     0│      1│  105│
4774 │          Row %  │ 5.7%│   7.6%│   7.6%│     10.5%│      6.7%│    37.1%│     21.9%│          1.9%│   .0%│   1.0%│     │
4775 │          Row    │ 5.8%│   7.7%│   7.7%│     10.6%│      6.7%│    37.5%│     22.1%│          1.9%│   .0%│    .0%│     │
4776 │          Valid N│     │       │       │          │          │         │          │              │      │       │     │
4777 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4778 │          Row    │  .4%│    .6%│    .6%│       .8%│       .5%│     2.8%│      1.6%│           .1%│   .0%│    .1%│     │
4779 │          Total N│     │       │       │          │          │         │          │              │      │       │     │
4780 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4781 │          Valid N│     │       │       │          │          │         │          │              │      │       │  104│
4782 │          Total N│     │       │       │          │          │         │          │              │      │       │ 1409│
4783 │      ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4784 │       MW Count  │    3│     24│      1│         4│         5│        9│         6│             0│     0│      1│   53│
4785 │          Row %  │ 5.7%│  45.3%│   1.9%│      7.5%│      9.4%│    17.0%│     11.3%│           .0%│   .0%│   1.9%│     │
4786 │          Row    │ 5.8%│  46.2%│   1.9%│      7.7%│      9.6%│    17.3%│     11.5%│           .0%│   .0%│    .0%│     │
4787 │          Valid N│     │       │       │          │          │         │          │              │      │       │     │
4788 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4789 │          Row    │  .2%│   1.5%│    .1%│       .2%│       .3%│      .5%│       .4%│           .0%│   .0%│    .1%│     │
4790 │          Total N│     │       │       │          │          │         │          │              │      │       │     │
4791 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4792 │          Valid N│     │       │       │          │          │         │          │              │      │       │   52│
4793 │          Total N│     │       │       │          │          │         │          │              │      │       │ 1654│
4794 │      ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4795 │       S  Count  │   10│    113│     11│        14│        25│       23│        20│             2│     3│      2│  223│
4796 │          Row %  │ 4.5%│  50.7%│   4.9%│      6.3%│     11.2%│    10.3%│      9.0%│           .9%│  1.3%│    .9%│     │
4797 │          Row    │ 4.6%│  51.8%│   5.0%│      6.4%│     11.5%│    10.6%│      9.2%│           .9%│   .0%│    .0%│     │
4798 │          Valid N│     │       │       │          │          │         │          │              │      │       │     │
4799 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4800 │          Row    │  .4%│   4.7%│    .5%│       .6%│      1.0%│     1.0%│       .8%│           .1%│   .1%│    .1%│     │
4801 │          Total N│     │       │       │          │          │         │          │              │      │       │     │
4802 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4803 │          Valid N│     │       │       │          │          │         │          │              │      │       │  218│
4804 │          Total N│     │       │       │          │          │         │          │              │      │       │ 2390│
4805 │      ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
4806 │       W  Count  │    1│    166│     28│         5│        15│        7│        19│             3│     0│      1│  245│
4807 │          Row %  │  .4%│  67.8%│  11.4%│      2.0%│      6.1%│     2.9%│      7.8%│          1.2%│   .0%│    .4%│     │
4808 │          Row    │  .4%│  68.0%│  11.5%│      2.0%│      6.1%│     2.9%│      7.8%│          1.2%│   .0%│    .0%│     │
4809 │          Valid N│     │       │       │          │          │         │          │              │      │       │     │
4810 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4811 │          Row    │  .1%│  10.7%│   1.8%│       .3%│      1.0%│      .5%│      1.2%│           .2%│   .0%│    .1%│     │
4812 │          Total N│     │       │       │          │          │         │          │              │      │       │     │
4813 │          %      │     │       │       │          │          │         │          │              │      │       │     │
4814 │          Valid N│     │       │       │          │          │         │          │              │      │       │  244│
4815 │          Total N│     │       │       │          │          │         │          │              │      │       │ 1546│
4816 ╰─────────────────┴─────┴───────┴───────┴──────────┴──────────┴─────────┴──────────┴──────────────┴──────┴───────┴─────╯
4817 ])
4818 AT_CLEANUP
4819
4820 AT_SETUP([CTABLES scale summary functions])
4821 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
4822 AT_DATA([ctables.sps],
4823 [[GET 'nhtsa.sav'.
4824 SET TVAR=NAME.
4825
4826 * Use SPLIT FILE with FREQUENCIES to generate output equivalent to
4827   CTABLES later, to make the results easier to verify.
4828 SPLIT FILE BY REGION.
4829 FREQUENCIES
4830     qn19a
4831     /STATISTICS=MEAN SEMEAN MEDIAN MODE STDDEV VARIANCE RANGE MINIMUM MAXIMUM SUM
4832     /FORMAT NOTABLE /MISSING=INCLUDE.
4833 SPLIT FILE OFF.
4834
4835 CTABLES
4836     /VLABELS VARIABLE=qn19a DISPLAY=NONE
4837     /TABLE region BY qn19a[VALIDN, MISSING, MEAN, SEMEAN, MEDIAN, MODE, STDDEV, VARIANCE, RANGE, MINIMUM, MAXIMUM, SUM, COUNT, TOTALN, ROWPCT.SUM]
4838     /CATEGORIES VARIABLES=qn19a TOTAL=YES MISSING=INCLUDE
4839     /SLABELS POSITION=ROW
4840     /CLABELS ROWLABELS=OPPOSITE.
4841 ]])
4842 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
4843                    Statistics
4844 ╭─────────┬───────────────────────────────────╮
4845 │         │               REGION              │
4846 │         ├────────┬────────┬────────┬────────┤
4847 │         │   NE   │   MW   │    S   │    W   │
4848 │         ├────────┼────────┼────────┼────────┤
4849 │         │  QN19A │  QN19A │  QN19A │  QN19A │
4850 ├─────────┼────────┼────────┼────────┼────────┤
4851 │N Valid  │     936│    1019│    1276│     950│
4852 │  Missing│     473│     635│    1114│     596│
4853 ├─────────┼────────┼────────┼────────┼────────┤
4854 │Mean     │   19.33│   19.83│   20.29│   19.87│
4855 ├─────────┼────────┼────────┼────────┼────────┤
4856 │S.E. Mean│     .14│     .16│     .18│     .17│
4857 ├─────────┼────────┼────────┼────────┼────────┤
4858 │Median   │   18.00│   19.00│   19.00│   19.00│
4859 ├─────────┼────────┼────────┼────────┼────────┤
4860 │Mode     │   18.00│   18.00│   18.00│   18.00│
4861 ├─────────┼────────┼────────┼────────┼────────┤
4862 │Std Dev  │    4.41│    5.15│    6.44│    5.25│
4863 ├─────────┼────────┼────────┼────────┼────────┤
4864 │Variance │   19.41│   26.47│   41.43│   27.59│
4865 ├─────────┼────────┼────────┼────────┼────────┤
4866 │Range    │   59.00│   71.00│   75.00│   61.00│
4867 ├─────────┼────────┼────────┼────────┼────────┤
4868 │Minimum  │     .00│    4.00│    4.00│    4.00│
4869 ├─────────┼────────┼────────┼────────┼────────┤
4870 │Maximum  │   59.00│   75.00│   79.00│   65.00│
4871 ├─────────┼────────┼────────┼────────┼────────┤
4872 │Sum      │18092.00│20206.00│25886.00│18877.00│
4873 ╰─────────┴────────┴────────┴────────┴────────╯
4874
4875                          Custom Tables
4876 ╭────────────────────────┬────────┬────────┬────────┬────────╮
4877 │                        │   NE   │   MW   │    S   │    W   │
4878 ├────────────────────────┼────────┼────────┼────────┼────────┤
4879 │REGION Valid N          │     936│    1019│    1276│     950│
4880 │       Missing          │  473.00│  635.00│ 1114.00│  596.00│
4881 │       Mean             │   19.33│   19.83│   20.29│   19.87│
4882 │       Std Error of Mean│     .14│     .16│     .18│     .17│
4883 │       Median           │   18.00│   19.00│   19.00│   19.00│
4884 │       Mode             │   18.00│   18.00│   18.00│   18.00│
4885 │       Std Deviation    │    4.41│    5.15│    6.44│    5.25│
4886 │       Variance         │   19.41│   26.47│   41.43│   27.59│
4887 │       Range            │   59.00│   71.00│   75.00│   61.00│
4888 │       Minimum          │     .00│    4.00│    4.00│    4.00│
4889 │       Maximum          │   59.00│   75.00│   79.00│   65.00│
4890 │       Sum              │18092.00│20206.00│25886.00│18877.00│
4891 │       Count            │    1409│    1654│    2390│    1546│
4892 │       Total N          │    1409│    1654│    2390│    1546│
4893 │       Row Sum %        │   21.8%│   24.3%│   31.2%│   22.7%│
4894 ╰────────────────────────┴────────┴────────┴────────┴────────╯
4895 ])
4896 AT_CLEANUP
4897
4898 AT_SETUP([CTABLES scale summary functions - weighting])
4899 weight=1
4900 c=10
4901 for a in 1 2 9; do
4902     for b in 3 4 9; do
4903         for n in 1 2 3 4 5 6 7 8 9 10; do
4904             if test $c -lt 15; then
4905                 cval=.
4906             else
4907                 cval=$c
4908             fi
4909             printf "$weight $a $b $cval\n"
4910             weight=$(expr \( $weight + 3 \) % 7 + 2)
4911             c=$(expr \( $c + 13 \) % 29 + 7)
4912         done
4913     done
4914 done > ctables.txt
4915
4916 AT_DATA([analysis.sps],
4917 [[* Use SPLIT FILE with FREQUENCIES to generate output equivalent to
4918   CTABLES later, to make the results easier to verify.
4919 SPLIT FILE BY a b.
4920 FREQUENCIES
4921     c
4922     /STATISTICS=MEAN SEMEAN MEDIAN MODE STDDEV VARIANCE RANGE MINIMUM MAXIMUM SUM
4923     /FORMAT NOTABLE /MISSING=INCLUDE.
4924 SPLIT FILE OFF.
4925
4926 CTABLES
4927     /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
4928     /SLABELS POSITION=ROW
4929     /CATEGORIES VARIABLES=a b MISSING=INCLUDE.
4930 ]])
4931
4932 AT_DATA([ctables.sps],
4933 [[DATA LIST LIST NOTABLE FILE='ctables.txt'
4934     /w (F5.0) a b c (f2.0).
4935 VAR LEVEL w c (SCALE) a b (NOMINAL).
4936 MISSING VALUES a b (9).
4937
4938 INCLUDE 'analysis.sps'.
4939
4940 WEIGHT BY w.
4941 INCLUDE 'analysis.sps'.
4942
4943 * Same as original analysis using unweighted versions of summaries.
4944 CTABLES
4945     /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
4946     /SLABELS POSITION=ROW
4947     /CATEGORIES VARIABLES=a b MISSING=INCLUDE.
4948 ]])
4949 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
4950                                 Statistics
4951 ╭─────────┬──────────────────────────────────────────────────────────────╮
4952 │         │                               a                              │
4953 │         ├────────────────────┬────────────────────┬────────────────────┤
4954 │         │          1         │          2         │          9         │
4955 │         ├────────────────────┼────────────────────┼────────────────────┤
4956 │         │          b         │          b         │          b         │
4957 │         ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
4958 │         │   3  │   4  │   9  │   3  │   4  │   9  │   3  │   4  │   9  │
4959 │         ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4960 │         │   c  │   c  │   c  │   c  │   c  │   c  │   c  │   c  │   c  │
4961 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4962 │N Valid  │     7│     6│     8│     7│     7│     8│     7│     7│     8│
4963 │  Missing│     3│     4│     2│     3│     3│     2│     3│     3│     2│
4964 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4965 │Mean     │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
4966 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4967 │S.E. Mean│  2.44│  2.14│  2.58│  2.44│  2.18│  2.43│  2.36│  2.18│  2.47│
4968 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4969 │Median   │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
4970 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4971 │Mode     │    16│    18│    15│    16│    18│    15│    16│    18│    15│
4972 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4973 │Std Dev  │  6.47│  5.24│  7.31│  6.47│  5.77│  6.88│  6.24│  5.77│  6.98│
4974 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4975 │Variance │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
4976 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4977 │Range    │ 18.00│ 13.00│ 20.00│ 18.00│ 15.00│ 20.00│ 18.00│ 15.00│ 20.00│
4978 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4979 │Minimum  │    16│    18│    15│    16│    18│    15│    16│    18│    15│
4980 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4981 │Maximum  │    34│    31│    35│    34│    33│    35│    34│    33│    35│
4982 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4983 │Sum      │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
4984 ╰─────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
4985
4986                                     Custom Tables
4987 ╭───────────────────┬──────────────────────────────────────────────────────────────╮
4988 │                   │                               a                              │
4989 │                   ├────────────────────┬────────────────────┬────────────────────┤
4990 │                   │          1         │          2         │          9         │
4991 │                   ├────────────────────┼────────────────────┼────────────────────┤
4992 │                   │          b         │          b         │          b         │
4993 │                   ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
4994 │                   │   3  │   4  │   9  │   3  │   4  │   9  │   3  │   4  │   9  │
4995 ├───────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
4996 │c Valid N          │     7│     6│     8│     7│     7│     8│     7│     7│     8│
4997 │  Missing          │     3│     4│     2│     3│     3│     2│     3│     3│     2│
4998 │  Mean             │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
4999 │  Std Error of Mean│  2.44│  2.14│  2.58│  2.44│  2.18│  2.43│  2.36│  2.18│  2.47│
5000 │  Median           │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
5001 │  Mode             │    16│    18│    15│    16│    18│    15│    16│    18│    15│
5002 │  Std Deviation    │  6.47│  5.24│  7.31│  6.47│  5.77│  6.88│  6.24│  5.77│  6.98│
5003 │  Variance         │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
5004 │  Range            │ 18.00│ 13.00│ 20.00│ 18.00│ 15.00│ 20.00│ 18.00│ 15.00│ 20.00│
5005 │  Minimum          │    16│    18│    15│    16│    18│    15│    16│    18│    15│
5006 │  Maximum          │    34│    31│    35│    34│    33│    35│    34│    33│    35│
5007 │  Sum              │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
5008 │  Count            │    10│    10│    10│    10│    10│    10│    10│    10│    10│
5009 │  Total N          │    10│    10│    10│    10│    10│    10│    10│    10│    10│
5010 │  Layer Row Sum %  │ 11.1%│  9.0%│ 12.1%│ 11.1%│ 11.1%│ 11.9%│ 10.9%│ 10.9%│ 11.7%│
5011 ╰───────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
5012
5013                                   Statistics
5014 ╭─────────┬─────────────────────────────────────────────────────────────────╮
5015 │         │                                a                                │
5016 │         ├─────────────────────┬─────────────────────┬─────────────────────┤
5017 │         │          1          │          2          │          9          │
5018 │         ├─────────────────────┼─────────────────────┼─────────────────────┤
5019 │         │          b          │          b          │          b          │
5020 │         ├───────┬──────┬──────┼──────┬───────┬──────┼──────┬──────┬───────┤
5021 │         │   3   │   4  │   9  │   3  │   4   │   9  │   3  │   4  │   9   │
5022 │         ├───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5023 │         │   c   │   c  │   c  │   c  │   c   │   c  │   c  │   c  │   c   │
5024 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5025 │N Valid  │     40│    35│    41│    26│     38│    40│    34│    32│     39│
5026 │  Missing│      6│    14│    11│    22│     13│     7│    16│    21│     10│
5027 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5028 │Mean     │  27.23│ 24.20│ 22.63│ 27.96│  27.21│ 23.48│ 23.71│ 25.47│  26.03│
5029 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5030 │S.E. Mean│    .93│   .75│  1.03│  1.12│    .84│   .87│  1.01│  1.05│   1.01│
5031 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5032 │Median   │  30.00│ 22.00│ 19.00│ 30.00│  29.00│ 24.00│ 23.00│ 24.00│  28.00│
5033 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5034 │Mode     │     34│    29│    19│    34│     33│    28│    23│    18│     30│
5035 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5036 │Std Dev  │   5.89│  4.42│  6.59│  5.69│   5.16│  5.50│  5.87│  5.94│   6.30│
5037 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5038 │Variance │  34.64│ 19.52│ 43.39│ 32.36│  26.66│ 30.20│ 34.46│ 35.29│  39.71│
5039 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5040 │Range    │  18.00│ 13.00│ 20.00│ 18.00│  15.00│ 20.00│ 18.00│ 15.00│  20.00│
5041 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5042 │Minimum  │     16│    18│    15│    16│     18│    15│    16│    18│     15│
5043 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5044 │Maximum  │     34│    31│    35│    34│     33│    35│    34│    33│     35│
5045 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5046 │Sum      │1089.00│847.00│928.00│727.00│1034.00│939.00│806.00│815.00│1015.00│
5047 ╰─────────┴───────┴──────┴──────┴──────┴───────┴──────┴──────┴──────┴───────╯
5048
5049                                      Custom Tables
5050 ╭───────────────────┬─────────────────────────────────────────────────────────────────╮
5051 │                   │                                a                                │
5052 │                   ├─────────────────────┬─────────────────────┬─────────────────────┤
5053 │                   │          1          │          2          │          9          │
5054 │                   ├─────────────────────┼─────────────────────┼─────────────────────┤
5055 │                   │          b          │          b          │          b          │
5056 │                   ├───────┬──────┬──────┼──────┬───────┬──────┼──────┬──────┬───────┤
5057 │                   │   3   │   4  │   9  │   3  │   4   │   9  │   3  │   4  │   9   │
5058 ├───────────────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5059 │c Valid N          │     40│    35│    41│    26│     38│    40│    34│    32│     39│
5060 │  Missing          │      6│    14│    11│    22│     13│     7│    16│    21│     10│
5061 │  Mean             │  27.22│ 24.20│ 22.63│ 27.96│  27.21│ 23.48│ 23.71│ 25.47│  26.03│
5062 │  Std Error of Mean│    .93│   .75│  1.03│  1.12│    .84│   .87│  1.01│  1.05│   1.01│
5063 │  Median           │  30.00│ 22.00│ 19.00│ 30.00│  29.00│ 24.00│ 23.00│ 24.00│  28.00│
5064 │  Mode             │     34│    29│    19│    34│     33│    28│    23│    18│     30│
5065 │  Std Deviation    │   5.89│  4.42│  6.59│  5.69│   5.16│  5.50│  5.87│  5.94│   6.30│
5066 │  Variance         │  34.64│ 19.52│ 43.39│ 32.36│  26.66│ 30.20│ 34.46│ 35.29│  39.71│
5067 │  Range            │  18.00│ 13.00│ 20.00│ 18.00│  15.00│ 20.00│ 18.00│ 15.00│  20.00│
5068 │  Minimum          │     16│    18│    15│    16│     18│    15│    16│    18│     15│
5069 │  Maximum          │     34│    31│    35│    34│     33│    35│    34│    33│     35│
5070 │  Sum              │1089.00│847.00│928.00│727.00│1034.00│939.00│806.00│815.00│1015.00│
5071 │  Count            │     46│    49│    52│    48│     51│    47│    50│    53│     49│
5072 │  Total N          │     46│    49│    52│    48│     51│    47│    50│    53│     49│
5073 │  Layer Row Sum %  │  13.3%│ 10.3%│ 11.3%│  8.9%│  12.6%│ 11.5%│  9.8%│  9.9%│  12.4%│
5074 ╰───────────────────┴───────┴──────┴──────┴──────┴───────┴──────┴──────┴──────┴───────╯
5075
5076                                          Custom Tables
5077 ╭──────────────────────────────┬──────────────────────────────────────────────────────────────╮
5078 │                              │                               a                              │
5079 │                              ├────────────────────┬────────────────────┬────────────────────┤
5080 │                              │          1         │          2         │          9         │
5081 │                              ├────────────────────┼────────────────────┼────────────────────┤
5082 │                              │          b         │          b         │          b         │
5083 │                              ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
5084 │                              │   3  │   4  │   9  │   3  │   4  │   9  │   3  │   4  │   9  │
5085 ├──────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5086 │c Unweighted Valid N          │     7│     6│     8│     7│     7│     8│     7│     7│     8│
5087 │  Unweighted Missing          │     3│     4│     2│     3│     3│     2│     3│     3│     2│
5088 │  Unweighted Mean             │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
5089 │  Unweighted Std Error of Mean│  2.44│  2.14│  2.58│  2.44│  2.18│  2.43│  2.36│  2.18│  2.47│
5090 │  Unweighted Median           │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
5091 │  Unweighted Mode             │    16│    18│    15│    16│    18│    15│    16│    18│    15│
5092 │  Unweighted Std Deviation    │  6.47│  5.24│  7.31│  6.47│  5.77│  6.88│  6.24│  5.77│  6.98│
5093 │  Unweighted Variance         │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
5094 │  Unweighted Sum              │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
5095 │  Unweighted Count            │    10│    10│    10│    10│    10│    10│    10│    10│    10│
5096 │  Unweighted Total N          │    10│    10│    10│    10│    10│    10│    10│    10│    10│
5097 │  Unweighted Layer Row Sum %  │ 11.1%│  9.0%│ 12.1%│ 11.1%│ 11.1%│ 11.9%│ 10.9%│ 10.9%│ 11.7%│
5098 ╰──────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
5099 ])
5100 AT_CLEANUP
5101
5102 AT_SETUP([CTABLES hidden scale VLABELS])
5103 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
5104 AT_DATA([ctables.sps],
5105 [[GET 'nhtsa.sav'.
5106 CTABLES
5107     /TABLE region BY qn19a + qn35
5108     /SLABELS POSITION=ROW.
5109 CTABLES
5110     /VLABELS VARIABLE=qn19a DISPLAY=NONE
5111     /TABLE region BY qn19a + qn35
5112     /SLABELS POSITION=ROW.
5113 CTABLES
5114     /VLABELS VARIABLE=qn35 DISPLAY=NONE
5115     /TABLE region BY qn19a + qn35
5116     /SLABELS POSITION=ROW.
5117
5118 * This one in particular caused a crash because no categories were
5119   created on the column axis, so passing in 0 for the index was still
5120   too big for that number of categories.  It was fixed by creating a
5121   name-only category for each variable despite the "NONE" request,
5122   then hiding the entire dimension's labels if all its labels were
5123   set to "NONE".
5124 CTABLES
5125     /VLABELS VARIABLE=qn19a qn35 DISPLAY=NONE
5126     /TABLE region BY qn19a + qn35
5127     /SLABELS POSITION=ROW.
5128 ]])
5129 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
5130                                  Custom Tables
5131 ╭──────────────┬────────────────────────────┬─────────────────────────────────╮
5132 │              │ 19a. About how old were you│ 35. In the past thirty days, how│
5133 │              │   when you first starting  │   many times have you driven a  │
5134 │              │    drinking alcohol, not   │  motor vehicle WITHIN TWO HOURS │
5135 │              │  counting small tastes or  │     AFTER drinking alcoholic    │
5136 │              │      sips of alcohol.      │            beverages?           │
5137 ├──────────────┼────────────────────────────┼─────────────────────────────────┤
5138 │Region NE Mean│                       19.33│                                2│
5139 │      ╶───────┼────────────────────────────┼─────────────────────────────────┤
5140 │       MW Mean│                       19.83│                                2│
5141 │      ╶───────┼────────────────────────────┼─────────────────────────────────┤
5142 │       S  Mean│                       20.29│                                2│
5143 │      ╶───────┼────────────────────────────┼─────────────────────────────────┤
5144 │       W  Mean│                       19.87│                                2│
5145 ╰──────────────┴────────────────────────────┴─────────────────────────────────╯
5146
5147                                  Custom Tables
5148 ╭──────────────┬─────┬────────────────────────────────────────────────────────╮
5149 │              │     │  35. In the past thirty days, how many times have you  │
5150 │              │     │ driven a motor vehicle WITHIN TWO HOURS AFTER drinking │
5151 │              │QN19A│                  alcoholic beverages?                  │
5152 ├──────────────┼─────┼────────────────────────────────────────────────────────┤
5153 │Region NE Mean│19.33│                                                       2│
5154 │      ╶───────┼─────┼────────────────────────────────────────────────────────┤
5155 │       MW Mean│19.83│                                                       2│
5156 │      ╶───────┼─────┼────────────────────────────────────────────────────────┤
5157 │       S  Mean│20.29│                                                       2│
5158 │      ╶───────┼─────┼────────────────────────────────────────────────────────┤
5159 │       W  Mean│19.87│                                                       2│
5160 ╰──────────────┴─────┴────────────────────────────────────────────────────────╯
5161
5162                                  Custom Tables
5163 ╭──────────────┬─────────────────────────────────────────────────────────┬────╮
5164 │              │   19a. About how old were you when you first starting   │    │
5165 │              │  drinking alcohol, not counting small tastes or sips of │    │
5166 │              │                         alcohol.                        │qn35│
5167 ├──────────────┼─────────────────────────────────────────────────────────┼────┤
5168 │Region NE Mean│                                                    19.33│   2│
5169 │      ╶───────┼─────────────────────────────────────────────────────────┼────┤
5170 │       MW Mean│                                                    19.83│   2│
5171 │      ╶───────┼─────────────────────────────────────────────────────────┼────┤
5172 │       S  Mean│                                                    20.29│   2│
5173 │      ╶───────┼─────────────────────────────────────────────────────────┼────┤
5174 │       W  Mean│                                                    19.87│   2│
5175 ╰──────────────┴─────────────────────────────────────────────────────────┴────╯
5176
5177       Custom Tables
5178 ╭──────────────┬───────╮
5179 │Region NE Mean│19.33 2│
5180 │      ╶───────┼───────┤
5181 │       MW Mean│19.83 2│
5182 │      ╶───────┼───────┤
5183 │       S  Mean│20.29 2│
5184 │      ╶───────┼───────┤
5185 │       W  Mean│19.87 2│
5186 ╰──────────────┴───────╯
5187 ])
5188 AT_CLEANUP
5189
5190 AT_SETUP([CTABLES with SPLIT FILE])
5191 AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
5192 AT_DATA([ctables.sps],
5193 [[GET 'nhtsa.sav'.
5194
5195 SORT CASES BY qns3a.
5196
5197 CTABLES /TABLE qn105ba.
5198
5199 * Layered split has no effect on output.
5200 SPLIT FILE BY qns3a.
5201 CTABLES /TABLE qn105ba.
5202
5203 * Add column variable qns3a to compare against separate splits.
5204 CTABLES /TABLE qn105ba BY qns3a.
5205
5206 * Separate splits are truly output separately.
5207 SPLIT FILE SEPARATE BY qns3a.
5208 CTABLES /TABLE qn105ba.
5209 ]])
5210 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
5211                                   Custom Tables
5212 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5213 │                                                                        │Count│
5214 ├────────────────────────────────────────────────────────────────────────┼─────┤
5215 │105b. How likely is it that drivers who have had too much   Almost      │  700│
5216 │to drink to drive safely will A. Get stopped by the police? certain     │     │
5217 │                                                            Very likely │ 1502│
5218 │                                                            Somewhat    │ 2763│
5219 │                                                            likely      │     │
5220 │                                                            Somewhat    │ 1307│
5221 │                                                            unlikely    │     │
5222 │                                                            Very        │  609│
5223 │                                                            unlikely    │     │
5224 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5225
5226                                   Custom Tables
5227 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5228 │                                                                        │Count│
5229 ├────────────────────────────────────────────────────────────────────────┼─────┤
5230 │105b. How likely is it that drivers who have had too much   Almost      │  700│
5231 │to drink to drive safely will A. Get stopped by the police? certain     │     │
5232 │                                                            Very likely │ 1502│
5233 │                                                            Somewhat    │ 2763│
5234 │                                                            likely      │     │
5235 │                                                            Somewhat    │ 1307│
5236 │                                                            unlikely    │     │
5237 │                                                            Very        │  609│
5238 │                                                            unlikely    │     │
5239 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5240
5241                                   Custom Tables
5242 ╭─────────────────────────────────────────────────────────────────┬────────────╮
5243 │                                                                 │S3a. GENDER:│
5244 │                                                                 ├─────┬──────┤
5245 │                                                                 │ Male│Female│
5246 │                                                                 ├─────┼──────┤
5247 │                                                                 │Count│ Count│
5248 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
5249 │105b. How likely is it that drivers who have had too Almost      │  297│   403│
5250 │much to drink to drive safely will A. Get stopped by certain     │     │      │
5251 │the police?                                          Very likely │  660│   842│
5252 │                                                     Somewhat    │ 1174│  1589│
5253 │                                                     likely      │     │      │
5254 │                                                     Somewhat    │  640│   667│
5255 │                                                     unlikely    │     │      │
5256 │                                                     Very        │  311│   298│
5257 │                                                     unlikely    │     │      │
5258 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
5259
5260     Split Values
5261 ╭────────────┬─────╮
5262 │Variable    │Value│
5263 ├────────────┼─────┤
5264 │S3a. GENDER:│Male │
5265 ╰────────────┴─────╯
5266
5267                                   Custom Tables
5268 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5269 │                                                                        │Count│
5270 ├────────────────────────────────────────────────────────────────────────┼─────┤
5271 │105b. How likely is it that drivers who have had too much   Almost      │  297│
5272 │to drink to drive safely will A. Get stopped by the police? certain     │     │
5273 │                                                            Very likely │  660│
5274 │                                                            Somewhat    │ 1174│
5275 │                                                            likely      │     │
5276 │                                                            Somewhat    │  640│
5277 │                                                            unlikely    │     │
5278 │                                                            Very        │  311│
5279 │                                                            unlikely    │     │
5280 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5281
5282      Split Values
5283 ╭────────────┬──────╮
5284 │Variable    │ Value│
5285 ├────────────┼──────┤
5286 │S3a. GENDER:│Female│
5287 ╰────────────┴──────╯
5288
5289                                   Custom Tables
5290 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5291 │                                                                        │Count│
5292 ├────────────────────────────────────────────────────────────────────────┼─────┤
5293 │105b. How likely is it that drivers who have had too much   Almost      │  403│
5294 │to drink to drive safely will A. Get stopped by the police? certain     │     │
5295 │                                                            Very likely │  842│
5296 │                                                            Somewhat    │ 1589│
5297 │                                                            likely      │     │
5298 │                                                            Somewhat    │  667│
5299 │                                                            unlikely    │     │
5300 │                                                            Very        │  298│
5301 │                                                            unlikely    │     │
5302 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5303 ])
5304 AT_CLEANUP
5305
5306 AT_SETUP([CTABLES variable level inference])
5307 AT_DATA([data.txt], [dnl
5308 dnl n1 has 10 unique small values -> nominal.
5309 dnl n2 has 23 unique small values -> nominal.
5310 dnl n3 is all missing -> nominal.
5311 dnl s1 has 24 unique small values -> scale.
5312 dnl s2 has one negative value -> scale.
5313 dnl s3 has one non-integer value -> scale.
5314 dnl s4 has no valid values less than 10 -> scale.
5315 dnl s5 has no valid values less than 10,000 -> scale.
5316 1  1  . 1  1  1    10 10001
5317 2  2  . 2  2  2    11 10002
5318 3  3  . 3  3  3    12 10003
5319 4  4  . 4  4  4    13 10004
5320 5  5  . 5  5  5    14 10005
5321 6  6  . 6  6  6    15 10006
5322 7  7  . 7  7  7    16 10007
5323 8  8  . 8  8  8    17 10008
5324 9  9  . 9  9  9    18 10009
5325 10 10 . 10 10 10.5 19 110000
5326 1  11 . 11 -1 1    11 10001
5327 2  12 . 12 2  2    12 10002
5328 3  13 . 13 3  3    13 10003
5329 4  14 . 14 4  4    14 10004
5330 5  15 . 15 5  5    15 10005
5331 6  16 . 16 6  6    16 10006
5332 7  17 . 17 7  7    17 10007
5333 8  18 . 18 8  8    18 10008
5334 9  19 . 19 9  9    19 10009
5335 1  20 . 20 1  1    20 10001
5336 2  21 . 21 2  2    21 10002
5337 3  22 . 22 3  3    22 10003
5338 4  23 . 23 4  4    23 10004
5339 5  23 . 24 5  5    24 10005
5340 6  23 . 24 6  6    25 10006
5341 ])
5342
5343 AT_DATA([ctables.sps], [dnl
5344 DATA LIST LIST file='data.txt' NOTABLE /n1 to n3 s1 to s5.
5345
5346 * Nominal formats (copied from data that will default to scale).
5347 COMPUTE n4=s1.
5348 COMPUTE n5=s1.
5349 FORMATS n4(WKDAY5) n5(MONTH5).
5350
5351 * Scale formats (copied from data that will default to nominal).
5352 COMPUTE s6=n1.
5353 COMPUTE s7=n1.
5354 COMPUTE s8=n1.
5355 FORMATS s6(DOLLAR6.2) s7(CCA8.2) s8(DATETIME17).
5356
5357 STRING string(A8).
5358
5359 DISPLAY DICTIONARY.
5360 CTABLES /TABLE n1 + n2 + n3 + string + s1 + s2 + s3 + s4 + s5.
5361 DISPLAY DICTIONARY.
5362 ])
5363
5364 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
5365                                     Variables
5366 ╭──────┬────────┬──────────────┬─────┬─────┬─────────┬────────────┬────────────╮
5367 │      │        │  Measurement │     │     │         │            │            │
5368 │Name  │Position│     Level    │ Role│Width│Alignment│Print Format│Write Format│
5369 ├──────┼────────┼──────────────┼─────┼─────┼─────────┼────────────┼────────────┤
5370 │n1    │       1│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5371 │n2    │       2│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5372 │n3    │       3│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5373 │s1    │       4│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5374 │s2    │       5│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5375 │s3    │       6│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5376 │s4    │       7│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5377 │s5    │       8│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5378 │n4    │       9│Unknown       │Input│    8│Right    │WKDAY5      │WKDAY5      │
5379 │n5    │      10│Unknown       │Input│    8│Right    │MONTH5      │MONTH5      │
5380 │s6    │      11│Unknown       │Input│    8│Right    │DOLLAR6.2   │DOLLAR6.2   │
5381 │s7    │      12│Unknown       │Input│    8│Right    │CCA8.2      │CCA8.2      │
5382 │s8    │      13│Unknown       │Input│    8│Right    │DATETIME17.0│DATETIME17.0│
5383 │string│      14│Nominal       │Input│    8│Left     │A8          │A8          │
5384 ╰──────┴────────┴──────────────┴─────┴─────┴─────────┴────────────┴────────────╯
5385
5386         Custom Tables
5387 ╭────────────┬─────┬────────╮
5388 │            │Count│  Mean  │
5389 ├────────────┼─────┼────────┤
5390 │n1     1.00 │    3│        │
5391 │       2.00 │    3│        │
5392 │       3.00 │    3│        │
5393 │       4.00 │    3│        │
5394 │       5.00 │    3│        │
5395 │       6.00 │    3│        │
5396 │       7.00 │    2│        │
5397 │       8.00 │    2│        │
5398 │       9.00 │    2│        │
5399 │       10.00│    1│        │
5400 ├────────────┼─────┼────────┤
5401 │n2     1.00 │    1│        │
5402 │       2.00 │    1│        │
5403 │       3.00 │    1│        │
5404 │       4.00 │    1│        │
5405 │       5.00 │    1│        │
5406 │       6.00 │    1│        │
5407 │       7.00 │    1│        │
5408 │       8.00 │    1│        │
5409 │       9.00 │    1│        │
5410 │       10.00│    1│        │
5411 │       11.00│    1│        │
5412 │       12.00│    1│        │
5413 │       13.00│    1│        │
5414 │       14.00│    1│        │
5415 │       15.00│    1│        │
5416 │       16.00│    1│        │
5417 │       17.00│    1│        │
5418 │       18.00│    1│        │
5419 │       19.00│    1│        │
5420 │       20.00│    1│        │
5421 │       21.00│    1│        │
5422 │       22.00│    1│        │
5423 │       23.00│    3│        │
5424 ├────────────┼─────┼────────┤
5425 │string      │   25│        │
5426 ├────────────┼─────┼────────┤
5427 │s1          │     │   12.96│
5428 ├────────────┼─────┼────────┤
5429 │s2          │     │    4.76│
5430 ├────────────┼─────┼────────┤
5431 │s3          │     │    4.86│
5432 ├────────────┼─────┼────────┤
5433 │s4          │     │   16.60│
5434 ├────────────┼─────┼────────┤
5435 │s5          │     │14004.44│
5436 ╰────────────┴─────┴────────╯
5437
5438                                     Variables
5439 ╭──────┬────────┬──────────────┬─────┬─────┬─────────┬────────────┬────────────╮
5440 │      │        │  Measurement │     │     │         │            │            │
5441 │Name  │Position│     Level    │ Role│Width│Alignment│Print Format│Write Format│
5442 ├──────┼────────┼──────────────┼─────┼─────┼─────────┼────────────┼────────────┤
5443 │n1    │       1│Nominal       │Input│    8│Right    │F8.2        │F8.2        │
5444 │n2    │       2│Nominal       │Input│    8│Right    │F8.2        │F8.2        │
5445 │n3    │       3│Nominal       │Input│    8│Right    │F8.2        │F8.2        │
5446 │s1    │       4│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5447 │s2    │       5│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5448 │s3    │       6│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5449 │s4    │       7│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5450 │s5    │       8│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5451 │n4    │       9│Nominal       │Input│    8│Right    │WKDAY5      │WKDAY5      │
5452 │n5    │      10│Nominal       │Input│    8│Right    │MONTH5      │MONTH5      │
5453 │s6    │      11│Scale         │Input│    8│Right    │DOLLAR6.2   │DOLLAR6.2   │
5454 │s7    │      12│Scale         │Input│    8│Right    │CCA8.2      │CCA8.2      │
5455 │s8    │      13│Scale         │Input│    8│Right    │DATETIME17.0│DATETIME17.0│
5456 │string│      14│Nominal       │Input│    8│Left     │A8          │A8          │
5457 ╰──────┴────────┴──────────────┴─────┴─────┴─────────┴────────────┴────────────╯
5458 ])
5459 AT_CLEANUP