57f854ec6337d7c23401934b5aee7fdad0ce178f
[pspp] / tests / language / stats / ctables.at
1 AT_BANNER([CTABLES])
2
3 dnl Known bugs:
4 dnl TOTAL interaction with PCOMPUTE, e.g. the following
5 dnl CTABLES
6 dnl     /PCOMPUTE &all_drivers=EXPR([1 THRU 2] + [3 THRU 4])
7 dnl     /PPROPERTIES &all_drivers LABEL='All Drivers'
8 dnl     /PCOMPUTE &pct_not_drivers=EXPR([5] / ([1 THRU 2] + [3 THRU 4] + [5]) * 100)
9 dnl     /PPROPERTIES &pct_not_drivers LABEL='% Not Drivers' FORMAT=COUNT PCT40.1
10 dnl     /TABLE=qn1 BY qns3a
11 dnl     /CATEGORIES VARIABLES=qns3a TOTAL=YES
12 dnl     /CATEGORIES VARIABLES=qn1 [1 THRU 2, SUBTOTAL='Frequent Drivers',
13 dnl                                3 THRU 4, SUBTOTAL='Infrequent Drivers',
14 dnl                                &all_drivers, 5, &pct_not_drivers,
15 dnl                                MISSING, SUBTOTAL='Not Drivers or Missing'].
16 dnl yields gaps in the Total column:
17 dnl ╭─────────────────────────────────────────────────────────────────────────┬──────────────────╮
18 dnl │                                                                         │   S3a. GENDER:   │
19 dnl │                                                                         ├─────┬──────┬─────┤
20 dnl │                                                                         │ Male│Female│Total│
21 dnl │                                                                         ├─────┼──────┼─────┤
22 dnl │                                                                         │Count│ Count│Count│
23 dnl ├─────────────────────────────────────────────────────────────────────────┼─────┼──────┼─────┤
24 dnl │ 1. How often do you usually drive a car or other   Every day            │ 2305│  2362│ 4667│
25 dnl │motor vehicle?                                      Several days a week  │  440│   834│ 1274│
26 dnl │                                                    Frequent Drivers     │ 2745│  3196│     │
27 dnl │                                                    Once a week or less  │  125│   236│  361│
28 dnl │                                                    Only certain times a │   58│    72│  130│
29 dnl │                                                    year                 │     │      │     │
30 dnl │                                                    Infrequent Drivers   │  183│   308│     │
31 dnl │                                                    All Drivers          │ 2928│  3504│     │
32 dnl │                                                    Never                │  192│   348│  540│
33 dnl │                                                    % Not Drivers        │ 6.2%│  9.0%│     │
34 dnl │                                                    Don't know           │    3│     5│    8│
35 dnl │                                                    Refused              │    9│    10│   19│
36 dnl │                                                    Not Drivers or       │  204│   363│     │
37 dnl │                                                    Missing              │     │      │     │
38 dnl ╰─────────────────────────────────────────────────────────────────────────┴─────┴──────┴─────╯
39 dnl Features not yet implemented:
40 dnl - Multiple response sets
41 dnl - MRSETS subcommand.
42 dnl - CATEGORIES: Special case for explicit category specifications and multiple dichotomy sets.
43 dnl - SIGTEST
44 dnl - COMPARETEST
45 dnl - Summary functions:
46 dnl   * .LCL and .UCL suffixes.
47 dnl   * .SE suffixes.
48 dnl - CATEGORIES:
49 dnl   * Data-dependent sorting.
50
51 AT_SETUP([CTABLES parsing])
52 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
53 AT_DATA([ctables.sps],
54 [[GET 'nhtsa.sav'.
55 CTABLES
56     /FORMAT MINCOLWIDTH=10 MAXCOLWIDTH=20 UNITS=POINTS EMPTY=ZERO MISSING="x"
57     /FORMAT MINCOLWIDTH=DEFAULT MAXCOLWIDTH=DEFAULT UNITS=INCHES EMPTY=BLANK MISSING="."
58     /FORMAT UNITS=CM EMPTY="(-)"
59     /VLABELS VARIABLES=qn1 DISPLAY=DEFAULT
60     /VLABELS VARIABLES=qn17 DISPLAY=NAME
61     /VLABELS VARIABLES=qns3a DISPLAY=LABEL
62     /VLABELS VARIABLES=qnd1 DISPLAY=BOTH
63     /VLABELS VARIABLES=qn20 DISPLAY=NONE
64     /MRSETS COUNTDUPLICATES=NO
65     /MRSETS COUNTDUPLICATES=YES
66     /SMISSING VARIABLE
67     /SMISSING LISTWISE
68     /WEIGHT VARIABLE=qns3a
69     /HIDESMALLCOUNTS
70     /HIDESMALLCOUNTS COUNT=10
71     /TABLE qnsa1
72     /SLABELS POSITION=COLUMN VISIBLE=YES
73     /SLABELS VISIBLE=NO POSITION=ROW
74     /SLABELS POSITION=LAYER
75     /CLABELS AUTO
76     /CLABELS ROWLABELS=OPPOSITE
77     /CRITERIA CILEVEL=50
78     /CATEGORIES VARIABLES=qn1 qn17
79                 ORDER=A KEY=VALUE MISSING=INCLUDE TOTAL=YES LABEL="xyzzy"
80                 POSITION=BEFORE EMPTY=INCLUDE.
81 CTABLES /TABLE qnsa1 /CLABELS ROWLABELS=LAYER.
82 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=OPPOSITE.
83 CTABLES /TABLE qnsa1 /CLABELS COLLABELS=LAYER.
84 ]])
85 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
86          Custom Tables
87 Count
88 ╭───────────────────┬────┬────╮
89 │                   │ RDD│CELL│
90 ├───────────────────┼────┼────┤
91 │Sa1. SAMPLE SOURCE:│5392│1607│
92 ╰───────────────────┴────┴────╯
93
94        Custom Tables
95 RDD
96 ╭───────────────────┬─────╮
97 │                   │Count│
98 ├───────────────────┼─────┤
99 │Sa1. SAMPLE SOURCE:│ 5392│
100 ╰───────────────────┴─────╯
101
102           Custom Tables
103 ╭────────────────────────┬─────╮
104 │                        │Count│
105 ├────────────────────────┼─────┤
106 │Sa1. SAMPLE SOURCE: RDD │ 5392│
107 │                    CELL│ 1607│
108 ╰────────────────────────┴─────╯
109
110           Custom Tables
111 ╭────────────────────────┬─────╮
112 │                        │Count│
113 ├────────────────────────┼─────┤
114 │Sa1. SAMPLE SOURCE: RDD │ 5392│
115 │                    CELL│ 1607│
116 ╰────────────────────────┴─────╯
117 ])
118 AT_CLEANUP
119
120 AT_SETUP([CTABLES parsing - negative])
121 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
122 AT_DATA([ctables.sps],
123 [[GET 'nhtsa.sav'.
124 CTABLES.
125 CTABLES /FORMAT MINCOLWIDTH='foo'.
126 CTABLES /TABLE qn1 [**].
127 CTABLES /TABLE qn1 [NOTAFUNCTION].
128 CTABLES /TABLE (qn1.
129 CTABLES /TABLE **.
130 CTABLES /TABLE NOTAVAR.
131 STRING string(A8).
132 CTABLES /TABLE string[S].
133 CTABLES /TABLE qn1 [PTILE 101].
134 CTABLES /TABLE qn1 [MEAN F0.1].
135 CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
136 CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
137 CTABLES /TABLE qn1 [MEAN TOTALS].
138 CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
139 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
140 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
141 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
142 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
143 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
144 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
145 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
146 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
147 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
148 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
149 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
150 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
151 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
152 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
153 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
154 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
155 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
156 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
157 CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
158 CTABLES /PCOMPUTE &k=EXPR([LO **]).
159 CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
160 CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
161 CTABLES /PCOMPUTE &k=EXPR([1**]).
162 CTABLES /PCOMPUTE &k=EXPR((1x)).
163 CTABLES /PCOMPUTE **k.
164 CTABLES /PCOMPUTE &1.
165 CTABLES /PCOMPUTE &k**.
166 CTABLES /PCOMPUTE &k=**.
167 CTABLES /PCOMPUTE &k=EXPR**.
168 CTABLES /PCOMPUTE &k=EXPR(1x).
169 CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
170 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
171 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
172 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
173 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
174 CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
175 CTABLES /FORMAT EMPTY=**.
176 CTABLES /FORMAT MISSING=**.
177 CTABLES /FORMAT **.
178 CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
179 CTABLES /VLABELS **.
180 CTABLES /VLABELS VARIABLES=NOTAVAR.
181 CTABLES /VLABELS VARIABLES=qn1 **.
182 CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
183 CTABLES /MRSETS **.
184 CTABLES /MRSETS COUNTDUPLICATES=**.
185 CTABLES /SMISSING **.
186 CTABLES /WEIGHT **.
187 CTABLES /WEIGHT VARIABLE=NOTAVAR.
188 CTABLES /HIDESMALLCOUNTS COUNT=1.
189 CTABLES /QUUX.
190 CTABLES /HIDESMALLCOUNTS COUNT=2.
191 CTABLES /TABLE qn1**.
192 CTABLES /TABLE qn1 /SLABELS POSITION=**.
193 CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
194 CTABLES /TABLE qn1 /SLABELS **.
195 CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
196 CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
197 CTABLES /TABLE qn1 /CLABELS **.
198 CTABLES /TABLE qn1 /CRITERIA **.
199 CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
200 CTABLES /TABLE qn1 /TITLES **.
201 CTABLES /TABLE qn1 /SIGTEST TYPE=**.
202 CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
203 CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
204 CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
205 CTABLES /TABLE qn1 /SIGTEST **.
206 CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
207 CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
208 CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
209 CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
210 CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
211 CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
212 CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
213 CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
214 CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
215 CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
216 CTABLES /TABLE qn1 /COMPARETEST **.
217 CTABLES /TABLE qn1 /FORMAT.
218 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS COLLABELS=OPPOSITE.
219 CTABLES /TABLE qn20 > qnd1.
220 CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
221 NUMERIC datetime (DATETIME17.0).
222 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
223 ]])
224 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [1],
225 [[ctables.sps:2.8: error: CTABLES: Syntax error expecting `/'.
226     2 | CTABLES.
227       |        ^
228
229 ctables.sps:3.29-3.33: error: CTABLES: Syntax error expecting non-negative
230 number for MINCOLWIDTH.
231     3 | CTABLES /FORMAT MINCOLWIDTH='foo'.
232       |                             ^~~~~
233
234 ctables.sps:4.21-4.22: error: CTABLES: Syntax error expecting identifier.
235     4 | CTABLES /TABLE qn1 [**].
236       |                     ^~
237
238 ctables.sps:5.21-5.32: error: CTABLES: Syntax error expecting summary function
239 name.
240     5 | CTABLES /TABLE qn1 [NOTAFUNCTION].
241       |                     ^~~~~~~~~~~~
242
243 ctables.sps:6.20: error: CTABLES: Syntax error expecting `@:}@'.
244     6 | CTABLES /TABLE @{:@qn1.
245       |                    ^
246
247 ctables.sps:7.16-7.17: error: CTABLES: Syntax error expecting identifier.
248     7 | CTABLES /TABLE **.
249       |                ^~
250
251 ctables.sps:8.16-8.22: error: CTABLES: NOTAVAR is not a variable name.
252     8 | CTABLES /TABLE NOTAVAR.
253       |                ^~~~~~~
254
255 ctables.sps:10.16-10.24: error: CTABLES: Cannot use string variable string as a
256 scale variable.
257    10 | CTABLES /TABLE string[S].
258       |                ^~~~~~~~~
259
260 ctables.sps:11.27-11.29: error: CTABLES: Syntax error expecting number between 0
261 and 100 for PTILE.
262    11 | CTABLES /TABLE qn1 [PTILE 101].
263       |                           ^~~
264
265 ctables.sps:12.26-12.29: error: CTABLES: Output format F0.1 specifies width 0,
266 but F requires a width between 1 and 40.
267    12 | CTABLES /TABLE qn1 [MEAN F0.1].
268       |                          ^~~~
269
270 ctables.sps:13.26-13.36: error: CTABLES: Output format NEGPAREN requires width 2
271 or greater.
272    13 | CTABLES /TABLE qn1 [MEAN NEGPAREN1.2].
273       |                          ^~~~~~~~~~~
274
275 ctables.sps:14.26-14.36: error: CTABLES: Output format NEGPAREN requires width
276 greater than decimals.
277    14 | CTABLES /TABLE qn1 [MEAN NEGPAREN3.4].
278       |                          ^~~~~~~~~~~
279
280 ctables.sps:15.21-15.24: error: CTABLES: Summary function MEAN applies only to
281 scale variables.
282    15 | CTABLES /TABLE qn1 [MEAN TOTALS].
283       |                     ^~~~
284
285 ctables.sps:15.16-15.18: note: CTABLES: 'QN1' is not a scale variable.
286    15 | CTABLES /TABLE qn1 [MEAN TOTALS].
287       |                ^~~
288
289 ctables.sps:15.32: error: CTABLES: Syntax error expecting `@<:@'.
290    15 | CTABLES /TABLE qn1 [MEAN TOTALS].
291       |                                ^
292
293 ctables.sps:16.21-16.24: error: CTABLES: Summary function MEAN applies only to
294 scale variables.
295    16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
296       |                     ^~~~
297
298 ctables.sps:16.16-16.18: note: CTABLES: 'QN1' is not a scale variable.
299    16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
300       |                ^~~
301
302 ctables.sps:16.40: error: CTABLES: Syntax error expecting `@:>@'.
303    16 | CTABLES /TABLE qn1 [MEAN TOTALS[STDDEV]%].
304       |                                        ^
305
306 ctables.sps:17.56: error: CTABLES: Syntax error expecting string.
307    17 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [SUBTOTAL=x].
308       |                                                        ^
309
310 ctables.sps:18.50-18.51: error: CTABLES: Syntax error expecting THRU.
311    18 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO **].
312       |                                                  ^~
313
314 ctables.sps:19.55: error: CTABLES: Syntax error expecting number.
315    19 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [LO THRU x].
316       |                                                       ^
317
318 ctables.sps:20.54-20.55: error: CTABLES: Syntax error expecting number.
319    20 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1 THRU **].
320       |                                                      ^~
321
322 ctables.sps:21.56-21.57: error: CTABLES: Syntax error expecting string.
323    21 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['x' THRU **].
324       |                                                        ^~
325
326 ctables.sps:22.48-22.49: error: CTABLES: Syntax error expecting identifier.
327    22 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&**].
328       |                                                ^~
329
330 ctables.sps:23.47-23.48: error: CTABLES: Unknown postcompute &x.
331    23 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&x].
332       |                                               ^~
333
334 ctables.sps:24.61-24.63: error: CTABLES: Syntax error expecting number between 0
335 and 100 for PTILE.
336    24 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 101).
337       |                                                             ^~~
338
339 ctables.sps:25.58: error: CTABLES: Syntax error expecting `@:}@'.
340    25 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1.
341       |                                                          ^
342
343 ctables.sps:26.54: error: CTABLES: Syntax error expecting `@{:@'.
344    26 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=MEAN.
345       |                                                      ^
346
347 ctables.sps:27.54-27.55: error: CTABLES: Syntax error expecting INCLUDE or
348 EXCLUDE.
349    27 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=**.
350       |                                                      ^~
351
352 ctables.sps:28.52-28.53: error: CTABLES: Syntax error expecting YES or NO.
353    28 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 TOTAL=**.
354       |                                                    ^~
355
356 ctables.sps:29.52-29.53: error: CTABLES: Syntax error expecting string.
357    29 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 LABEL=**.
358       |                                                    ^~
359
360 ctables.sps:30.55-30.56: error: CTABLES: Syntax error expecting BEFORE or AFTER.
361    30 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 POSITION=**.
362       |                                                       ^~
363
364 ctables.sps:31.52-31.53: error: CTABLES: Syntax error expecting INCLUDE or
365 EXCLUDE.
366    31 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 EMPTY=**.
367       |                                                    ^~
368
369 ctables.sps:32.46-32.47: error: CTABLES: Syntax error expecting ORDER, KEY,
370 MISSING, TOTAL, LABEL, POSITION, or EMPTY.
371    32 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 **.
372       |                                              ^~
373
374 ctables.sps:33.54-33.55: error: CTABLES: Syntax error expecting TOTAL, LABEL,
375 POSITION, or EMPTY.
376    33 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1,2,3] **.
377       |                                                      ^~
378
379 ctables.sps:34.36: error: CTABLES: Syntax error expecting positive integer for
380 SUBTOTAL.
381    34 | CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[0]).
382       |                                    ^
383
384 ctables.sps:35.37-35.38: error: CTABLES: Syntax error expecting `@:>@'.
385    35 | CTABLES /PCOMPUTE &k=EXPR(SUBTOTAL[1**]).
386       |                                     ^~
387
388 ctables.sps:36.31-36.32: error: CTABLES: Syntax error expecting THRU.
389    36 | CTABLES /PCOMPUTE &k=EXPR([LO **]).
390       |                               ^~
391
392 ctables.sps:37.36-37.37: error: CTABLES: Syntax error expecting number.
393    37 | CTABLES /PCOMPUTE &k=EXPR([LO THRU **]).
394       |                                    ^~
395
396 ctables.sps:38.35-38.36: error: CTABLES: Syntax error expecting number.
397    38 | CTABLES /PCOMPUTE &k=EXPR([1 THRU **]).
398       |                                   ^~
399
400 ctables.sps:39.29-39.30: error: CTABLES: Syntax error expecting `@:>@'.
401    39 | CTABLES /PCOMPUTE &k=EXPR([1**]).
402       |                             ^~
403
404 ctables.sps:40.29: error: CTABLES: Syntax error expecting `@:}@'.
405    40 | CTABLES /PCOMPUTE &k=EXPR((1x)).
406       |                             ^
407
408 ctables.sps:41.19-41.20: error: CTABLES: Syntax error expecting &.
409    41 | CTABLES /PCOMPUTE **k.
410       |                   ^~
411
412 ctables.sps:42.20: error: CTABLES: Syntax error expecting identifier.
413    42 | CTABLES /PCOMPUTE &1.
414       |                    ^
415
416 ctables.sps:43.21-43.22: error: CTABLES: Syntax error expecting `=EXPR@{:@'.
417    43 | CTABLES /PCOMPUTE &k**.
418       |                     ^~
419
420 ctables.sps:44.21-44.23: error: CTABLES: Syntax error expecting `=EXPR@{:@'.
421    44 | CTABLES /PCOMPUTE &k=**.
422       |                     ^~~
423
424 ctables.sps:45.21-45.27: error: CTABLES: Syntax error expecting `=EXPR@{:@'.
425    45 | CTABLES /PCOMPUTE &k=EXPR**.
426       |                     ^~~~~~~
427
428 ctables.sps:46.28: error: CTABLES: Syntax error expecting `@:}@'.
429    46 | CTABLES /PCOMPUTE &k=EXPR(1x).
430       |                            ^
431
432 ctables.sps:47.31-47.49: warning: CTABLES: New definition of &k will override
433 the previous definition.
434    47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
435       |                               ^~~~~~~~~~~~~~~~~~~
436
437 ctables.sps:47.10-47.28: note: CTABLES: This is the previous definition.
438    47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
439       |          ^~~~~~~~~~~~~~~~~~~
440
441 ctables.sps:47.50: error: CTABLES: Syntax error expecting `/'.
442    47 | CTABLES /PCOMPUTE &k=EXPR(1) /PCOMPUTE &k=EXPR(2).
443       |                                                  ^
444
445 ctables.sps:48.53-48.64: error: CTABLES: Syntax error expecting summary function
446 name.
447    48 | CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=NOTAFUNCTION.
448       |                                                     ^~~~~~~~~~~~
449
450 ctables.sps:49.59-49.60: error: CTABLES: Syntax error expecting number between 0
451 and 100 for PTILE.
452    49 | CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k FORMAT=PTILE **.
453       |                                                           ^~
454
455 ctables.sps:50.52-50.53: error: CTABLES: Syntax error expecting string.
456    50 | CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k LABEL=**.
457       |                                                    ^~
458
459 ctables.sps:51.61-51.62: error: CTABLES: Syntax error expecting YES or NO.
460    51 | CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k HIDESOURCECATS=**.
461       |                                                             ^~
462
463 ctables.sps:52.46-52.47: error: CTABLES: Syntax error expecting LABEL, FORMAT,
464 or HIDESOURCECATS.
465    52 | CTABLES /PCOMPUTE &k=EXPR(1) /PPROPERTIES &k **.
466       |                                              ^~
467
468 ctables.sps:53.23-53.24: error: CTABLES: Syntax error expecting string.
469    53 | CTABLES /FORMAT EMPTY=**.
470       |                       ^~
471
472 ctables.sps:54.25-54.26: error: CTABLES: Syntax error expecting string.
473    54 | CTABLES /FORMAT MISSING=**.
474       |                         ^~
475
476 ctables.sps:55.17-55.18: error: CTABLES: Syntax error expecting MINCOLWIDTH,
477 MAXCOLWIDTH, UNITS, EMPTY, or MISSING.
478    55 | CTABLES /FORMAT **.
479       |                 ^~
480
481 ctables.sps:56.17-56.45: error: CTABLES: MINCOLWIDTH must not be greater than
482 MAXCOLWIDTH.
483    56 | CTABLES /FORMAT MINCOLWIDTH=20 MAXCOLWIDTH=10/.
484       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
485
486 ctables.sps:57.18-57.19: error: CTABLES: Syntax error expecting VARIABLES.
487    57 | CTABLES /VLABELS **.
488       |                  ^~
489
490 ctables.sps:58.28-58.34: error: CTABLES: NOTAVAR is not a variable name.
491    58 | CTABLES /VLABELS VARIABLES=NOTAVAR.
492       |                            ^~~~~~~
493
494 ctables.sps:59.32-59.33: error: CTABLES: Syntax error expecting DISPLAY.
495    59 | CTABLES /VLABELS VARIABLES=qn1 **.
496       |                                ^~
497
498 ctables.sps:60.40-60.41: error: CTABLES: Syntax error expecting DEFAULT, NAME,
499 LABEL, BOTH, or NONE.
500    60 | CTABLES /VLABELS VARIABLES=qn1 DISPLAY=**.
501       |                                        ^~
502
503 ctables.sps:61.17-61.18: error: CTABLES: Syntax error expecting COUNTDUPLICATES.
504    61 | CTABLES /MRSETS **.
505       |                 ^~
506
507 ctables.sps:62.33-62.34: error: CTABLES: Syntax error expecting YES or NO.
508    62 | CTABLES /MRSETS COUNTDUPLICATES=**.
509       |                                 ^~
510
511 ctables.sps:63.19-63.20: error: CTABLES: Syntax error expecting VARIABLE or
512 LISTWISE.
513    63 | CTABLES /SMISSING **.
514       |                   ^~
515
516 ctables.sps:64.17-64.18: error: CTABLES: Syntax error expecting VARIABLE.
517    64 | CTABLES /WEIGHT **.
518       |                 ^~
519
520 ctables.sps:65.26-65.32: error: CTABLES: NOTAVAR is not a variable name.
521    65 | CTABLES /WEIGHT VARIABLE=NOTAVAR.
522       |                          ^~~~~~~
523
524 ctables.sps:66.32: error: CTABLES: Syntax error expecting integer 2 or greater
525 for HIDESMALLCOUNTS COUNT.
526    66 | CTABLES /HIDESMALLCOUNTS COUNT=1.
527       |                                ^
528
529 ctables.sps:67.10-67.13: error: CTABLES: Syntax error expecting one of the
530 following: FORMAT, VLABELS, MRSETS, SMISSING, PCOMPUTE, PPROPERTIES, WEIGHT,
531 HIDESMALLCOUNTS, TABLE.
532    67 | CTABLES /QUUX.
533       |          ^~~~
534
535 ctables.sps:68.33: error: CTABLES: Syntax error expecting `/'.
536    68 | CTABLES /HIDESMALLCOUNTS COUNT=2.
537       |                                 ^
538
539 ctables.sps:69.19-69.20: error: CTABLES: Syntax error expecting `/'.
540    69 | CTABLES /TABLE qn1**.
541       |                   ^~
542
543 ctables.sps:70.38-70.39: error: CTABLES: Syntax error expecting COLUMN, ROW, or
544 LAYER.
545    70 | CTABLES /TABLE qn1 /SLABELS POSITION=**.
546       |                                      ^~
547
548 ctables.sps:71.37-71.38: error: CTABLES: Syntax error expecting YES or NO.
549    71 | CTABLES /TABLE qn1 /SLABELS VISIBLE=**.
550       |                                     ^~
551
552 ctables.sps:72.29-72.30: error: CTABLES: Syntax error expecting POSITION or
553 VISIBLE.
554    72 | CTABLES /TABLE qn1 /SLABELS **.
555       |                             ^~
556
557 ctables.sps:73.39-73.40: error: CTABLES: Syntax error expecting OPPOSITE or
558 LAYER.
559    73 | CTABLES /TABLE qn1 /CLABELS ROWLABELS=**.
560       |                                       ^~
561
562 ctables.sps:74.39-74.40: error: CTABLES: Syntax error expecting OPPOSITE or
563 LAYER.
564    74 | CTABLES /TABLE qn1 /CLABELS COLLABELS=**.
565       |                                       ^~
566
567 ctables.sps:75.29-75.30: error: CTABLES: Syntax error expecting AUTO, ROWLABELS,
568 or COLLABELS.
569    75 | CTABLES /TABLE qn1 /CLABELS **.
570       |                             ^~
571
572 ctables.sps:76.30-76.31: error: CTABLES: Syntax error expecting CILEVEL.
573    76 | CTABLES /TABLE qn1 /CRITERIA **.
574       |                              ^~
575
576 ctables.sps:77.38-77.40: error: CTABLES: Syntax error expecting number in
577 @<:@0,100@:}@ for CILEVEL.
578    77 | CTABLES /TABLE qn1 /CRITERIA CILEVEL=101.
579       |                                      ^~~
580
581 ctables.sps:78.28-78.29: error: CTABLES: Syntax error expecting CAPTION, CORNER,
582 or TITLE.
583    78 | CTABLES /TABLE qn1 /TITLES **.
584       |                            ^~
585
586 ctables.sps:79.34-79.35: error: CTABLES: Syntax error expecting CHISQUARE.
587    79 | CTABLES /TABLE qn1 /SIGTEST TYPE=**.
588       |                                  ^~
589
590 ctables.sps:80.35-80.36: error: CTABLES: Syntax error expecting number in @<:@0,1@:}@
591 for ALPHA.
592    80 | CTABLES /TABLE qn1 /SIGTEST ALPHA=**.
593       |                                   ^~
594
595 ctables.sps:81.43-81.44: error: CTABLES: Syntax error expecting YES or NO.
596    81 | CTABLES /TABLE qn1 /SIGTEST INCLUDEMRSETS=**.
597       |                                           ^~
598
599 ctables.sps:82.40-82.41: error: CTABLES: Syntax error expecting ALLVISIBLE or
600 SUBTOTALS.
601    82 | CTABLES /TABLE qn1 /SIGTEST CATEGORIES=**.
602       |                                        ^~
603
604 ctables.sps:83.29-83.30: error: CTABLES: Syntax error expecting TYPE, ALPHA,
605 INCLUDEMRSETS, or CATEGORIES.
606    83 | CTABLES /TABLE qn1 /SIGTEST **.
607       |                             ^~
608
609 ctables.sps:84.38-84.39: error: CTABLES: Syntax error expecting PROP or MEAN.
610    84 | CTABLES /TABLE qn1 /COMPARETEST TYPE=**.
611       |                                      ^~
612
613 ctables.sps:85.39-85.40: error: CTABLES: Syntax error expecting number in (0,1)
614 for ALPHA.
615    85 | CTABLES /TABLE qn1 /COMPARETEST ALPHA=**.
616       |                                       ^~
617
618 ctables.sps:86.39: error: CTABLES: Syntax error expecting number in (0,1) for
619 ALPHA.
620    86 | CTABLES /TABLE qn1 /COMPARETEST ALPHA=0,5.
621       |                                       ^
622
623 ctables.sps:87.40-87.41: error: CTABLES: Syntax error expecting BONFERRONI, BH,
624 or NONE.
625    87 | CTABLES /TABLE qn1 /COMPARETEST ADJUST=**.
626       |                                        ^~
627
628 ctables.sps:88.47-88.48: error: CTABLES: Syntax error expecting YES or NO.
629    88 | CTABLES /TABLE qn1 /COMPARETEST INCLUDEMRSETS=**.
630       |                                               ^~
631
632 ctables.sps:89.47-89.48: error: CTABLES: Syntax error expecting ALLCATS or
633 TESTEDCATS.
634    89 | CTABLES /TABLE qn1 /COMPARETEST MEANSVARIANCE=**.
635       |                                               ^~
636
637 ctables.sps:90.44-90.45: error: CTABLES: Syntax error expecting ALLVISIBLE or
638 SUBTOTALS.
639    90 | CTABLES /TABLE qn1 /COMPARETEST CATEGORIES=**.
640       |                                            ^~
641
642 ctables.sps:91.39-91.40: error: CTABLES: Syntax error expecting YES or NO.
643    91 | CTABLES /TABLE qn1 /COMPARETEST MERGE=**.
644       |                                       ^~
645
646 ctables.sps:92.39-92.40: error: CTABLES: Syntax error expecting APA or SIMPLE.
647    92 | CTABLES /TABLE qn1 /COMPARETEST STYLE=**.
648       |                                       ^~
649
650 ctables.sps:93.41-93.42: error: CTABLES: Syntax error expecting YES or NO.
651    93 | CTABLES /TABLE qn1 /COMPARETEST SHOWSIG=**.
652       |                                         ^~
653
654 ctables.sps:94.33-94.34: error: CTABLES: Syntax error expecting one of the
655 following: TYPE, ALPHA, ADJUST, INCLUDEMRSETS, MEANSVARIANCE, CATEGORIES, MERGE,
656 STYLE, SHOWSIG.
657    94 | CTABLES /TABLE qn1 /COMPARETEST **.
658       |                                 ^~
659
660 ctables.sps:95.21-95.26: error: CTABLES: Syntax error expecting TABLE, SLABELS,
661 CLABELS, CRITERIA, CATEGORIES, TITLES, SIGTEST, or COMPARETEST.
662    95 | CTABLES /TABLE qn1 /FORMAT.
663       |                     ^~~~~~
664
665 ctables.sps:95.21-95.26: note: CTABLES: This subcommand must appear before
666 TABLE.
667    95 | CTABLES /TABLE qn1 /FORMAT.
668       |                     ^~~~~~
669
670 ctables.sps:96: error: CTABLES: ROWLABELS and COLLABELS may not both be
671 specified.
672
673 ctables.sps:96.21-96.46: note: CTABLES: This is the first specification.
674    96 | CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS
675 COLLABELS=OPPOSITE.
676       |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
677
678 ctables.sps:96.49-96.74: note: CTABLES: This is the second specification.
679    96 | CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CLABELS
680 COLLABELS=OPPOSITE.
681       |
682 ^~~~~~~~~~~~~~~~~~~~~~~~~~
683
684 ctables.sps:97.16-97.26: error: CTABLES: Cannot nest scale variables.
685    97 | CTABLES /TABLE qn20 > qnd1.
686       |                ^~~~~~~~~~~
687
688 ctables.sps:97.16-97.19: note: CTABLES: This is an outer scale variable.
689    97 | CTABLES /TABLE qn20 > qnd1.
690       |                ^~~~
691
692 ctables.sps:97.23-97.26: note: CTABLES: This is an inner scale variable.
693    97 | CTABLES /TABLE qn20 > qnd1.
694       |                       ^~~~
695
696 ctables.sps:98.16-98.35: error: CTABLES: Summaries may only be requested for
697 categorical variables at the innermost nesting level.
698    98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
699       |                ^~~~~~~~~~~~~~~~~~~~
700
701 ctables.sps:98.16-98.18: note: CTABLES: This outer categorical variable has a
702 summary.
703    98 | CTABLES /TABLE qn1 [ROWPCT] > qnsa1.
704       |                ^~~
705
706 ctables.sps:100.52-100.56: error: CTABLES: Failed to parse category
707 specification as format DATETIME: Day (123) must be between 1 and 31..
708   100 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=datetime ['123'].
709       |                                                    ^~~~~
710 ]])
711 AT_CLEANUP
712
713 AT_SETUP([CTABLES parsing - more negative])
714 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
715 AT_DATA([ctables.sps],
716 [[GET 'nhtsa.sav'.
717 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
718 CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
719 CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
720
721 STRING string(A8).
722 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
723 CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
724
725 CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
726
727 CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
728 CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
729 CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
730 CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
731
732 CTABLES /PCOMPUTE &x=EXPR(1**2**3).
733 CTABLES /PCOMPUTE &x=EXPR([**]).
734 CTABLES /PCOMPUTE &x=EXPR(**).
735
736 CTABLES /TABLE.
737
738 CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT]. 
739
740 CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 50).
741
742 CTABLES /TABLE $mrset.
743
744 CTABLES /TABLE qn113 /SIGTEST TYPE=CHISQUARE.
745 CTABLES /TABLE qn113 /COMPARETEST TYPE=PROP.
746
747 CTABLES /TABLE qn113 [COUNT.UCL].
748
749 CTABLES /TABLE qn1 /CATEGORIES **.
750
751 CTABLES /TITLES.
752 ]])
753 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [1],
754 [[ctables.sps:2.76-2.78: error: CTABLES: Computed category &pc references a category not included in the category list.
755     2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
756       |                                                                            ^~~
757
758 ctables.sps:2.28-2.35: note: CTABLES: This is the missing category.
759     2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
760       |                            ^~~~~~~~
761
762 ctables.sps:2.76-2.79: note: CTABLES: To fix the problem, add subtotals to the list of categories here.
763     2 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
764       |                                                                            ^~~~
765
766 ctables.sps:3.73-3.75: error: CTABLES: Computed category &pc references a category not included in the category list.
767     3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
768       |                                                                         ^~~
769
770 ctables.sps:3.28-3.32: note: CTABLES: This is the missing category.
771     3 | CTABLES /PCOMPUTE &pc=EXPR(TOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc].
772       |                            ^~~~~
773
774 ctables.sps:3: note: CTABLES: To fix the problem, add TOTAL=YES to the variable's CATEGORIES specification.
775
776 ctables.sps:4.76-4.99: error: CTABLES: These categories include 2 instances of SUBTOTAL or HSUBTOTAL, so references from
777 computed categories must refer to subtotals by position, e.g. SUBTOTAL[1].
778     4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
779       |                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~
780
781 ctables.sps:4.28-4.35: note: CTABLES: This is the reference that lacks a position.
782     4 | CTABLES /PCOMPUTE &pc=EXPR(SUBTOTAL) /TABLE qn1 /CATEGORIES VARIABLES=qn1 [&pc, SUBTOTAL, SUBTOTAL].
783       |                            ^~~~~~~~
784
785 ctables.sps:7.47-7.54: error: CTABLES: This category specification may be applied only to string variables, but this
786 subcommand tries to apply it to numeric variable QN1.
787     7 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 ['string'].
788       |                                               ^~~~~~~~
789
790 ctables.sps:8.53: error: CTABLES: This category specification may be applied only to numeric variables, but this
791 subcommand tries to apply it to string variable string.
792     8 | CTABLES /TABLE string /CATEGORIES VARIABLES=string [1].
793       |                                                     ^
794
795 ctables.sps:10.74-10.86: error: CTABLES: Data-dependent sorting is not implemented.
796    10 | CTABLES /TABLE qn1 /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn1 KEY=MEAN(qn1).
797       |                                                                          ^~~~~~~~~~~~~
798
799 ctables.sps:12: error: CTABLES: To move category labels from one axis to another, the variables whose labels are to be
800 moved must be categorical, but qnd1 is scale.
801
802 ctables.sps:12.22-12.47: note: CTABLES: This syntax moves category labels to another axis.
803    12 | CTABLES /TABLE qnd1 /CLABELS ROWLABELS=OPPOSITE.
804       |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
805
806 ctables.sps:13: error: CTABLES: To move category labels from one axis to another, the variables whose labels are to be
807 moved must all have the same width, but QN1 has width 0 and string has width 8.
808
809 ctables.sps:13.30-13.55: note: CTABLES: This syntax moves category labels to another axis.
810    13 | CTABLES /TABLE qn1 + string /CLABELS ROWLABELS=OPPOSITE.
811       |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
812
813 ctables.sps:14: error: CTABLES: To move category labels from one axis to another, the variables whose labels are to be
814 moved must all have the same value labels, but QN1 and QNSA1 have different value labels.
815
816 ctables.sps:14.29-14.54: note: CTABLES: This syntax moves category labels to another axis.
817    14 | CTABLES /TABLE qn1 + qnsa1 /CLABELS ROWLABELS=OPPOSITE.
818       |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
819
820 ctables.sps:15: error: CTABLES: To move category labels from one axis to another, the variables whose labels are to be
821 moved must all have the same category specifications, but QN105BA and QN105BB have different category specifications.
822
823 ctables.sps:15.35-15.60: note: CTABLES: This syntax moves category labels to another axis.
824    15 | CTABLES /TABLE qn105ba + qn105bb /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=qn105ba [1,2,3].
825       |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
826
827 ctables.sps:17.27-17.33: warning: CTABLES: The exponentiation operator (`**') is left-associative: `a**b**c' equals
828 `(a**b)**c', not `a**(b**c)'.  To disable this warning, insert parentheses.
829    17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
830       |                           ^~~~~~~
831
832 ctables.sps:17.35: error: CTABLES: Syntax error expecting `/'.
833    17 | CTABLES /PCOMPUTE &x=EXPR(1**2**3).
834       |                                   ^
835
836 ctables.sps:18.28-18.29: error: CTABLES: Syntax error expecting number or string or range.
837    18 | CTABLES /PCOMPUTE &x=EXPR([**]).
838       |                            ^~
839
840 ctables.sps:19.27-19.28: error: CTABLES: Syntax error in postcompute expression.
841    19 | CTABLES /PCOMPUTE &x=EXPR(**).
842       |                           ^~
843
844 ctables.sps:21.15: error: CTABLES: At least one variable must be specified.
845    21 | CTABLES /TABLE.
846       |               ^
847
848 ctables.sps:23: error: CTABLES: Summaries may appear only on one axis.
849
850 ctables.sps:23.50-23.54: note: CTABLES: This variable on the layers axis has a summary.
851    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
852       |                                                  ^~~~~
853
854 ctables.sps:23.16-23.20: note: CTABLES: This variable on the rows axis has a summary.
855    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
856       |                ^~~~~
857
858 ctables.sps:23.33-23.37: note: CTABLES: This variable on the columns axis has a summary.
859    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
860       |                                 ^~~~~
861
862 ctables.sps:23.33-23.37: note: CTABLES: This is a scale variable, so it always has a summary even if the syntax does not
863 explicitly specify one.
864    23 | CTABLES /TABLE qn113 [COUNT] BY qn114 [COUNT] BY qn116 [COUNT].
865       |                                 ^~~~~
866
867 ctables.sps:25.46-25.63: error: CTABLES: Data-dependent sorting is not implemented.
868    25 | CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 KEY=PTILE(qn1, 50).
869       |                                              ^~~~~~~~~~~~~~~~~~
870
871 ctables.sps:27.16-27.21: error: CTABLES: Multiple response set support not implemented.
872    27 | CTABLES /TABLE $mrset.
873       |                ^~~~~~
874
875 ctables.sps:29.23-29.44: error: CTABLES: Support for SIGTEST not yet implemented.
876    29 | CTABLES /TABLE qn113 /SIGTEST TYPE=CHISQUARE.
877       |                       ^~~~~~~~~~~~~~~~~~~~~~
878
879 ctables.sps:30.23-30.43: error: CTABLES: Support for COMPARETEST not yet implemented.
880    30 | CTABLES /TABLE qn113 /COMPARETEST TYPE=PROP.
881       |                       ^~~~~~~~~~~~~~~~~~~~~
882
883 ctables.sps:32.23-32.31: error: CTABLES: Support for LCL, UCL, and SE summary functions is not yet implemented.
884    32 | CTABLES /TABLE qn113 [COUNT.UCL].
885       |                       ^~~~~~~~~
886
887 ctables.sps:34.32-34.33: error: CTABLES: Syntax error expecting VARIABLES.
888    34 | CTABLES /TABLE qn1 /CATEGORIES **.
889       |                                ^~
890
891 ctables.sps:36.10-36.15: error: CTABLES: Syntax error expecting one of the following: FORMAT, VLABELS, MRSETS, SMISSING,
892 PCOMPUTE, PPROPERTIES, WEIGHT, HIDESMALLCOUNTS, TABLE.
893    36 | CTABLES /TITLES.
894       |          ^~~~~~
895
896 ctables.sps:36.10-36.15: note: CTABLES: TABLE must appear before this subcommand.
897    36 | CTABLES /TITLES.
898       |          ^~~~~~
899 ]])
900 AT_CLEANUP
901
902 AT_SETUP([CTABLES one categorical variable])
903 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
904 AT_DATA([ctables.sps],
905 [[GET 'nhtsa.sav'.
906 CTABLES /TABLE qn1.
907 CTABLES /TABLE BY qn1.
908 CTABLES /TABLE BY BY qn1.
909 ]])
910 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
911                                   Custom Tables
912 ╭────────────────────────────────────────────────────────────────────────┬─────╮
913 │                                                                        │Count│
914 ├────────────────────────────────────────────────────────────────────────┼─────┤
915 │ 1. How often do you usually drive a car or other  Every day            │ 4667│
916 │motor vehicle?                                     Several days a week  │ 1274│
917 │                                                   Once a week or less  │  361│
918 │                                                   Only certain times a │  130│
919 │                                                   year                 │     │
920 │                                                   Never                │  540│
921 ╰────────────────────────────────────────────────────────────────────────┴─────╯
922
923                                   Custom Tables
924 ╭──────────────────────────────────────────────────────────────────────────────╮
925 │        1. How often do you usually drive a car or other motor vehicle?       │
926 ├─────────┬──────────────────┬──────────────────┬────────────────────────┬─────┤
927 │         │  Several days a  │  Once a week or  │  Only certain times a  │     │
928 │Every day│       week       │       less       │          year          │Never│
929 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
930 │  Count  │       Count      │       Count      │          Count         │Count│
931 ├─────────┼──────────────────┼──────────────────┼────────────────────────┼─────┤
932 │     4667│              1274│               361│                     130│  540│
933 ╰─────────┴──────────────────┴──────────────────┴────────────────────────┴─────╯
934
935 Custom Tables
936 Every day
937 ╭─────╮
938 │Count│
939 ├─────┤
940 │ 4667│
941 ╰─────╯
942 ])
943 AT_CLEANUP
944
945 AT_SETUP([CTABLES one string variable])
946 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
947 AT_DATA([ctables.sps],
948 [[GET 'nhtsa.sav'.
949 STRING licensed(A8).
950 MISSING VALUES licensed('DontKnow', 'Refused').
951 RECODE qnd7a(1='Yes')(2='No')(3='DontKnow')(4='Refused') INTO licensed.
952 CTABLES /TABLE licensed.
953 CTABLES /TABLE licensed [COUNT, TOTALS[COUNT, VALIDN]] /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
954 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'No'] TOTAL=YES.
955 * Notice that the string matching is case-sensitive.
956 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['Yes', 'no'] TOTAL=YES.
957 CTABLES /TABLE licensed /CATEGORIES VARIABLES=licensed ['No' THRU 'yes'] TOTAL=YES.
958 CTABLES
959     /PCOMPUTE &notyes=EXPR(['No']+['DontKnow']+['Refused'])
960     /PPROPERTIES &notyes LABEL='Not Yes' HIDESOURCECATS=YES
961     /TABLE licensed
962     /CATEGORIES VARIABLES=licensed ['Yes', &notyes, 'No', 'DontKnow', 'Refused'].
963 CTABLES
964     /PCOMPUTE &notyes=EXPR(['DontKnow' THRU 'No'] + ['Refused'])
965     /PPROPERTIES &notyes LABEL='Not Yes' HIDESOURCECATS=YES
966     /TABLE licensed
967     /CATEGORIES VARIABLES=licensed ['Yes', &notyes, 'DontKnow' THRU 'No', 'Refused'].
968 ]])
969 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
970     Custom Tables
971 ╭────────────┬─────╮
972 │            │Count│
973 ├────────────┼─────┤
974 │licensed No │  572│
975 │         Yes│ 6379│
976 ╰────────────┴─────╯
977
978           Custom Tables
979 ╭─────────────────┬─────┬───────╮
980 │                 │Count│Valid N│
981 ├─────────────────┼─────┼───────┤
982 │licensed DontKnow│    4│       │
983 │         No      │  572│       │
984 │         Refused │   44│       │
985 │         Yes     │ 6379│       │
986 │         Total   │ 6999│   6951│
987 ╰─────────────────┴─────┴───────╯
988
989      Custom Tables
990 ╭──────────────┬─────╮
991 │              │Count│
992 ├──────────────┼─────┤
993 │licensed Yes  │ 6379│
994 │         No   │  572│
995 │         Total│ 6951│
996 ╰──────────────┴─────╯
997
998      Custom Tables
999 ╭──────────────┬─────╮
1000 │              │Count│
1001 ├──────────────┼─────┤
1002 │licensed Yes  │ 6379│
1003 │         no   │    0│
1004 │         Total│ 6379│
1005 ╰──────────────┴─────╯
1006
1007       Custom Tables
1008 ╭────────────────┬─────╮
1009 │                │Count│
1010 ├────────────────┼─────┤
1011 │licensed No     │  572│
1012 │         Refused│   44│
1013 │         Yes    │ 6379│
1014 │         Total  │ 6995│
1015 ╰────────────────┴─────╯
1016
1017       Custom Tables
1018 ╭────────────────┬─────╮
1019 │                │Count│
1020 ├────────────────┼─────┤
1021 │licensed Yes    │ 6379│
1022 │         Not Yes│  620│
1023 ╰────────────────┴─────╯
1024
1025       Custom Tables
1026 ╭────────────────┬─────╮
1027 │                │Count│
1028 ├────────────────┼─────┤
1029 │licensed Yes    │ 6379│
1030 │         Not Yes│  620│
1031 ╰────────────────┴─────╯
1032 ])
1033 AT_CLEANUP
1034
1035 AT_SETUP([CTABLES one scale variable])
1036 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
1037 AT_DATA([ctables.sps],
1038 [[GET 'nhtsa.sav'.
1039 DESCRIPTIVES qnd1.
1040 CTABLES /TABLE qnd1[COUNT, VALIDN, TOTALN, MEAN, STDDEV, MINIMUM, MAXIMUM].
1041 CTABLES /TABLE BY qnd1.
1042 CTABLES /TABLE BY BY qnd1.
1043 ]])
1044 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1045                        Descriptive Statistics
1046 ╭──────────────────────────┬────┬─────┬───────┬───────┬───────────╮
1047 │                          │  N │ Mean│Std Dev│Minimum│  Maximum  │
1048 ├──────────────────────────┼────┼─────┼───────┼───────┼───────────┤
1049 │D1. AGE: What is your age?│6930│48.26│  19.01│     16│86 or older│
1050 │Valid N (listwise)        │6999│     │       │       │           │
1051 │Missing N (listwise)      │  69│     │       │       │           │
1052 ╰──────────────────────────┴────┴─────┴───────┴───────┴───────────╯
1053
1054                                   Custom Tables
1055 ╭──────────────────────┬─────┬───────┬───────┬────┬────────────┬───────┬───────╮
1056 │                      │     │       │       │    │     Std    │       │       │
1057 │                      │Count│Valid N│Total N│Mean│  Deviation │Minimum│Maximum│
1058 ├──────────────────────┼─────┼───────┼───────┼────┼────────────┼───────┼───────┤
1059 │D1. AGE: What is your │ 6999│   6930│   6999│  48│          19│     16│     86│
1060 │age?                  │     │       │       │    │            │       │       │
1061 ╰──────────────────────┴─────┴───────┴───────┴────┴────────────┴───────┴───────╯
1062
1063         Custom Tables
1064 ╭──────────────────────────╮
1065 │D1. AGE: What is your age?│
1066 ├──────────────────────────┤
1067 │           Mean           │
1068 ├──────────────────────────┤
1069 │                        48│
1070 ╰──────────────────────────╯
1071
1072 Custom Tables
1073 D1. AGE: What is your age?
1074 ╭────╮
1075 │Mean│
1076 ├────┤
1077 │  48│
1078 ╰────╯
1079 ])
1080 AT_CLEANUP
1081
1082 AT_SETUP([CTABLES simple stacking])
1083 AT_KEYWORDS([stack stacked])
1084 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
1085 AT_DATA([ctables.sps],
1086 [[GET 'nhtsa.sav'.
1087 CTABLES /TABLE qn105ba + qn105bb + qn105bc + qn105bd BY qns3a [COLPCT PCT8.0].
1088 ]])
1089 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1090                                   Custom Tables
1091 ╭───────────────────────────────────────────────────────────────┬──────────────╮
1092 │                                                               │ S3a. GENDER: │
1093 │                                                               ├──────┬───────┤
1094 │                                                               │ Male │ Female│
1095 │                                                               ├──────┼───────┤
1096 │                                                               │Column│ Column│
1097 │                                                               │   %  │   %   │
1098 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
1099 │105b. How likely is it that drivers who have had   Almost      │   10%│    11%│
1100 │too much to drink to drive safely will A. Get      certain     │      │       │
1101 │stopped by the police?                             Very likely │   21%│    22%│
1102 │                                                   Somewhat    │   38%│    42%│
1103 │                                                   likely      │      │       │
1104 │                                                   Somewhat    │   21%│    18%│
1105 │                                                   unlikely    │      │       │
1106 │                                                   Very        │   10%│     8%│
1107 │                                                   unlikely    │      │       │
1108 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
1109 │105b. How likely is it that drivers who have had   Almost      │   14%│    18%│
1110 │too much to drink to drive safely will B. Have an  certain     │      │       │
1111 │accident?                                          Very likely │   36%│    45%│
1112 │                                                   Somewhat    │   39%│    32%│
1113 │                                                   likely      │      │       │
1114 │                                                   Somewhat    │    9%│     4%│
1115 │                                                   unlikely    │      │       │
1116 │                                                   Very        │    3%│     2%│
1117 │                                                   unlikely    │      │       │
1118 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
1119 │105b. How likely is it that drivers who have had   Almost      │   18%│    16%│
1120 │too much to drink to drive safely will C. Be       certain     │      │       │
1121 │convicted for drunk driving?                       Very likely │   32%│    28%│
1122 │                                                   Somewhat    │   27%│    32%│
1123 │                                                   likely      │      │       │
1124 │                                                   Somewhat    │   15%│    15%│
1125 │                                                   unlikely    │      │       │
1126 │                                                   Very        │    9%│     9%│
1127 │                                                   unlikely    │      │       │
1128 ├───────────────────────────────────────────────────────────────┼──────┼───────┤
1129 │105b. How likely is it that drivers who have had   Almost      │   16%│    16%│
1130 │too much to drink to drive safely will D. Be       certain     │      │       │
1131 │arrested for drunk driving?                        Very likely │   26%│    27%│
1132 │                                                   Somewhat    │   32%│    35%│
1133 │                                                   likely      │      │       │
1134 │                                                   Somewhat    │   17%│    15%│
1135 │                                                   unlikely    │      │       │
1136 │                                                   Very        │    9%│     7%│
1137 │                                                   unlikely    │      │       │
1138 ╰───────────────────────────────────────────────────────────────┴──────┴───────╯
1139 ])
1140 AT_CLEANUP
1141
1142 AT_SETUP([CTABLES show or hide empty categories])
1143 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
1144 AT_DATA([ctables.sps],
1145 [[GET 'nhtsa.sav'.
1146 IF (qn105ba = 2) qn105ba = 1.
1147 IF (qns3a = 1) qns3a = 2.
1148 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0].
1149 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
1150     /CATEGORIES VAR=qn105ba EMPTY=EXCLUDE.
1151 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
1152     /CATEGORIES VAR=qns3a EMPTY=EXCLUDE.
1153 CTABLES /TABLE qn105ba BY qns3a [COLPCT PCT8.0]
1154     /CATEGORIES VAR=ALL EMPTY=EXCLUDE.
1155 ]])
1156 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1157                                   Custom Tables
1158 ╭──────────────────────────────────────────────────────────────┬───────────────╮
1159 │                                                              │  S3a. GENDER: │
1160 │                                                              ├───────┬───────┤
1161 │                                                              │  Male │ Female│
1162 │                                                              ├───────┼───────┤
1163 │                                                              │ Column│ Column│
1164 │                                                              │   %   │   %   │
1165 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
1166 │105b. How likely is it that drivers who have had   Almost     │      .│    32%│
1167 │too much to drink to drive safely will A. Get      certain    │       │       │
1168 │stopped by the police?                             Very likely│      .│     0%│
1169 │                                                   Somewhat   │      .│    40%│
1170 │                                                   likely     │       │       │
1171 │                                                   Somewhat   │      .│    19%│
1172 │                                                   unlikely   │       │       │
1173 │                                                   Very       │      .│     9%│
1174 │                                                   unlikely   │       │       │
1175 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
1176
1177                                   Custom Tables
1178 ╭──────────────────────────────────────────────────────────────┬───────────────╮
1179 │                                                              │  S3a. GENDER: │
1180 │                                                              ├───────┬───────┤
1181 │                                                              │  Male │ Female│
1182 │                                                              ├───────┼───────┤
1183 │                                                              │ Column│ Column│
1184 │                                                              │   %   │   %   │
1185 ├──────────────────────────────────────────────────────────────┼───────┼───────┤
1186 │105b. How likely is it that drivers who have had   Almost     │      .│    32%│
1187 │too much to drink to drive safely will A. Get      certain    │       │       │
1188 │stopped by the police?                             Somewhat   │      .│    40%│
1189 │                                                   likely     │       │       │
1190 │                                                   Somewhat   │      .│    19%│
1191 │                                                   unlikely   │       │       │
1192 │                                                   Very       │      .│     9%│
1193 │                                                   unlikely   │       │       │
1194 ╰──────────────────────────────────────────────────────────────┴───────┴───────╯
1195
1196                                   Custom Tables
1197 ╭────────────────────────────────────────────────────────────────────┬─────────╮
1198 │                                                                    │   S3a.  │
1199 │                                                                    │ GENDER: │
1200 │                                                                    ├─────────┤
1201 │                                                                    │  Female │
1202 │                                                                    ├─────────┤
1203 │                                                                    │ Column %│
1204 ├────────────────────────────────────────────────────────────────────┼─────────┤
1205 │105b. How likely is it that drivers who have had too    Almost      │      32%│
1206 │much to drink to drive safely will A. Get stopped by    certain     │         │
1207 │the police?                                             Very likely │       0%│
1208 │                                                        Somewhat    │      40%│
1209 │                                                        likely      │         │
1210 │                                                        Somewhat    │      19%│
1211 │                                                        unlikely    │         │
1212 │                                                        Very        │       9%│
1213 │                                                        unlikely    │         │
1214 ╰────────────────────────────────────────────────────────────────────┴─────────╯
1215
1216                                   Custom Tables
1217 ╭────────────────────────────────────────────────────────────────────┬─────────╮
1218 │                                                                    │   S3a.  │
1219 │                                                                    │ GENDER: │
1220 │                                                                    ├─────────┤
1221 │                                                                    │  Female │
1222 │                                                                    ├─────────┤
1223 │                                                                    │ Column %│
1224 ├────────────────────────────────────────────────────────────────────┼─────────┤
1225 │105b. How likely is it that drivers who have had too    Almost      │      32%│
1226 │much to drink to drive safely will A. Get stopped by    certain     │         │
1227 │the police?                                             Somewhat    │      40%│
1228 │                                                        likely      │         │
1229 │                                                        Somewhat    │      19%│
1230 │                                                        unlikely    │         │
1231 │                                                        Very        │       9%│
1232 │                                                        unlikely    │         │
1233 ╰────────────────────────────────────────────────────────────────────┴─────────╯
1234 ])
1235 AT_CLEANUP
1236
1237 AT_SETUP([CTABLES categories and EMPTY])
1238 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
1239 AT_DATA([ctables.sps],
1240 DATA LIST LIST NOTABLE /class datum size.
1241 BEGIN DATA
1242 1 1 1
1243 2 2 1
1244 1 3 1
1245 2 4 2
1246 1 5 2
1247 2 6 2
1248 END DATA.
1249 VARIABLE LEVEL class datum size (NOMINAL).
1250 FORMATS class datum size (F1.0).
1251
1252 * The following are the same except for the order of the CATEGORIES commands.
1253 * The test checks that they produce the same resuls.
1254 CTABLES /TABLE=class > datum BY size
1255    /CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE
1256    /CATEGORIES VARIABLES=size TOTAL=YES.
1257 CTABLES /TABLE=class > datum BY size
1258    /CATEGORIES VARIABLES=size TOTAL=YES
1259    /CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE.
1260 ])
1261 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1262            Custom Tables
1263 ╭───────────────┬─────────────────╮
1264 │               │       size      │
1265 │               ├─────┬─────┬─────┤
1266 │               │  1  │  2  │Total│
1267 │               ├─────┼─────┼─────┤
1268 │               │Count│Count│Count│
1269 ├───────────────┼─────┼─────┼─────┤
1270 │class 1 datum 1│    1│     │    1│
1271 │              3│    1│     │    1│
1272 │              5│     │    1│    1│
1273 │     ╶─────────┼─────┼─────┼─────┤
1274 │      2 datum 2│    1│     │    1│
1275 │              4│     │    1│    1│
1276 │              6│     │    1│    1│
1277 ╰───────────────┴─────┴─────┴─────╯
1278
1279            Custom Tables
1280 ╭───────────────┬─────────────────╮
1281 │               │       size      │
1282 │               ├─────┬─────┬─────┤
1283 │               │  1  │  2  │Total│
1284 │               ├─────┼─────┼─────┤
1285 │               │Count│Count│Count│
1286 ├───────────────┼─────┼─────┼─────┤
1287 │class 1 datum 1│    1│     │    1│
1288 │              3│    1│     │    1│
1289 │              5│     │    1│    1│
1290 │     ╶─────────┼─────┼─────┼─────┤
1291 │      2 datum 2│    1│     │    1│
1292 │              4│     │    1│    1│
1293 │              6│     │    1│    1│
1294 ╰───────────────┴─────┴─────┴─────╯
1295 ])
1296 AT_CLEANUP
1297
1298 AT_SETUP([CTABLES sorting categories])
1299 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
1300 AT_DATA([ctables.sps],
1301 [[GET 'nhtsa.sav'.
1302 IF (QND5A=6) QND5A=-1.
1303 IF (QND5A=5) QND5A=-2.
1304 CTABLES /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=A
1305         /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=VALUE ORDER=D
1306         /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=A
1307         /TABLE qnd5a /CATEGORIES VARIABLES=qnd5a KEY=LABEL ORDER=D.
1308 ]])
1309 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1310                                   Custom Tables
1311 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1312 │                                                                        │Count│
1313 ├────────────────────────────────────────────────────────────────────────┼─────┤
1314 │D5a. What would you say is your primary ethnic  -2.00                   │   52│
1315 │background?                                     -1.00                   │   78│
1316 │                                                Cuban                   │   20│
1317 │                                                Mexican                 │  311│
1318 │                                                Spanish                 │   48│
1319 │                                                South American          │   34│
1320 │                                                Central American        │    0│
1321 │                                                Puerto Rican, OR        │    0│
1322 │                                                Something else          │   68│
1323 │                                                Multiple - cannot choose│    7│
1324 │                                                one                     │     │
1325 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1326
1327                                   Custom Tables
1328 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1329 │                                                                        │Count│
1330 ├────────────────────────────────────────────────────────────────────────┼─────┤
1331 │D5a. What would you say is your primary ethnic  Multiple - cannot choose│    7│
1332 │background?                                     one                     │     │
1333 │                                                Something else          │   68│
1334 │                                                Puerto Rican, OR        │    0│
1335 │                                                Central American        │    0│
1336 │                                                South American          │   34│
1337 │                                                Spanish                 │   48│
1338 │                                                Mexican                 │  311│
1339 │                                                Cuban                   │   20│
1340 │                                                -1.00                   │   78│
1341 │                                                -2.00                   │   52│
1342 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1343
1344                                   Custom Tables
1345 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1346 │                                                                        │Count│
1347 ├────────────────────────────────────────────────────────────────────────┼─────┤
1348 │D5a. What would you say is your primary ethnic  Central American        │    0│
1349 │background?                                     Cuban                   │   20│
1350 │                                                Mexican                 │  311│
1351 │                                                Multiple - cannot choose│    7│
1352 │                                                one                     │     │
1353 │                                                Puerto Rican, OR        │    0│
1354 │                                                Something else          │   68│
1355 │                                                South American          │   34│
1356 │                                                Spanish                 │   48│
1357 │                                                -2.00                   │   52│
1358 │                                                -1.00                   │   78│
1359 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1360
1361                                   Custom Tables
1362 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1363 │                                                                        │Count│
1364 ├────────────────────────────────────────────────────────────────────────┼─────┤
1365 │D5a. What would you say is your primary ethnic  Spanish                 │   48│
1366 │background?                                     South American          │   34│
1367 │                                                Something else          │   68│
1368 │                                                Puerto Rican, OR        │    0│
1369 │                                                Multiple - cannot choose│    7│
1370 │                                                one                     │     │
1371 │                                                Mexican                 │  311│
1372 │                                                Cuban                   │   20│
1373 │                                                Central American        │    0│
1374 │                                                -1.00                   │   78│
1375 │                                                -2.00                   │   52│
1376 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1377 ])
1378 AT_CLEANUP
1379
1380 AT_SETUP([CTABLES simple nesting])
1381 AT_KEYWORDS([nest nested])
1382 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
1383 AT_DATA([ctables.sps],
1384 [[GET 'nhtsa.sav'.
1385 CTABLES /TABLE (qn105ba + qn105bb + qn105bc + qn105bd) > qns3a [COUNT, TABLEPCT PCT8.0]
1386   /CATEGORIES VARIABLES=qns3a TOTAL=YES.
1387 CTABLES /TABLE qns3a > (qn105ba + qn105bb + qn105bc + qn105bd) [TABLEPCT PCT8.0]
1388   /CATEGORIES VARIABLES=qns3a TOTAL=YES
1389   /CLABELS ROW=OPPOSITE.
1390 ]])
1391 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1392                                   Custom Tables
1393 ╭─────────────────────────────────────────────────────────────────┬─────┬──────╮
1394 │                                                                 │     │ Table│
1395 │                                                                 │Count│   %  │
1396 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1397 │105b. How likely is it that drivers    Almost     S3a.     Male  │  297│    4%│
1398 │who have had too much to drink to      certain    GENDER:  Female│  403│    6%│
1399 │drive safely will A. Get stopped by                        Total │  700│   10%│
1400 │the police?                           ╶──────────────────────────┼─────┼──────┤
1401 │                                       Very       S3a.     Male  │  660│   10%│
1402 │                                       likely     GENDER:  Female│  842│   12%│
1403 │                                                           Total │ 1502│   22%│
1404 │                                      ╶──────────────────────────┼─────┼──────┤
1405 │                                       Somewhat   S3a.     Male  │ 1174│   17%│
1406 │                                       likely     GENDER:  Female│ 1589│   23%│
1407 │                                                           Total │ 2763│   40%│
1408 │                                      ╶──────────────────────────┼─────┼──────┤
1409 │                                       Somewhat   S3a.     Male  │  640│    9%│
1410 │                                       unlikely   GENDER:  Female│  667│   10%│
1411 │                                                           Total │ 1307│   19%│
1412 │                                      ╶──────────────────────────┼─────┼──────┤
1413 │                                       Very       S3a.     Male  │  311│    5%│
1414 │                                       unlikely   GENDER:  Female│  298│    4%│
1415 │                                                           Total │  609│    9%│
1416 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1417 │105b. How likely is it that drivers    Almost     S3a.     Male  │  429│    6%│
1418 │who have had too much to drink to      certain    GENDER:  Female│  671│   10%│
1419 │drive safely will B. Have an accident?                     Total │ 1100│   16%│
1420 │                                      ╶──────────────────────────┼─────┼──────┤
1421 │                                       Very       S3a.     Male  │ 1104│   16%│
1422 │                                       likely     GENDER:  Female│ 1715│   25%│
1423 │                                                           Total │ 2819│   41%│
1424 │                                      ╶──────────────────────────┼─────┼──────┤
1425 │                                       Somewhat   S3a.     Male  │ 1203│   17%│
1426 │                                       likely     GENDER:  Female│ 1214│   18%│
1427 │                                                           Total │ 2417│   35%│
1428 │                                      ╶──────────────────────────┼─────┼──────┤
1429 │                                       Somewhat   S3a.     Male  │  262│    4%│
1430 │                                       unlikely   GENDER:  Female│  168│    2%│
1431 │                                                           Total │  430│    6%│
1432 │                                      ╶──────────────────────────┼─────┼──────┤
1433 │                                       Very       S3a.     Male  │   81│    1%│
1434 │                                       unlikely   GENDER:  Female│   59│    1%│
1435 │                                                           Total │  140│    2%│
1436 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1437 │105b. How likely is it that drivers    Almost     S3a.     Male  │  539│    8%│
1438 │who have had too much to drink to      certain    GENDER:  Female│  610│    9%│
1439 │drive safely will C. Be convicted for                      Total │ 1149│   17%│
1440 │drunk driving?                        ╶──────────────────────────┼─────┼──────┤
1441 │                                       Very       S3a.     Male  │  988│   14%│
1442 │                                       likely     GENDER:  Female│ 1049│   15%│
1443 │                                                           Total │ 2037│   30%│
1444 │                                      ╶──────────────────────────┼─────┼──────┤
1445 │                                       Somewhat   S3a.     Male  │  822│   12%│
1446 │                                       likely     GENDER:  Female│ 1210│   18%│
1447 │                                                           Total │ 2032│   30%│
1448 │                                      ╶──────────────────────────┼─────┼──────┤
1449 │                                       Somewhat   S3a.     Male  │  446│    7%│
1450 │                                       unlikely   GENDER:  Female│  548│    8%│
1451 │                                                           Total │  994│   15%│
1452 │                                      ╶──────────────────────────┼─────┼──────┤
1453 │                                       Very       S3a.     Male  │  268│    4%│
1454 │                                       unlikely   GENDER:  Female│  354│    5%│
1455 │                                                           Total │  622│    9%│
1456 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1457 │105b. How likely is it that drivers    Almost     S3a.     Male  │  498│    7%│
1458 │who have had too much to drink to      certain    GENDER:  Female│  603│    9%│
1459 │drive safely will D. Be arrested for                       Total │ 1101│   16%│
1460 │drunk driving?                        ╶──────────────────────────┼─────┼──────┤
1461 │                                       Very       S3a.     Male  │  805│   12%│
1462 │                                       likely     GENDER:  Female│ 1029│   15%│
1463 │                                                           Total │ 1834│   27%│
1464 │                                      ╶──────────────────────────┼─────┼──────┤
1465 │                                       Somewhat   S3a.     Male  │  975│   14%│
1466 │                                       likely     GENDER:  Female│ 1332│   19%│
1467 │                                                           Total │ 2307│   34%│
1468 │                                      ╶──────────────────────────┼─────┼──────┤
1469 │                                       Somewhat   S3a.     Male  │  535│    8%│
1470 │                                       unlikely   GENDER:  Female│  560│    8%│
1471 │                                                           Total │ 1095│   16%│
1472 │                                      ╶──────────────────────────┼─────┼──────┤
1473 │                                       Very       S3a.     Male  │  270│    4%│
1474 │                                       unlikely   GENDER:  Female│  279│    4%│
1475 │                                                           Total │  549│    8%│
1476 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1477
1478                                   Custom Tables
1479 ╭─────────────────────────────────┬────────┬──────┬─────────┬─────────┬────────╮
1480 │                                 │ Almost │ Very │ Somewhat│ Somewhat│  Very  │
1481 │                                 │ certain│likely│  likely │ unlikely│unlikely│
1482 │                                 ├────────┼──────┼─────────┼─────────┼────────┤
1483 │                                 │        │ Table│         │         │        │
1484 │                                 │ Table %│   %  │ Table % │ Table % │ Table %│
1485 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1486 │S3a.    Male   105b. How likely  │      4%│   10%│      17%│       9%│      5%│
1487 │GENDER:        is it that drivers│        │      │         │         │        │
1488 │               who have had too  │        │      │         │         │        │
1489 │               much to drink to  │        │      │         │         │        │
1490 │               drive safely will │        │      │         │         │        │
1491 │               A. Get stopped by │        │      │         │         │        │
1492 │               the police?       │        │      │         │         │        │
1493 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1494 │        Female 105b. How likely  │      6%│   12%│      23%│      10%│      4%│
1495 │               is it that drivers│        │      │         │         │        │
1496 │               who have had too  │        │      │         │         │        │
1497 │               much to drink to  │        │      │         │         │        │
1498 │               drive safely will │        │      │         │         │        │
1499 │               A. Get stopped by │        │      │         │         │        │
1500 │               the police?       │        │      │         │         │        │
1501 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1502 │        Total  105b. How likely  │     10%│   22%│      40%│      19%│      9%│
1503 │               is it that drivers│        │      │         │         │        │
1504 │               who have had too  │        │      │         │         │        │
1505 │               much to drink to  │        │      │         │         │        │
1506 │               drive safely will │        │      │         │         │        │
1507 │               A. Get stopped by │        │      │         │         │        │
1508 │               the police?       │        │      │         │         │        │
1509 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1510 │S3a.    Male   105b. How likely  │      6%│   16%│      17%│       4%│      1%│
1511 │GENDER:        is it that drivers│        │      │         │         │        │
1512 │               who have had too  │        │      │         │         │        │
1513 │               much to drink to  │        │      │         │         │        │
1514 │               drive safely will │        │      │         │         │        │
1515 │               B. Have an        │        │      │         │         │        │
1516 │               accident?         │        │      │         │         │        │
1517 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1518 │        Female 105b. How likely  │     10%│   25%│      18%│       2%│      1%│
1519 │               is it that drivers│        │      │         │         │        │
1520 │               who have had too  │        │      │         │         │        │
1521 │               much to drink to  │        │      │         │         │        │
1522 │               drive safely will │        │      │         │         │        │
1523 │               B. Have an        │        │      │         │         │        │
1524 │               accident?         │        │      │         │         │        │
1525 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1526 │        Total  105b. How likely  │     16%│   41%│      35%│       6%│      2%│
1527 │               is it that drivers│        │      │         │         │        │
1528 │               who have had too  │        │      │         │         │        │
1529 │               much to drink to  │        │      │         │         │        │
1530 │               drive safely will │        │      │         │         │        │
1531 │               B. Have an        │        │      │         │         │        │
1532 │               accident?         │        │      │         │         │        │
1533 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1534 │S3a.    Male   105b. How likely  │      8%│   14%│      12%│       7%│      4%│
1535 │GENDER:        is it that drivers│        │      │         │         │        │
1536 │               who have had too  │        │      │         │         │        │
1537 │               much to drink to  │        │      │         │         │        │
1538 │               drive safely will │        │      │         │         │        │
1539 │               C. Be convicted   │        │      │         │         │        │
1540 │               for drunk driving?│        │      │         │         │        │
1541 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1542 │        Female 105b. How likely  │      9%│   15%│      18%│       8%│      5%│
1543 │               is it that drivers│        │      │         │         │        │
1544 │               who have had too  │        │      │         │         │        │
1545 │               much to drink to  │        │      │         │         │        │
1546 │               drive safely will │        │      │         │         │        │
1547 │               C. Be convicted   │        │      │         │         │        │
1548 │               for drunk driving?│        │      │         │         │        │
1549 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1550 │        Total  105b. How likely  │     17%│   30%│      30%│      15%│      9%│
1551 │               is it that drivers│        │      │         │         │        │
1552 │               who have had too  │        │      │         │         │        │
1553 │               much to drink to  │        │      │         │         │        │
1554 │               drive safely will │        │      │         │         │        │
1555 │               C. Be convicted   │        │      │         │         │        │
1556 │               for drunk driving?│        │      │         │         │        │
1557 ├─────────────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1558 │S3a.    Male   105b. How likely  │      7%│   12%│      14%│       8%│      4%│
1559 │GENDER:        is it that drivers│        │      │         │         │        │
1560 │               who have had too  │        │      │         │         │        │
1561 │               much to drink to  │        │      │         │         │        │
1562 │               drive safely will │        │      │         │         │        │
1563 │               D. Be arrested for│        │      │         │         │        │
1564 │               drunk driving?    │        │      │         │         │        │
1565 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1566 │        Female 105b. How likely  │      9%│   15%│      19%│       8%│      4%│
1567 │               is it that drivers│        │      │         │         │        │
1568 │               who have had too  │        │      │         │         │        │
1569 │               much to drink to  │        │      │         │         │        │
1570 │               drive safely will │        │      │         │         │        │
1571 │               D. Be arrested for│        │      │         │         │        │
1572 │               drunk driving?    │        │      │         │         │        │
1573 │       ╶─────────────────────────┼────────┼──────┼─────────┼─────────┼────────┤
1574 │        Total  105b. How likely  │     16%│   27%│      34%│      16%│      8%│
1575 │               is it that drivers│        │      │         │         │        │
1576 │               who have had too  │        │      │         │         │        │
1577 │               much to drink to  │        │      │         │         │        │
1578 │               drive safely will │        │      │         │         │        │
1579 │               D. Be arrested for│        │      │         │         │        │
1580 │               drunk driving?    │        │      │         │         │        │
1581 ╰─────────────────────────────────┴────────┴──────┴─────────┴─────────┴────────╯
1582 ])
1583 AT_CLEANUP
1584
1585 AT_SETUP([CTABLES nesting and scale variables])
1586 AT_KEYWORDS([nest nested])
1587 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
1588 AT_DATA([ctables.sps],
1589 [[GET 'nhtsa.sav'.
1590 CTABLES /TABLE=qnd1 > qn1 BY qns3a.
1591 CTABLES /TABLE=qnd1 [MINIMUM, MAXIMUM, MEAN] > qns3a > (qn26 + qn27).
1592 CTABLES /TABLE=qnsa1 > qn105ba [COLPCT] BY qns1
1593   /CATEGORIES VAR=qnsa1 EMPTY=EXCLUDE.
1594 CTABLES /TABLE=AgeGroup > qn20 [MEAN F8.1, STDDEV F8.1].
1595 ]])
1596 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1597                                   Custom Tables
1598 ╭─────────────────────────────────────────────────────────────────┬────────────╮
1599 │                                                                 │S3a. GENDER:│
1600 │                                                                 ├─────┬──────┤
1601 │                                                                 │ Male│Female│
1602 │                                                                 ├─────┼──────┤
1603 │                                                                 │ Mean│ Mean │
1604 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
1605 │D1. AGE: What   1. How often do you usually drive Every day      │   46│    46│
1606 │is your age?   a car or other motor vehicle?      Several days a │   51│    59│
1607 │                                                  week           │     │      │
1608 │                                                  Once a week or │   44│    54│
1609 │                                                  less           │     │      │
1610 │                                                  Only certain   │   34│    41│
1611 │                                                  times a year   │     │      │
1612 │                                                  Never          │   39│    55│
1613 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
1614
1615                                   Custom Tables
1616 ╭─────────────────────────────────────────────────────────┬───────┬───────┬────╮
1617 │                                                         │Minimum│Maximum│Mean│
1618 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1619 │D1. AGE: S3a.     Male   26. During the last 12       Yes│     16│     86│  42│
1620 │What is  GENDER:         months, has there been a        │       │       │    │
1621 │your                     time when you felt you          │       │       │    │
1622 │age?                     should cut down on your      No │     16│     86│  46│
1623 │                         drinking?                       │       │       │    │
1624 │                 ╶───────────────────────────────────────┼───────┼───────┼────┤
1625 │                  Female 26. During the last 12       Yes│     16│     86│  43│
1626 │                         months, has there been a        │       │       │    │
1627 │                         time when you felt you          │       │       │    │
1628 │                         should cut down on your      No │     16│     86│  48│
1629 │                         drinking?                       │       │       │    │
1630 ├─────────────────────────────────────────────────────────┼───────┼───────┼────┤
1631 │D1. AGE: S3a.     Male   27. During the last 12       Yes│     16│     86│  38│
1632 │What is  GENDER:         months, has there been a        │       │       │    │
1633 │your                     time when people criticized  No │     16│     86│  46│
1634 │age?                     your drinking?                  │       │       │    │
1635 │                 ╶───────────────────────────────────────┼───────┼───────┼────┤
1636 │                  Female 27. During the last 12       Yes│     17│     69│  37│
1637 │                         months, has there been a        │       │       │    │
1638 │                         time when people criticized  No │     16│     86│  48│
1639 │                         your drinking?                  │       │       │    │
1640 ╰─────────────────────────────────────────────────────────┴───────┴───────┴────╯
1641
1642                                   Custom Tables
1643 ╭─────────────────────────────┬────────────────────────────────────────────────╮
1644 │                             │S1. Including yourself, how many members of this│
1645 │                             │         household are age 16 or older?         │
1646 │                             ├──────┬──────┬──────┬──────┬──────┬──────┬──────┤
1647 │                             │      │      │      │      │      │      │ 6 or │
1648 │                             │ None │   1  │   2  │   3  │   4  │   5  │ more │
1649 │                             ├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1650 │                             │Column│Column│Column│Column│Column│Column│Column│
1651 │                             │   %  │   %  │   %  │   %  │   %  │   %  │   %  │
1652 ├─────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
1653 │Sa1.    RDD 105b.    Almost  │     .│  9.5%│  8.2%│ 12.4%│  9.9%│ 20.0%│ 23.8%│
1654 │SAMPLE      How      certain │      │      │      │      │      │      │      │
1655 │SOURCE:     likely           │      │      │      │      │      │      │      │
1656 │            is it    Very    │     .│ 24.9%│ 18.5%│ 24.0%│ 26.6%│ 25.5%│ 33.3%│
1657 │            that     likely  │      │      │      │      │      │      │      │
1658 │            drivers          │      │      │      │      │      │      │      │
1659 │            who have         │      │      │      │      │      │      │      │
1660 │            had too  Somewhat│     .│ 38.3%│ 41.9%│ 38.6%│ 37.5%│ 36.4%│ 23.8%│
1661 │            much to  likely  │      │      │      │      │      │      │      │
1662 │            drink to         │      │      │      │      │      │      │      │
1663 │            drive            │      │      │      │      │      │      │      │
1664 │            safely   Somewhat│     .│ 18.1%│ 21.7%│ 16.8%│ 16.7%│ 10.9%│  9.5%│
1665 │            will A.  unlikely│      │      │      │      │      │      │      │
1666 │            Get              │      │      │      │      │      │      │      │
1667 │            stopped  Very    │     .│  9.2%│  9.7%│  8.2%│  9.4%│  7.3%│  9.5%│
1668 │            by the   unlikely│      │      │      │      │      │      │      │
1669 │            police?          │      │      │      │      │      │      │      │
1670 ╰─────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
1671
1672                                   Custom Tables
1673 ╭──────────────────────────────────────────────────────────────┬────┬──────────╮
1674 │                                                              │    │    Std   │
1675 │                                                              │Mean│ Deviation│
1676 ├──────────────────────────────────────────────────────────────┼────┼──────────┤
1677 │Age    16 to 25 20. On how many of the thirty days in this    │ 5.2│       6.0│
1678 │group           typical month did you have one or more        │    │          │
1679 │                alcoholic beverages to drink?                 │    │          │
1680 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1681 │       26 to 35 20. On how many of the thirty days in this    │ 4.7│       5.9│
1682 │                typical month did you have one or more        │    │          │
1683 │                alcoholic beverages to drink?                 │    │          │
1684 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1685 │       36 to 45 20. On how many of the thirty days in this    │ 5.5│       6.8│
1686 │                typical month did you have one or more        │    │          │
1687 │                alcoholic beverages to drink?                 │    │          │
1688 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1689 │       46 to 55 20. On how many of the thirty days in this    │ 5.8│       7.7│
1690 │                typical month did you have one or more        │    │          │
1691 │                alcoholic beverages to drink?                 │    │          │
1692 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1693 │       56 to 65 20. On how many of the thirty days in this    │ 6.3│       8.2│
1694 │                typical month did you have one or more        │    │          │
1695 │                alcoholic beverages to drink?                 │    │          │
1696 │      ╶───────────────────────────────────────────────────────┼────┼──────────┤
1697 │       66 or    20. On how many of the thirty days in this    │ 7.1│       9.2│
1698 │       older    typical month did you have one or more        │    │          │
1699 │                alcoholic beverages to drink?                 │    │          │
1700 ╰──────────────────────────────────────────────────────────────┴────┴──────────╯
1701 ])
1702 AT_CLEANUP
1703
1704
1705 AT_SETUP([CTABLES SLABELS])
1706 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
1707 AT_DATA([ctables.sps],
1708 [[GET 'nhtsa.sav'.
1709 CTABLES /TABLE qn1 [COUNT COLPCT].
1710 CTABLES /TABLE qn1 [COUNT COLPCT]
1711     /SLABELS POSITION=ROW.
1712 CTABLES /TABLE qn1 [COUNT COLPCT]
1713     /SLABELS POSITION=ROW VISIBLE=NO.
1714 ]])
1715 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1716                                   Custom Tables
1717 ╭────────────────────────────────────────────────────────────────┬─────┬───────╮
1718 │                                                                │     │ Column│
1719 │                                                                │Count│   %   │
1720 ├────────────────────────────────────────────────────────────────┼─────┼───────┤
1721 │ 1. How often do you usually drive a car or  Every day          │ 4667│  66.9%│
1722 │other motor vehicle?                         Several days a week│ 1274│  18.3%│
1723 │                                             Once a week or less│  361│   5.2%│
1724 │                                             Only certain times │  130│   1.9%│
1725 │                                             a year             │     │       │
1726 │                                             Never              │  540│   7.7%│
1727 ╰────────────────────────────────────────────────────────────────┴─────┴───────╯
1728
1729                                   Custom Tables
1730 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1731 │ 1. How often do you usually drive a car or  Every day           Count  │ 4667│
1732 │other motor vehicle?                                             Column │66.9%│
1733 │                                                                 %      │     │
1734 │                                            ╶───────────────────────────┼─────┤
1735 │                                             Several days a week Count  │ 1274│
1736 │                                                                 Column │18.3%│
1737 │                                                                 %      │     │
1738 │                                            ╶───────────────────────────┼─────┤
1739 │                                             Once a week or less Count  │  361│
1740 │                                                                 Column │ 5.2%│
1741 │                                                                 %      │     │
1742 │                                            ╶───────────────────────────┼─────┤
1743 │                                             Only certain times  Count  │  130│
1744 │                                             a year              Column │ 1.9%│
1745 │                                                                 %      │     │
1746 │                                            ╶───────────────────────────┼─────┤
1747 │                                             Never               Count  │  540│
1748 │                                                                 Column │ 7.7%│
1749 │                                                                 %      │     │
1750 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1751
1752                                   Custom Tables
1753 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1754 │ 1. How often do you usually drive a car or other  Every day            │ 4667│
1755 │motor vehicle?                                                          │66.9%│
1756 │                                                   Several days a week  │ 1274│
1757 │                                                                        │18.3%│
1758 │                                                   Once a week or less  │  361│
1759 │                                                                        │ 5.2%│
1760 │                                                   Only certain times a │  130│
1761 │                                                   year                 │ 1.9%│
1762 │                                                   Never                │  540│
1763 │                                                                        │ 7.7%│
1764 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1765 ])
1766 AT_CLEANUP
1767
1768 AT_SETUP([CTABLES simple totals])
1769 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
1770 AT_DATA([ctables.sps],
1771 [[GET 'nhtsa.sav'.
1772 CTABLES /TABLE=qn17
1773     /CATEGORIES VARIABLES=qn17 TOTAL=YES LABEL='Number responding'.
1774 DESCRIPTIVES qn18/STATISTICS=MEAN.
1775 CTABLES /TABLE=region > qn18 [MEAN, COUNT, VALIDN, TOTALN]
1776     /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
1777 ]])
1778 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
1779                                   Custom Tables
1780 ╭────────────────────────────────────────────────────────────────────────┬─────╮
1781 │                                                                        │Count│
1782 ├────────────────────────────────────────────────────────────────────────┼─────┤
1783 │17. When you drink alcoholic beverages, which ONE of  OR, something else│    2│
1784 │the following beverages do you drink MOST OFTEN?      Beer              │ 1073│
1785 │                                                      Light beer        │  620│
1786 │                                                      Wine              │ 1418│
1787 │                                                      Wine coolers      │  137│
1788 │                                                      Hard liquor or    │  888│
1789 │                                                      mixed drinks      │     │
1790 │                                                      Flavored malt     │   83│
1791 │                                                      drinks            │     │
1792 │                                                      Number responding │ 4221│
1793 ╰────────────────────────────────────────────────────────────────────────┴─────╯
1794
1795                              Descriptive Statistics
1796 ╭────────────────────────────────────────────────────────────────────┬────┬────╮
1797 │                                                                    │  N │Mean│
1798 ├────────────────────────────────────────────────────────────────────┼────┼────┤
1799 │18. When you drink ANSWERFROM(QN17R1), about how many               │4218│4.62│
1800 │ANSWERFROM(QN17R2) do you usually drink per sitting?                │    │    │
1801 │Valid N (listwise)                                                  │6999│    │
1802 │Missing N (listwise)                                                │2781│    │
1803 ╰────────────────────────────────────────────────────────────────────┴────┴────╯
1804
1805                                   Custom Tables
1806 ╭──────────────────────────────────────────────────────┬────┬─────┬──────┬─────╮
1807 │                                                      │    │     │ Valid│Total│
1808 │                                                      │Mean│Count│   N  │  N  │
1809 ├──────────────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1810 │Region NE       18. When you drink ANSWERFROM(QN17R1),│4.36│ 1409│   949│ 1409│
1811 │                about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1812 │                you usually drink per sitting?        │    │     │      │     │
1813 │      ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1814 │       MW       18. When you drink ANSWERFROM(QN17R1),│4.67│ 1654│  1027│ 1654│
1815 │                about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1816 │                you usually drink per sitting?        │    │     │      │     │
1817 │      ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1818 │       S        18. When you drink ANSWERFROM(QN17R1),│4.71│ 2390│  1287│ 2390│
1819 │                about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1820 │                you usually drink per sitting?        │    │     │      │     │
1821 │      ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1822 │       W        18. When you drink ANSWERFROM(QN17R1),│4.69│ 1546│   955│ 1546│
1823 │                about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1824 │                you usually drink per sitting?        │    │     │      │     │
1825 │      ╶───────────────────────────────────────────────┼────┼─────┼──────┼─────┤
1826 │       All      18. When you drink ANSWERFROM(QN17R1),│4.62│ 6999│  4218│ 6999│
1827 │       regions  about how many ANSWERFROM(QN17R2) do  │    │     │      │     │
1828 │                you usually drink per sitting?        │    │     │      │     │
1829 ╰──────────────────────────────────────────────────────┴────┴─────┴──────┴─────╯
1830 ])
1831 AT_CLEANUP
1832
1833 AT_SETUP([CTABLES subtotals])
1834 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
1835 AT_DATA([ctables.sps],
1836 [[GET 'nhtsa.sav'.
1837 CTABLES /TABLE=qn105ba BY qns1
1838     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1839 CTABLES /TABLE=qn105ba [COLPCT] BY qns1
1840     /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL].
1841 CTABLES /TABLE=qn105ba BY qns1
1842     /CATEGORIES VARIABLES=qn105ba [1, 2, 3, SUBTOTAL, 4, 5, SUBTOTAL]
1843     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, SUBTOTAL].
1844 ]])
1845 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
1846                                                       Custom Tables
1847 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1848 │                                                         │ S1. Including yourself, how many members of this household │
1849 │                                                         │                    are age 16 or older?                    │
1850 │                                                         ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1851 │                                                         │   1   │   2   │ Subtotal│   3   │    4   │   5  │ Subtotal │
1852 │                                                         ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1853 │                                                         │ Count │ Count │  Count  │ Count │  Count │ Count│   Count  │
1854 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1855 │105b. How likely is it that drivers who have  Almost     │    147│    246│      393│     62│      19│    11│        92│
1856 │had too much to drink to drive safely will A. certain    │       │       │         │       │        │      │          │
1857 │Get stopped by the police?                    Very likely│    384│    552│      936│    120│      51│    14│       185│
1858 │                                              Somewhat   │    590│   1249│     1839│    193│      72│    20│       285│
1859 │                                              likely     │       │       │         │       │        │      │          │
1860 │                                              Somewhat   │    278│    647│      925│     84│      32│     6│       122│
1861 │                                              unlikely   │       │       │         │       │        │      │          │
1862 │                                              Very       │    141│    290│      431│     41│      18│     4│        63│
1863 │                                              unlikely   │       │       │         │       │        │      │          │
1864 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1865
1866                                                       Custom Tables
1867 ╭────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────╮
1868 │                                                        │  S1. Including yourself, how many members of this household │
1869 │                                                        │                     are age 16 or older?                    │
1870 │                                                        ├────────┬────────┬────────┬────────┬───────┬────────┬────────┤
1871 │                                                        │        │        │        │        │       │        │  6 or  │
1872 │                                                        │  None  │    1   │    2   │    3   │   4   │    5   │  more  │
1873 │                                                        ├────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1874 │                                                        │        │        │        │        │ Column│        │        │
1875 │                                                        │Column %│Column %│Column %│Column %│   %   │Column %│Column %│
1876 ├────────────────────────────────────────────────────────┼────────┼────────┼────────┼────────┼───────┼────────┼────────┤
1877 │105b. How likely is it that drivers who have Almost     │       .│    9.5%│    8.2%│   12.4%│   9.9%│   20.0%│   23.8%│
1878 │had too much to drink to drive safely will   certain    │        │        │        │        │       │        │        │
1879 │A. Get stopped by the police?                Very likely│       .│   24.9%│   18.5%│   24.0%│  26.6%│   25.5%│   33.3%│
1880 │                                             Somewhat   │       .│   38.3%│   41.9%│   38.6%│  37.5%│   36.4%│   23.8%│
1881 │                                             likely     │        │        │        │        │       │        │        │
1882 │                                             Subtotal   │        │   72.8%│   68.6%│   75.0%│  74.0%│   81.8%│   81.0%│
1883 │                                             Somewhat   │       .│   18.1%│   21.7%│   16.8%│  16.7%│   10.9%│    9.5%│
1884 │                                             unlikely   │        │        │        │        │       │        │        │
1885 │                                             Very       │       .│    9.2%│    9.7%│    8.2%│   9.4%│    7.3%│    9.5%│
1886 │                                             unlikely   │        │        │        │        │       │        │        │
1887 │                                             Subtotal   │        │   27.2%│   31.4%│   25.0%│  26.0%│   18.2%│   19.0%│
1888 ╰────────────────────────────────────────────────────────┴────────┴────────┴────────┴────────┴───────┴────────┴────────╯
1889
1890                                                       Custom Tables
1891 ╭─────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────╮
1892 │                                                         │ S1. Including yourself, how many members of this household │
1893 │                                                         │                    are age 16 or older?                    │
1894 │                                                         ├───────┬───────┬─────────┬───────┬────────┬──────┬──────────┤
1895 │                                                         │   1   │   2   │ Subtotal│   3   │    4   │   5  │ Subtotal │
1896 │                                                         ├───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1897 │                                                         │ Count │ Count │  Count  │ Count │  Count │ Count│   Count  │
1898 ├─────────────────────────────────────────────────────────┼───────┼───────┼─────────┼───────┼────────┼──────┼──────────┤
1899 │105b. How likely is it that drivers who have  Almost     │    147│    246│      393│     62│      19│    11│        92│
1900 │had too much to drink to drive safely will A. certain    │       │       │         │       │        │      │          │
1901 │Get stopped by the police?                    Very likely│    384│    552│      936│    120│      51│    14│       185│
1902 │                                              Somewhat   │    590│   1249│     1839│    193│      72│    20│       285│
1903 │                                              likely     │       │       │         │       │        │      │          │
1904 │                                              Subtotal   │   1121│   2047│     3168│    375│     142│    45│       562│
1905 │                                              Somewhat   │    278│    647│      925│     84│      32│     6│       122│
1906 │                                              unlikely   │       │       │         │       │        │      │          │
1907 │                                              Very       │    141│    290│      431│     41│      18│     4│        63│
1908 │                                              unlikely   │       │       │         │       │        │      │          │
1909 │                                              Subtotal   │    419│    937│     1356│    125│      50│    10│       185│
1910 ╰─────────────────────────────────────────────────────────┴───────┴───────┴─────────┴───────┴────────┴──────┴──────────╯
1911 ])
1912 AT_CLEANUP
1913
1914 AT_SETUP([CTABLES PCOMPUTE])
1915 AT_KEYWORDS([postcompute])
1916 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
1917 AT_DATA([ctables.sps],
1918 [[GET 'nhtsa.sav'.
1919 CTABLES
1920     /PCOMPUTE &x=EXPR([3] + [4])
1921     /PCOMPUTE &y=EXPR([4] + [5])
1922     /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1923     /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]'
1924     /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1925     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1926
1927 * Adding HIDESOURCECATS=YES for one PPROPERTIES.
1928 CTABLES
1929     /PCOMPUTE &x=EXPR([3] + [4])
1930     /PCOMPUTE &y=EXPR([4] + [5])
1931     /PPROPERTIES &x LABEL='3+4' FORMAT=COUNT F8.2
1932     /PPROPERTIES &y LABEL=')LABEL[5]+)LABEL[6]' HIDESOURCECATS=YES
1933     /TABLE=qn105ba [COUNT, ROWPCT] BY qns1
1934     /CATEGORIES VARIABLES=qns1 [1, 2, SUBTOTAL, 3, 4, 5, &x, &y, SUBTOTAL] TOTAL=YES
1935 ]])
1936 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
1937                                                                 Custom Tables
1938 ╭───────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
1939 │                   │                    S1. Including yourself, how many members of this household are age 16 or older?                   │
1940 │                   ├───────────┬───────────┬───────────┬───────────┬──────────┬──────────┬────────────┬──────────┬───────────┬────────────┤
1941 │                   │     1     │     2     │  Subtotal │     3     │     4    │     5    │     3+4    │    4+5   │  Subtotal │    Total   │
1942 │                   ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼─────┬────┼─────┬────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1943 │                   │     │     │     │     │     │     │     │     │     │ Row│     │ Row│      │     │     │ Row│     │     │     │      │
1944 │                   │Count│Row %│Count│Row %│Count│Row %│Count│Row %│Count│  % │Count│  % │ Count│Row %│Count│  % │Count│Row %│Count│ Row %│
1945 ├───────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼────┼─────┼────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1946 │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%│
1947 │likely is  certain │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1948 │it that            │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1949 │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%│
1950 │who have   likely  │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1951 │had too            │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1952 │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%│
1953 │drink to   likely  │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1954 │drive              │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1955 │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%│
1956 │will A.    unlikely│     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1957 │Get                │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1958 │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%│
1959 │the        unlikely│     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1960 │police?            │     │     │     │     │     │     │     │     │     │    │     │    │      │     │     │    │     │     │     │      │
1961 ╰───────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴────┴─────┴────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1962
1963                                                                 Custom Tables
1964 ╭─────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────╮
1965 │                                         │         S1. Including yourself, how many members of this household are age 16 or older?        │
1966 │                                         ├───────────┬───────────┬───────────┬───────────┬────────────┬──────────┬───────────┬────────────┤
1967 │                                         │     1     │     2     │  Subtotal │     3     │     3+4    │    4+5   │  Subtotal │    Total   │
1968 │                                         ├─────┬─────┼─────┬─────┼─────┬─────┼─────┬─────┼──────┬─────┼─────┬────┼─────┬─────┼─────┬──────┤
1969 │                                         │     │     │     │     │     │     │     │     │      │     │     │ Row│     │     │     │      │
1970 │                                         │Count│Row %│Count│Row %│Count│Row %│Count│Row %│ Count│Row %│Count│  % │Count│Row %│Count│ Row %│
1971 ├─────────────────────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼──────┼─────┼─────┼────┼─────┼─────┼─────┼──────┤
1972 │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%│
1973 │drivers who have had too much  certain   │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1974 │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%│
1975 │A. Get stopped by the police?  likely    │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1976 │                               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%│
1977 │                               likely    │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1978 │                               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%│
1979 │                               unlikely  │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1980 │                               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%│
1981 │                               unlikely  │     │     │     │     │     │     │     │     │      │     │     │    │     │     │     │      │
1982 ╰─────────────────────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴──────┴─────┴─────┴────┴─────┴─────┴─────┴──────╯
1983 ])
1984 AT_CLEANUP
1985
1986 AT_SETUP([CTABLES PCOMPUTE - OTHERNM and MISSING])
1987 AT_KEYWORDS([postcompute])
1988 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
1989 AT_DATA([ctables.sps],
1990 [[GET 'nhtsa.sav'.
1991 CTABLES
1992     /PCOMPUTE &x=EXPR(OTHERNM)
1993     /PCOMPUTE &y=EXPR(MISSING)
1994     /PPROPERTIES &x LABEL='Drivers'
1995     /PPROPERTIES &y LABEL='Missing Values 2'
1996     /TABLE=qn1 BY qns3a
1997     /CATEGORIES VARIABLES=qn1 [OTHERNM, 5, &x, SUBTOTAL='Valid Values', MISSING, SUBTOTAL='Missing Values', &y]
1998 ]])
1999 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
2000                                               Custom Tables
2001 ╭──────────────────────────────────────────────────────────────────────────────────────────┬────────────╮
2002 │                                                                                          │S3a. GENDER:│
2003 │                                                                                          ├─────┬──────┤
2004 │                                                                                          │ Male│Female│
2005 │                                                                                          ├─────┼──────┤
2006 │                                                                                          │Count│ Count│
2007 ├──────────────────────────────────────────────────────────────────────────────────────────┼─────┼──────┤
2008 │ 1. How often do you usually drive a car or other motor vehicle? Every day                │ 2305│  2362│
2009 │                                                                 Several days a week      │  440│   834│
2010 │                                                                 Once a week or less      │  125│   236│
2011 │                                                                 Only certain times a year│   58│    72│
2012 │                                                                 Never                    │  192│   348│
2013 │                                                                 Drivers                  │ 2928│  3504│
2014 │                                                                 Valid Values             │ 3120│  3852│
2015 │                                                                 Don't know               │    3│     5│
2016 │                                                                 Refused                  │    9│    10│
2017 │                                                                 Missing Values           │   12│    15│
2018 │                                                                 Missing Values 2         │   12│    15│
2019 ╰──────────────────────────────────────────────────────────────────────────────────────────┴─────┴──────╯
2020 ])
2021 AT_CLEANUP
2022
2023 AT_SETUP([CTABLES PCOMPUTE - THRU])
2024 AT_KEYWORDS([postcompute])
2025 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
2026 AT_DATA([ctables.sps],
2027 [[GET 'nhtsa.sav'.
2028 CTABLES
2029     /PCOMPUTE &x=EXPR([1 THRU 2])
2030     /PCOMPUTE &y=EXPR([3 THRU 4])
2031     /PCOMPUTE &z=EXPR([5] + MISSING)
2032     /PPROPERTIES &x LABEL='Frequent Drivers'
2033     /PPROPERTIES &y LABEL='Infrequent Drivers'
2034     /PPROPERTIES &z LABEL='Not Drivers or Missing'
2035     /TABLE=qn1 BY qns3a
2036     /CATEGORIES VARIABLES=qn1 [1 THRU 2, &x, 3 THRU 4, &y, SUBTOTAL='Drivers', 5, MISSING, &z]
2037 ]])
2038 AT_CHECK([pspp ctables.sps -O box=unicode -O width=140], [0], [dnl
2039                                               Custom Tables
2040 ╭──────────────────────────────────────────────────────────────────────────────────────────┬────────────╮
2041 │                                                                                          │S3a. GENDER:│
2042 │                                                                                          ├─────┬──────┤
2043 │                                                                                          │ Male│Female│
2044 │                                                                                          ├─────┼──────┤
2045 │                                                                                          │Count│ Count│
2046 ├──────────────────────────────────────────────────────────────────────────────────────────┼─────┼──────┤
2047 │ 1. How often do you usually drive a car or other motor vehicle? Every day                │ 2305│  2362│
2048 │                                                                 Several days a week      │  440│   834│
2049 │                                                                 Frequent Drivers         │ 2745│  3196│
2050 │                                                                 Once a week or less      │  125│   236│
2051 │                                                                 Only certain times a year│   58│    72│
2052 │                                                                 Infrequent Drivers       │  183│   308│
2053 │                                                                 Drivers                  │ 2928│  3504│
2054 │                                                                 Never                    │  192│   348│
2055 │                                                                 Don't know               │    3│     5│
2056 │                                                                 Refused                  │    9│    10│
2057 │                                                                 Not Drivers or Missing   │  204│   363│
2058 ╰──────────────────────────────────────────────────────────────────────────────────────────┴─────┴──────╯
2059 ])
2060 AT_CLEANUP
2061
2062 dnl I'm not sure that this is the correct behavior (see
2063 dnl https://mail.gnu.org/archive/html/pspp-users/2022-07/msg00002.html)
2064 dnl but at least this test will notify us if the behavior changes.
2065 AT_SETUP([CTABLES intersecting PCOMPUTEs])
2066 AT_KEYWORDS([PCOMPUTE postcompute])
2067 AT_DATA([ctables.sps],
2068 [[DATA LIST LIST NOTABLE/x y z.
2069 WEIGHT by z.
2070 FORMATS ALL (F1.0).
2071 VARIABLE LEVEL x y (NOMINAL).
2072 BEGIN DATA.
2073 1 4 5
2074 1 5 2
2075 1 6 9
2076 2 4 2
2077 2 5 3
2078 2 6 4
2079 3 4 1
2080 3 5 6
2081 3 6 1
2082 END DATA.
2083
2084 CTABLES
2085     /PCOMPUTE &a = EXPR([1] + [2])
2086     /PCOMPUTE &b = EXPR([2] + [3])
2087     /PCOMPUTE &c = EXPR([4] * [5])
2088     /PCOMPUTE &d = EXPR([5] * [6])
2089     /TABLE x BY y
2090     /CATEGORIES VARIABLES=x [1, &a, 2, &b, 3]
2091     /CATEGORIES VARIABLES=y [4, &c, 5, &d, 6].
2092 ]])
2093 AT_CHECK([pspp ctables.sps -O box=unicode], [0],
2094 [[                   Custom Tables
2095 ╭───────────┬─────────────────────────────────────╮
2096 │           │                  y                  │
2097 │           ├─────┬─────────┬─────┬─────────┬─────┤
2098 │           │  4  │[4] * [5]│  5  │[5] * [6]│  6  │
2099 │           ├─────┼─────────┼─────┼─────────┼─────┤
2100 │           │Count│  Count  │Count│  Count  │Count│
2101 ├───────────┼─────┼─────────┼─────┼─────────┼─────┤
2102 │x 1        │    5│       10│    2│       18│    9│
2103 │  [1] + [2]│    7│        .│    5│        .│   13│
2104 │  2        │    2│        6│    3│       12│    4│
2105 │  [2] + [3]│    3│        .│    9│        .│    5│
2106 │  3        │    1│        6│    6│        6│    1│
2107 ╰───────────┴─────┴─────────┴─────┴─────────┴─────╯
2108 ]])
2109 AT_CLEANUP
2110
2111 AT_SETUP([CTABLES string and date and time])
2112
2113 weight=1
2114 for gender in F M; do
2115     for month in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do
2116         for wkday in Sun Mon Tue Wed Thu Fri Sat Sun; do
2117             printf "$weight $gender $month $wkday\n"
2118             weight=$(expr \( $weight + 3 \) % 7 + 2)
2119         done
2120     done
2121 done > ctables.txt
2122
2123 AT_DATA([ctables.sps],
2124 [[DATA LIST LIST NOTABLE FILE='ctables.txt'
2125     /w (F5.0) gender (A1) fmon (MONTH3) fday (WKDAY3).
2126 WEIGHT by w.
2127 VARIABLE LEVEL w (SCALE).
2128 VARIABLE LEVEL gender fmon fday (NOMINAL).
2129 VARIABLE LABEL
2130   gender 'Gender'
2131   fmon 'Favorite month'
2132   fday 'Favorite day of the week'.
2133 VALUE LABELS /gender 'M' 'Male' 'F' 'Female'.
2134 CTABLES
2135     /PCOMPUTE &q2 = EXPR(['APR' THRU 'June'])
2136     /PPROPERTIES &q2 LABEL='Q2'
2137     /PCOMPUTE &weekend = EXPR(['sun'] + ['Sat'])
2138     /PPROPERTIES &weekend LABEL='Weekend'
2139     /TABLE fmon BY gender > fday
2140     /CATEGORIES VARIABLES=fmon ['JAN', 'FEB', 'Mar', SUBTOTAL="Q1",
2141                                 4 THRU 6, &q2,
2142                                 'JUL' THRU 'sep', SUBTOTAL="Q3",
2143                                 OTHERNM, SUBTOTAL='Q4']
2144     /CATEGORIES VARIABLES=gender ['M', 'F']
2145     /CATEGORIES VARIABLE=fday ['Sun', 2 THRU 6, 'Sat', &weekend] TOTAL=YES
2146     /SLABELS VISIBLE=NO.
2147 ]])
2148 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2149                                               Custom Tables
2150 ╭──────────────────┬───────────────────────────────────────────────────────────────────────────────────╮
2151 │                  │                                       Gender                                      │
2152 │                  ├─────────────────────────────────────────┬─────────────────────────────────────────┤
2153 │                  │                   Male                  │                  Female                 │
2154 │                  ├─────────────────────────────────────────┼─────────────────────────────────────────┤
2155 │                  │         Favorite day of the week        │         Favorite day of the week        │
2156 │                  ├───┬───┬───┬───┬───┬───┬───┬───────┬─────┼───┬───┬───┬───┬───┬───┬───┬───────┬─────┤
2157 │                  │SUN│MON│TUE│WED│THU│FRI│SAT│Weekend│Total│SUN│MON│TUE│WED│THU│FRI│SAT│Weekend│Total│
2158 ├──────────────────┼───┼───┼───┼───┼───┼───┼───┼───────┼─────┼───┼───┼───┼───┼───┼───┼───┼───────┼─────┤
2159 │Favorite month JAN│ 10│  3│  8│  6│  4│  2│  7│     17│   40│  9│  6│  4│  2│  7│  5│  3│     12│   36│
2160 │               FEB│  6│  8│  6│  4│  2│  7│  5│     11│   38│ 12│  4│  2│  7│  5│  3│  8│     20│   41│
2161 │               MAR│ 16│  6│  4│  2│  7│  5│  3│     19│   43│  8│  2│  7│  5│  3│  8│  6│     14│   39│
2162 │               Q1 │ 32│ 17│ 18│ 12│ 13│ 14│ 15│       │     │ 29│ 12│ 13│ 14│ 15│ 16│ 17│       │     │
2163 │               APR│ 12│  4│  2│  7│  5│  3│  8│     20│   41│  4│  7│  5│  3│  8│  6│  4│      8│   37│
2164 │               MAY│  8│  2│  7│  5│  3│  8│  6│     14│   39│ 14│  5│  3│  8│  6│  4│  2│     16│   42│
2165 │               JUN│  4│  7│  5│  3│  8│  6│  4│      8│   37│ 10│  3│  8│  6│  4│  2│  7│     17│   40│
2166 │               Q2 │ 24│ 13│ 14│ 15│ 16│ 17│ 18│      .│     │ 28│ 15│ 16│ 17│ 18│ 12│ 13│      .│     │
2167 │               JUL│ 14│  5│  3│  8│  6│  4│  2│     16│   42│  6│  8│  6│  4│  2│  7│  5│     11│   38│
2168 │               AUG│ 10│  3│  8│  6│  4│  2│  7│     17│   40│ 16│  6│  4│  2│  7│  5│  3│     19│   43│
2169 │               SEP│  6│  8│  6│  4│  2│  7│  5│     11│   38│ 12│  4│  2│  7│  5│  3│  8│     20│   41│
2170 │               Q3 │ 54│ 29│ 31│ 33│ 28│ 30│ 32│       │     │ 62│ 33│ 28│ 30│ 32│ 27│ 29│       │     │
2171 │               OCT│ 16│  6│  4│  2│  7│  5│  3│     19│   43│  8│  2│  7│  5│  3│  8│  6│     14│   39│
2172 │               NOV│ 12│  4│  2│  7│  5│  3│  8│     20│   41│  4│  7│  5│  3│  8│  6│  4│      8│   37│
2173 │               DEC│  8│  2│  7│  5│  3│  8│  6│     14│   39│ 14│  5│  3│  8│  6│  4│  2│     16│   42│
2174 │               Q4 │ 36│ 12│ 13│ 14│ 15│ 16│ 17│       │     │ 26│ 14│ 15│ 16│ 17│ 18│ 12│       │     │
2175 ╰──────────────────┴───┴───┴───┴───┴───┴───┴───┴───────┴─────┴───┴───┴───┴───┴───┴───┴───┴───────┴─────╯
2176 ])
2177 AT_CLEANUP
2178
2179 AT_SETUP([CTABLES CLABELS])
2180 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
2181 AT_DATA([ctables.sps],
2182 [[GET 'nhtsa.sav'.
2183 CTABLES /TABLE AgeGroup BY qns3a.
2184 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
2185 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
2186 CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
2187 CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
2188 ]])
2189 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
2190              Custom Tables
2191 ╭───────────────────────┬────────────╮
2192 │                       │S3a. GENDER:│
2193 │                       ├─────┬──────┤
2194 │                       │ Male│Female│
2195 │                       ├─────┼──────┤
2196 │                       │Count│ Count│
2197 ├───────────────────────┼─────┼──────┤
2198 │Age group 15 or younger│    0│     0│
2199 │          16 to 25     │  594│   505│
2200 │          26 to 35     │  476│   491│
2201 │          36 to 45     │  489│   548│
2202 │          46 to 55     │  526│   649│
2203 │          56 to 65     │  516│   731│
2204 │          66 or older  │  531│   943│
2205 ╰───────────────────────┴─────┴──────╯
2206
2207                                                       Custom Tables
2208 ╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
2209 │       │                                                 S3a. GENDER:                                                 │
2210 │       ├──────────────────────────────────────────────────────┬───────────────────────────────────────────────────────┤
2211 │       │                         Male                         │                         Female                        │
2212 │       ├─────────┬───────┬──────┬──────┬──────┬───────┬───────┼──────────┬──────┬───────┬──────┬──────┬──────┬────────┤
2213 │       │  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 │
2214 │       │ younger │   25  │  35  │  45  │  55  │   65  │ older │  younger │  25  │   35  │  45  │  55  │  65  │  older │
2215 │       ├─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
2216 │       │  Count  │ Count │ Count│ Count│ Count│ Count │ Count │   Count  │ Count│ Count │ Count│ Count│ Count│  Count │
2217 ├───────┼─────────┼───────┼──────┼──────┼──────┼───────┼───────┼──────────┼──────┼───────┼──────┼──────┼──────┼────────┤
2218 │Age    │        0│    594│   476│   489│   526│    516│    531│         0│   505│    491│   548│   649│   731│     943│
2219 │group  │         │       │      │      │      │       │       │          │      │       │      │      │      │        │
2220 ╰───────┴─────────┴───────┴──────┴──────┴──────┴───────┴───────┴──────────┴──────┴───────┴──────┴──────┴──────┴────────╯
2221
2222                 Custom Tables
2223 ╭──────────────────────────────┬────────────╮
2224 │                              │S3a. GENDER:│
2225 │                              ├────────────┤
2226 │                              │    Count   │
2227 ├──────────────────────────────┼────────────┤
2228 │Age group 15 or younger Male  │           0│
2229 │                        Female│           0│
2230 │         ╶────────────────────┼────────────┤
2231 │          16 to 25      Male  │         594│
2232 │                        Female│         505│
2233 │         ╶────────────────────┼────────────┤
2234 │          26 to 35      Male  │         476│
2235 │                        Female│         491│
2236 │         ╶────────────────────┼────────────┤
2237 │          36 to 45      Male  │         489│
2238 │                        Female│         548│
2239 │         ╶────────────────────┼────────────┤
2240 │          46 to 55      Male  │         526│
2241 │                        Female│         649│
2242 │         ╶────────────────────┼────────────┤
2243 │          56 to 65      Male  │         516│
2244 │                        Female│         731│
2245 │         ╶────────────────────┼────────────┤
2246 │          66 or older   Male  │         531│
2247 │                        Female│         943│
2248 ╰──────────────────────────────┴────────────╯
2249
2250       Custom Tables
2251 15 or younger
2252 ╭─────────┬────────────╮
2253 │         │S3a. GENDER:│
2254 │         ├─────┬──────┤
2255 │         │ Male│Female│
2256 │         ├─────┼──────┤
2257 │         │Count│ Count│
2258 ├─────────┼─────┼──────┤
2259 │Age group│    0│     0│
2260 ╰─────────┴─────┴──────╯
2261
2262       Custom Tables
2263 16 to 25
2264 ╭─────────┬────────────╮
2265 │         │S3a. GENDER:│
2266 │         ├─────┬──────┤
2267 │         │ Male│Female│
2268 │         ├─────┼──────┤
2269 │         │Count│ Count│
2270 ├─────────┼─────┼──────┤
2271 │Age group│  594│   505│
2272 ╰─────────┴─────┴──────╯
2273
2274       Custom Tables
2275 26 to 35
2276 ╭─────────┬────────────╮
2277 │         │S3a. GENDER:│
2278 │         ├─────┬──────┤
2279 │         │ Male│Female│
2280 │         ├─────┼──────┤
2281 │         │Count│ Count│
2282 ├─────────┼─────┼──────┤
2283 │Age group│  476│   491│
2284 ╰─────────┴─────┴──────╯
2285
2286       Custom Tables
2287 36 to 45
2288 ╭─────────┬────────────╮
2289 │         │S3a. GENDER:│
2290 │         ├─────┬──────┤
2291 │         │ Male│Female│
2292 │         ├─────┼──────┤
2293 │         │Count│ Count│
2294 ├─────────┼─────┼──────┤
2295 │Age group│  489│   548│
2296 ╰─────────┴─────┴──────╯
2297
2298       Custom Tables
2299 46 to 55
2300 ╭─────────┬────────────╮
2301 │         │S3a. GENDER:│
2302 │         ├─────┬──────┤
2303 │         │ Male│Female│
2304 │         ├─────┼──────┤
2305 │         │Count│ Count│
2306 ├─────────┼─────┼──────┤
2307 │Age group│  526│   649│
2308 ╰─────────┴─────┴──────╯
2309
2310       Custom Tables
2311 56 to 65
2312 ╭─────────┬────────────╮
2313 │         │S3a. GENDER:│
2314 │         ├─────┬──────┤
2315 │         │ Male│Female│
2316 │         ├─────┼──────┤
2317 │         │Count│ Count│
2318 ├─────────┼─────┼──────┤
2319 │Age group│  516│   731│
2320 ╰─────────┴─────┴──────╯
2321
2322       Custom Tables
2323 66 or older
2324 ╭─────────┬────────────╮
2325 │         │S3a. GENDER:│
2326 │         ├─────┬──────┤
2327 │         │ Male│Female│
2328 │         ├─────┼──────┤
2329 │         │Count│ Count│
2330 ├─────────┼─────┼──────┤
2331 │Age group│  531│   943│
2332 ╰─────────┴─────┴──────╯
2333
2334              Custom Tables
2335 Male
2336 ╭───────────────────────┬────────────╮
2337 │                       │S3a. GENDER:│
2338 │                       ├────────────┤
2339 │                       │    Count   │
2340 ├───────────────────────┼────────────┤
2341 │Age group 15 or younger│           0│
2342 │          16 to 25     │         594│
2343 │          26 to 35     │         476│
2344 │          36 to 45     │         489│
2345 │          46 to 55     │         526│
2346 │          56 to 65     │         516│
2347 │          66 or older  │         531│
2348 ╰───────────────────────┴────────────╯
2349
2350              Custom Tables
2351 Female
2352 ╭───────────────────────┬────────────╮
2353 │                       │S3a. GENDER:│
2354 │                       ├────────────┤
2355 │                       │    Count   │
2356 ├───────────────────────┼────────────┤
2357 │Age group 15 or younger│           0│
2358 │          16 to 25     │         505│
2359 │          26 to 35     │         491│
2360 │          36 to 45     │         548│
2361 │          46 to 55     │         649│
2362 │          56 to 65     │         731│
2363 │          66 or older  │         943│
2364 ╰───────────────────────┴────────────╯
2365 ])
2366 AT_CLEANUP
2367
2368 AT_SETUP([CTABLES missing values])
2369 AT_DATA([ctables.sps],
2370 [[DATA LIST LIST NOTABLE/x y.
2371 BEGIN DATA.
2372 1 1
2373 1 2
2374 1 3
2375 1 4
2376 1 5
2377 1 .
2378 2 1
2379 2 2
2380 2 3
2381 2 4
2382 2 5
2383 2 .
2384 3 1
2385 3 2
2386 3 3
2387 3 4
2388 3 5
2389 3 .
2390 4 1
2391 4 2
2392 4 3
2393 4 4
2394 4 5
2395 4 .
2396 5 1
2397 5 2
2398 5 3
2399 5 4
2400 5 5
2401 5 .
2402 . 1
2403 . 2
2404 . 3
2405 . 4
2406 . 5
2407 . .
2408 END DATA.
2409 MISSING VALUES x (1, 2) y (2, 3).
2410 VARIABLE LEVEL ALL (NOMINAL).
2411
2412 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
2413                  TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
2414     /CATEGORIES VARIABLES=ALL TOTAL=YES.
2415 CTABLES /TABLE x[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN,
2416                  TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, VALIDN, TOTALN]]
2417     /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE.
2418 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2419                       TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2420     /CATEGORIES VARIABLES=ALL TOTAL=YES
2421     /SLABELS POSITION=ROW.
2422 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2423                       TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2424     /CATEGORIES VARIABLES=ALL TOTAL=YES MISSING=INCLUDE
2425     /SLABELS POSITION=ROW.
2426 CTABLES /TABLE x BY y[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN,
2427                       TOTALS[COUNT, COLPCT, COLPCT.VALIDN, COLPCT.TOTALN, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, VALIDN, TOTALN]]
2428     /CATEGORIES VARIABLES=x [1, 2, 3, 4] TOTAL=YES 
2429     /CATEGORIES VARIABLES=y [1, 3, 4, 5] TOTAL=YES 
2430     /SLABELS POSITION=ROW.
2431 ]])
2432 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2433                                Custom Tables
2434 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
2435 │       │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
2436 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
2437 │x 3.00 │    6│   33.3%│           33.3%│           16.7%│       │       │
2438 │  4.00 │    6│   33.3%│           33.3%│           16.7%│       │       │
2439 │  5.00 │    6│   33.3%│           33.3%│           16.7%│       │       │
2440 │  Total│   18│  100.0%│          100.0%│          100.0%│     18│     36│
2441 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
2442 dnl Note that Column Total N % doesn't add up to 100 because missing
2443 dnl values are included in the total but not shown as a category and this
2444 dnl is expected behavior.
2445
2446                                Custom Tables
2447 ╭───────┬─────┬────────┬────────────────┬────────────────┬───────┬───────╮
2448 │       │Count│Column %│Column Valid N %│Column Total N %│Valid N│Total N│
2449 ├───────┼─────┼────────┼────────────────┼────────────────┼───────┼───────┤
2450 │x 1.00 │    6│   20.0%│             .0%│           16.7%│       │       │
2451 │  2.00 │    6│   20.0%│             .0%│           16.7%│       │       │
2452 │  3.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
2453 │  4.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
2454 │  5.00 │    6│   20.0%│           33.3%│           16.7%│       │       │
2455 │  Total│   30│  100.0%│          100.0%│          100.0%│     18│     36│
2456 ╰───────┴─────┴────────┴────────────────┴────────────────┴───────┴───────╯
2457 dnl Note that Column Total N % doesn't add up to 100 because system-missing
2458 dnl values are included in the total but not shown as a category and this
2459 dnl is expected behavior.
2460
2461                      Custom Tables
2462 ╭────────────────────────┬───────────────────────────╮
2463 │                        │             y             │
2464 │                        ├──────┬──────┬──────┬──────┤
2465 │                        │ 1.00 │ 4.00 │ 5.00 │ Total│
2466 ├────────────────────────┼──────┼──────┼──────┼──────┤
2467 │x 3.00  Count           │     1│     1│     1│     3│
2468 │        Column %        │ 33.3%│ 33.3%│ 33.3%│     .│
2469 │        Column Valid N %│ 33.3%│ 33.3%│ 33.3%│     .│
2470 │        Column Total N %│ 33.3%│ 33.3%│ 33.3%│     .│
2471 │        Row %           │ 33.3%│ 33.3%│ 33.3%│100.0%│
2472 │        Row Valid N %   │ 33.3%│ 33.3%│ 33.3%│100.0%│
2473 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│100.0%│
2474 │        Valid N         │      │      │      │     3│
2475 │        Total N         │      │      │      │     6│
2476 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2477 │  4.00  Count           │     1│     1│     1│     3│
2478 │        Column %        │ 33.3%│ 33.3%│ 33.3%│     .│
2479 │        Column Valid N %│ 33.3%│ 33.3%│ 33.3%│     .│
2480 │        Column Total N %│ 33.3%│ 33.3%│ 33.3%│     .│
2481 │        Row %           │ 33.3%│ 33.3%│ 33.3%│100.0%│
2482 │        Row Valid N %   │ 33.3%│ 33.3%│ 33.3%│100.0%│
2483 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│100.0%│
2484 │        Valid N         │      │      │      │     3│
2485 │        Total N         │      │      │      │     6│
2486 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2487 │  5.00  Count           │     1│     1│     1│     3│
2488 │        Column %        │ 33.3%│ 33.3%│ 33.3%│     .│
2489 │        Column Valid N %│ 33.3%│ 33.3%│ 33.3%│     .│
2490 │        Column Total N %│ 33.3%│ 33.3%│ 33.3%│     .│
2491 │        Row %           │ 33.3%│ 33.3%│ 33.3%│100.0%│
2492 │        Row Valid N %   │ 33.3%│ 33.3%│ 33.3%│100.0%│
2493 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│100.0%│
2494 │        Valid N         │      │      │      │     3│
2495 │        Total N         │      │      │      │     6│
2496 │ ╶──────────────────────┼──────┼──────┼──────┼──────┤
2497 │  Total Count           │     3│     3│     3│     9│
2498 │        Column %        │100.0%│100.0%│100.0%│     .│
2499 │        Column Valid N %│100.0%│100.0%│100.0%│     .│
2500 │        Column Total N %│100.0%│100.0%│100.0%│     .│
2501 │        Row %           │     .│     .│     .│     .│
2502 │        Row Valid N %   │     .│     .│     .│     .│
2503 │        Row Total N %   │     .│     .│     .│     .│
2504 │        Valid N         │     3│     3│     3│     9│
2505 │        Total N         │     3│     3│     3│    18│
2506 ╰────────────────────────┴──────┴──────┴──────┴──────╯
2507
2508                             Custom Tables
2509 ╭────────────────────────┬─────────────────────────────────────────╮
2510 │                        │                    y                    │
2511 │                        ├──────┬──────┬──────┬──────┬──────┬──────┤
2512 │                        │ 1.00 │ 2.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2513 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2514 │x 1.00  Count           │     1│     1│     1│     1│     1│     5│
2515 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2516 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2517 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2518 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2519 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2520 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2521 │        Valid N         │      │      │      │      │      │     3│
2522 │        Total N         │      │      │      │      │      │     6│
2523 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2524 │  2.00  Count           │     1│     1│     1│     1│     1│     5│
2525 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2526 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2527 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2528 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2529 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2530 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2531 │        Valid N         │      │      │      │      │      │     3│
2532 │        Total N         │      │      │      │      │      │     6│
2533 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2534 │  3.00  Count           │     1│     1│     1│     1│     1│     5│
2535 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2536 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2537 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2538 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2539 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2540 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2541 │        Valid N         │      │      │      │      │      │     3│
2542 │        Total N         │      │      │      │      │      │     6│
2543 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2544 │  4.00  Count           │     1│     1│     1│     1│     1│     5│
2545 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2546 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2547 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2548 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2549 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2550 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2551 │        Valid N         │      │      │      │      │      │     3│
2552 │        Total N         │      │      │      │      │      │     6│
2553 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2554 │  5.00  Count           │     1│     1│     1│     1│     1│     5│
2555 │        Column %        │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2556 │        Column Valid N %│ 20.0%│     .│     .│ 20.0%│ 20.0%│     .│
2557 │        Column Total N %│ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│     .│
2558 │        Row %           │ 20.0%│ 20.0%│ 20.0%│ 20.0%│ 20.0%│100.0%│
2559 │        Row Valid N %   │ 33.3%│   .0%│   .0%│ 33.3%│ 33.3%│100.0%│
2560 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2561 │        Valid N         │      │      │      │      │      │     3│
2562 │        Total N         │      │      │      │      │      │     6│
2563 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┤
2564 │  Total Count           │     5│     5│     5│     5│     5│    25│
2565 │        Column %        │100.0%│100.0%│100.0%│100.0%│100.0%│     .│
2566 │        Column Valid N %│100.0%│     .│     .│100.0%│100.0%│     .│
2567 │        Column Total N %│100.0%│100.0%│100.0%│100.0%│100.0%│     .│
2568 │        Row %           │     .│     .│     .│     .│     .│     .│
2569 │        Row Valid N %   │     .│     .│     .│     .│     .│     .│
2570 │        Row Total N %   │     .│     .│     .│     .│     .│     .│
2571 │        Valid N         │     5│     0│     0│     5│     5│    15│
2572 │        Total N         │     5│     5│     5│     5│     5│    30│
2573 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────╯
2574
2575                         Custom Tables
2576 ╭────────────────────────┬──────────────────────────────────╮
2577 │                        │                 y                │
2578 │                        ├──────┬──────┬──────┬──────┬──────┤
2579 │                        │ 1.00 │ 3.00 │ 4.00 │ 5.00 │ Total│
2580 ├────────────────────────┼──────┼──────┼──────┼──────┼──────┤
2581 │x 1.00  Count           │     1│     1│     1│     1│     4│
2582 │        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2583 │        Column Valid N %│ 25.0%│     .│ 25.0%│ 25.0%│     .│
2584 │        Column Total N %│ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2585 │        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2586 │        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
2587 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2588 │        Valid N         │      │      │      │      │     3│
2589 │        Total N         │      │      │      │      │     6│
2590 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2591 │  2.00  Count           │     1│     1│     1│     1│     4│
2592 │        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2593 │        Column Valid N %│ 25.0%│     .│ 25.0%│ 25.0%│     .│
2594 │        Column Total N %│ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2595 │        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2596 │        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
2597 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2598 │        Valid N         │      │      │      │      │     3│
2599 │        Total N         │      │      │      │      │     6│
2600 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2601 │  3.00  Count           │     1│     1│     1│     1│     4│
2602 │        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2603 │        Column Valid N %│ 25.0%│     .│ 25.0%│ 25.0%│     .│
2604 │        Column Total N %│ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2605 │        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2606 │        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
2607 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2608 │        Valid N         │      │      │      │      │     3│
2609 │        Total N         │      │      │      │      │     6│
2610 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2611 │  4.00  Count           │     1│     1│     1│     1│     4│
2612 │        Column %        │ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2613 │        Column Valid N %│ 25.0%│     .│ 25.0%│ 25.0%│     .│
2614 │        Column Total N %│ 25.0%│ 25.0%│ 25.0%│ 25.0%│     .│
2615 │        Row %           │ 25.0%│ 25.0%│ 25.0%│ 25.0%│100.0%│
2616 │        Row Valid N %   │ 33.3%│   .0%│ 33.3%│ 33.3%│100.0%│
2617 │        Row Total N %   │ 16.7%│ 16.7%│ 16.7%│ 16.7%│100.0%│
2618 │        Valid N         │      │      │      │      │     3│
2619 │        Total N         │      │      │      │      │     6│
2620 │ ╶──────────────────────┼──────┼──────┼──────┼──────┼──────┤
2621 │  Total Count           │     4│     4│     4│     4│    16│
2622 │        Column %        │100.0%│100.0%│100.0%│100.0%│     .│
2623 │        Column Valid N %│100.0%│     .│100.0%│100.0%│     .│
2624 │        Column Total N %│100.0%│100.0%│100.0%│100.0%│     .│
2625 │        Row %           │     .│     .│     .│     .│     .│
2626 │        Row Valid N %   │     .│     .│     .│     .│     .│
2627 │        Row Total N %   │     .│     .│     .│     .│     .│
2628 │        Valid N         │     4│     0│     4│     4│    12│
2629 │        Total N         │     4│     4│     4│     4│    24│
2630 ╰────────────────────────┴──────┴──────┴──────┴──────┴──────╯
2631 ])
2632 AT_CLEANUP
2633
2634 AT_SETUP([CTABLES SMISSING=LISTWISE])
2635 AT_KEYWORDS([SMISSING LISTWISE])
2636 AT_DATA([ctables.sps],
2637 [[DATA LIST LIST NOTABLE/x y z.
2638 BEGIN DATA.
2639 1  . 40
2640 1 10 50
2641 1 20 60
2642 1  .  .
2643 1 30  .
2644 END DATA.
2645 VARIABLE LEVEL x (NOMINAL).
2646
2647 CTABLES /TABLE (y + z) > x.
2648 CTABLES /SMISSING LISTWISE /TABLE (y + z) > x.
2649
2650 * The following doesn't come out as listwise because the tables are
2651 separate, not linked by an > operator.
2652 CTABLES /SMISSING LISTWISE /TABLE (y > x) + (z > x).
2653 ]])
2654 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
2655   Custom Tables
2656 ╭────────┬─────╮
2657 │        │ Mean│
2658 ├────────┼─────┤
2659 │y x 1.00│20.00│
2660 ├────────┼─────┤
2661 │z x 1.00│50.00│
2662 ╰────────┴─────╯
2663
2664   Custom Tables
2665 ╭────────┬─────╮
2666 │        │ Mean│
2667 ├────────┼─────┤
2668 │y x 1.00│15.00│
2669 ├────────┼─────┤
2670 │z x 1.00│55.00│
2671 ╰────────┴─────╯
2672
2673   Custom Tables
2674 ╭────────┬─────╮
2675 │        │ Mean│
2676 ├────────┼─────┤
2677 │y x 1.00│20.00│
2678 ├────────┼─────┤
2679 │z x 1.00│50.00│
2680 ╰────────┴─────╯
2681 ])
2682 AT_CLEANUP
2683
2684 AT_SETUP([CTABLES VLABELS - variables on different axes])
2685 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
2686 AT_DATA([ctables.sps],
2687 [[GET 'nhtsa.sav'.
2688 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=DEFAULT /TABLE qnd5a BY qns3a.
2689 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NAME    /TABLE qnd5a BY qns3a.
2690 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=LABEL   /TABLE qnd5a BY qns3a.
2691 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=BOTH    /TABLE qnd5a BY qns3a.
2692 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE    /TABLE qnd5a BY qns3a.
2693 ]])
2694 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2695                                  Custom Tables
2696 ╭────────────────────────────────────────────────────────────────┬────────────╮
2697 │                                                                │S3a. GENDER:│
2698 │                                                                ├─────┬──────┤
2699 │                                                                │ Male│Female│
2700 │                                                                ├─────┼──────┤
2701 │                                                                │Count│ Count│
2702 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2703 │D5a. What would you say is your primary    Cuban                │   13│     7│
2704 │ethnic background?                         Mexican              │  175│   136│
2705 │                                           Spanish              │   20│    28│
2706 │                                           South American       │   21│    13│
2707 │                                           Central American     │   27│    25│
2708 │                                           Puerto Rican, OR     │   37│    41│
2709 │                                           Something else       │   35│    33│
2710 │                                           Multiple - cannot    │    2│     5│
2711 │                                           choose one           │     │      │
2712 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2713
2714                   Custom Tables
2715 ╭──────────────────────────────────┬────────────╮
2716 │                                  │    QNS3A   │
2717 │                                  ├─────┬──────┤
2718 │                                  │ Male│Female│
2719 │                                  ├─────┼──────┤
2720 │                                  │Count│ Count│
2721 ├──────────────────────────────────┼─────┼──────┤
2722 │QND5A Cuban                       │   13│     7│
2723 │      Mexican                     │  175│   136│
2724 │      Spanish                     │   20│    28│
2725 │      South American              │   21│    13│
2726 │      Central American            │   27│    25│
2727 │      Puerto Rican, OR            │   37│    41│
2728 │      Something else              │   35│    33│
2729 │      Multiple - cannot choose one│    2│     5│
2730 ╰──────────────────────────────────┴─────┴──────╯
2731
2732                                  Custom Tables
2733 ╭────────────────────────────────────────────────────────────────┬────────────╮
2734 │                                                                │S3a. GENDER:│
2735 │                                                                ├─────┬──────┤
2736 │                                                                │ Male│Female│
2737 │                                                                ├─────┼──────┤
2738 │                                                                │Count│ Count│
2739 ├────────────────────────────────────────────────────────────────┼─────┼──────┤
2740 │D5a. What would you say is your primary    Cuban                │   13│     7│
2741 │ethnic background?                         Mexican              │  175│   136│
2742 │                                           Spanish              │   20│    28│
2743 │                                           South American       │   21│    13│
2744 │                                           Central American     │   27│    25│
2745 │                                           Puerto Rican, OR     │   37│    41│
2746 │                                           Something else       │   35│    33│
2747 │                                           Multiple - cannot    │    2│     5│
2748 │                                           choose one           │     │      │
2749 ╰────────────────────────────────────────────────────────────────┴─────┴──────╯
2750
2751                                  Custom Tables
2752 ╭────────────────────────────────────────────────────────────┬────────────────╮
2753 │                                                            │   QNS3A S3a.   │
2754 │                                                            │     GENDER:    │
2755 │                                                            ├───────┬────────┤
2756 │                                                            │  Male │ Female │
2757 │                                                            ├───────┼────────┤
2758 │                                                            │ Count │  Count │
2759 ├────────────────────────────────────────────────────────────┼───────┼────────┤
2760 │QND5A D5a. What would you say is your    Cuban              │     13│       7│
2761 │primary ethnic background?               Mexican            │    175│     136│
2762 │                                         Spanish            │     20│      28│
2763 │                                         South American     │     21│      13│
2764 │                                         Central American   │     27│      25│
2765 │                                         Puerto Rican, OR   │     37│      41│
2766 │                                         Something else     │     35│      33│
2767 │                                         Multiple - cannot  │      2│       5│
2768 │                                         choose one         │       │        │
2769 ╰────────────────────────────────────────────────────────────┴───────┴────────╯
2770
2771                Custom Tables
2772 ╭────────────────────────────┬─────┬──────╮
2773 │                            │ Male│Female│
2774 │                            ├─────┼──────┤
2775 │                            │Count│ Count│
2776 ├────────────────────────────┼─────┼──────┤
2777 │Cuban                       │   13│     7│
2778 │Mexican                     │  175│   136│
2779 │Spanish                     │   20│    28│
2780 │South American              │   21│    13│
2781 │Central American            │   27│    25│
2782 │Puerto Rican, OR            │   37│    41│
2783 │Something else              │   35│    33│
2784 │Multiple - cannot choose one│    2│     5│
2785 ╰────────────────────────────┴─────┴──────╯
2786 ])
2787 AT_CLEANUP
2788
2789 AT_SETUP([CTABLES VLABELS - stacked variables])
2790 AT_KEYWORDS([stack stacking])
2791 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
2792 AT_DATA([ctables.sps],
2793 [[GET 'nhtsa.sav'.
2794 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a + qns3a.
2795 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a + qns3a.
2796 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a + qns3a.
2797 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2798 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a + qns3a.
2799 ]])
2800 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2801                                  Custom Tables
2802 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2803 │                                                                       │Count│
2804 ├───────────────────────────────────────────────────────────────────────┼─────┤
2805 │D5a. What would you say is your primary ethnic  Cuban                  │   20│
2806 │background?                                     Mexican                │  311│
2807 │                                                Spanish                │   48│
2808 │                                                South American         │   34│
2809 │                                                Central American       │   52│
2810 │                                                Puerto Rican, OR       │   78│
2811 │                                                Something else         │   68│
2812 │                                                Multiple - cannot      │    7│
2813 │                                                choose one             │     │
2814 ├───────────────────────────────────────────────────────────────────────┼─────┤
2815 │QNS3A                                           Male                   │ 3132│
2816 │                                                Female                 │ 3867│
2817 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2818
2819                   Custom Tables
2820 ╭─────────────────────────────────────────┬─────╮
2821 │                                         │Count│
2822 ├─────────────────────────────────────────┼─────┤
2823 │QND5A        Cuban                       │   20│
2824 │             Mexican                     │  311│
2825 │             Spanish                     │   48│
2826 │             South American              │   34│
2827 │             Central American            │   52│
2828 │             Puerto Rican, OR            │   78│
2829 │             Something else              │   68│
2830 │             Multiple - cannot choose one│    7│
2831 ├─────────────────────────────────────────┼─────┤
2832 │S3a. GENDER: Male                        │ 3132│
2833 │             Female                      │ 3867│
2834 ╰─────────────────────────────────────────┴─────╯
2835
2836                                  Custom Tables
2837 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2838 │                                                                       │Count│
2839 ├───────────────────────────────────────────────────────────────────────┼─────┤
2840 │D5a. What would you say is your primary ethnic  Cuban                  │   20│
2841 │background?                                     Mexican                │  311│
2842 │                                                Spanish                │   48│
2843 │                                                South American         │   34│
2844 │                                                Central American       │   52│
2845 │                                                Puerto Rican, OR       │   78│
2846 │                                                Something else         │   68│
2847 │                                                Multiple - cannot      │    7│
2848 │                                                choose one             │     │
2849 ├───────────────────────────────────────────────────────────────────────┼─────┤
2850 │Male                                                                   │ 3132│
2851 ├───────────────────────────────────────────────────────────────────────┼─────┤
2852 │Female                                                                 │ 3867│
2853 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2854
2855             Custom Tables
2856 ╭─────────────────────────────┬─────╮
2857 │                             │Count│
2858 ├─────────────────────────────┼─────┤
2859 │Cuban                        │   20│
2860 ├─────────────────────────────┼─────┤
2861 │Mexican                      │  311│
2862 ├─────────────────────────────┼─────┤
2863 │Spanish                      │   48│
2864 ├─────────────────────────────┼─────┤
2865 │South American               │   34│
2866 ├─────────────────────────────┼─────┤
2867 │Central American             │   52│
2868 ├─────────────────────────────┼─────┤
2869 │Puerto Rican, OR             │   78│
2870 ├─────────────────────────────┼─────┤
2871 │Something else               │   68│
2872 ├─────────────────────────────┼─────┤
2873 │Multiple - cannot choose one │    7│
2874 ├─────────────────────────────┼─────┤
2875 │S3a. GENDER:     Male        │ 3132│
2876 │                 Female      │ 3867│
2877 ╰─────────────────────────────┴─────╯
2878
2879             Custom Tables
2880 ╭────────────────────────────┬─────╮
2881 │                            │Count│
2882 ├────────────────────────────┼─────┤
2883 │Cuban                       │   20│
2884 │Mexican                     │  311│
2885 │Spanish                     │   48│
2886 │South American              │   34│
2887 │Central American            │   52│
2888 │Puerto Rican, OR            │   78│
2889 │Something else              │   68│
2890 │Multiple - cannot choose one│    7│
2891 │Male                        │ 3132│
2892 │Female                      │ 3867│
2893 ╰────────────────────────────┴─────╯
2894 ])
2895 AT_CLEANUP
2896
2897 AT_SETUP([CTABLES VLABELS - nested variables])
2898 AT_KEYWORDS([nest nesting])
2899 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
2900 AT_DATA([ctables.sps],
2901 [[GET 'nhtsa.sav'.
2902 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NAME /TABLE qnd5a > qns3a.
2903 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NAME /TABLE qnd5a > qns3a.
2904 CTABLES /VLABELS VARIABLES=qns3a DISPLAY=NONE /TABLE qnd5a > qns3a.
2905 CTABLES /VLABELS VARIABLES=qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2906 CTABLES /VLABELS VARIABLES=qns3a qnd5a DISPLAY=NONE /TABLE qnd5a > qns3a.
2907 ]])
2908 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
2909                                  Custom Tables
2910 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2911 │                                                                       │Count│
2912 ├───────────────────────────────────────────────────────────────────────┼─────┤
2913 │D5a. What would you say is your       Cuban                QNS3A Male  │   13│
2914 │primary ethnic background?                                       Female│    7│
2915 │                                     ╶─────────────────────────────────┼─────┤
2916 │                                      Mexican              QNS3A Male  │  175│
2917 │                                                                 Female│  136│
2918 │                                     ╶─────────────────────────────────┼─────┤
2919 │                                      Spanish              QNS3A Male  │   20│
2920 │                                                                 Female│   28│
2921 │                                     ╶─────────────────────────────────┼─────┤
2922 │                                      South American       QNS3A Male  │   21│
2923 │                                                                 Female│   13│
2924 │                                     ╶─────────────────────────────────┼─────┤
2925 │                                      Central American     QNS3A Male  │   27│
2926 │                                                                 Female│   25│
2927 │                                     ╶─────────────────────────────────┼─────┤
2928 │                                      Puerto Rican, OR     QNS3A Male  │   37│
2929 │                                                                 Female│   41│
2930 │                                     ╶─────────────────────────────────┼─────┤
2931 │                                      Something else       QNS3A Male  │   35│
2932 │                                                                 Female│   33│
2933 │                                     ╶─────────────────────────────────┼─────┤
2934 │                                      Multiple - cannot    QNS3A Male  │    2│
2935 │                                      choose one                 Female│    5│
2936 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2937
2938                          Custom Tables
2939 ╭──────────────────────────────────────────────────────┬─────╮
2940 │                                                      │Count│
2941 ├──────────────────────────────────────────────────────┼─────┤
2942 │QND5A Cuban                        S3a. GENDER: Male  │   13│
2943 │                                                Female│    7│
2944 │     ╶────────────────────────────────────────────────┼─────┤
2945 │      Mexican                      S3a. GENDER: Male  │  175│
2946 │                                                Female│  136│
2947 │     ╶────────────────────────────────────────────────┼─────┤
2948 │      Spanish                      S3a. GENDER: Male  │   20│
2949 │                                                Female│   28│
2950 │     ╶────────────────────────────────────────────────┼─────┤
2951 │      South American               S3a. GENDER: Male  │   21│
2952 │                                                Female│   13│
2953 │     ╶────────────────────────────────────────────────┼─────┤
2954 │      Central American             S3a. GENDER: Male  │   27│
2955 │                                                Female│   25│
2956 │     ╶────────────────────────────────────────────────┼─────┤
2957 │      Puerto Rican, OR             S3a. GENDER: Male  │   37│
2958 │                                                Female│   41│
2959 │     ╶────────────────────────────────────────────────┼─────┤
2960 │      Something else               S3a. GENDER: Male  │   35│
2961 │                                                Female│   33│
2962 │     ╶────────────────────────────────────────────────┼─────┤
2963 │      Multiple - cannot choose one S3a. GENDER: Male  │    2│
2964 │                                                Female│    5│
2965 ╰──────────────────────────────────────────────────────┴─────╯
2966
2967                                  Custom Tables
2968 ╭───────────────────────────────────────────────────────────────────────┬─────╮
2969 │                                                                       │Count│
2970 ├───────────────────────────────────────────────────────────────────────┼─────┤
2971 │D5a. What would you say is your primary    Cuban                 Male  │   13│
2972 │ethnic background?                                               Female│    7│
2973 │                                          ╶────────────────────────────┼─────┤
2974 │                                           Mexican               Male  │  175│
2975 │                                                                 Female│  136│
2976 │                                          ╶────────────────────────────┼─────┤
2977 │                                           Spanish               Male  │   20│
2978 │                                                                 Female│   28│
2979 │                                          ╶────────────────────────────┼─────┤
2980 │                                           South American        Male  │   21│
2981 │                                                                 Female│   13│
2982 │                                          ╶────────────────────────────┼─────┤
2983 │                                           Central American      Male  │   27│
2984 │                                                                 Female│   25│
2985 │                                          ╶────────────────────────────┼─────┤
2986 │                                           Puerto Rican, OR      Male  │   37│
2987 │                                                                 Female│   41│
2988 │                                          ╶────────────────────────────┼─────┤
2989 │                                           Something else        Male  │   35│
2990 │                                                                 Female│   33│
2991 │                                          ╶────────────────────────────┼─────┤
2992 │                                           Multiple - cannot     Male  │    2│
2993 │                                           choose one            Female│    5│
2994 ╰───────────────────────────────────────────────────────────────────────┴─────╯
2995
2996                       Custom Tables
2997 ╭────────────────────────────────────────────────┬─────╮
2998 │                                                │Count│
2999 ├────────────────────────────────────────────────┼─────┤
3000 │Cuban                        S3a. GENDER: Male  │   13│
3001 │                                          Female│    7│
3002 ├────────────────────────────────────────────────┼─────┤
3003 │Mexican                      S3a. GENDER: Male  │  175│
3004 │                                          Female│  136│
3005 ├────────────────────────────────────────────────┼─────┤
3006 │Spanish                      S3a. GENDER: Male  │   20│
3007 │                                          Female│   28│
3008 ├────────────────────────────────────────────────┼─────┤
3009 │South American               S3a. GENDER: Male  │   21│
3010 │                                          Female│   13│
3011 ├────────────────────────────────────────────────┼─────┤
3012 │Central American             S3a. GENDER: Male  │   27│
3013 │                                          Female│   25│
3014 ├────────────────────────────────────────────────┼─────┤
3015 │Puerto Rican, OR             S3a. GENDER: Male  │   37│
3016 │                                          Female│   41│
3017 ├────────────────────────────────────────────────┼─────┤
3018 │Something else               S3a. GENDER: Male  │   35│
3019 │                                          Female│   33│
3020 ├────────────────────────────────────────────────┼─────┤
3021 │Multiple - cannot choose one S3a. GENDER: Male  │    2│
3022 │                                          Female│    5│
3023 ╰────────────────────────────────────────────────┴─────╯
3024
3025                Custom Tables
3026 ╭───────────────────────────────────┬─────╮
3027 │                                   │Count│
3028 ├───────────────────────────────────┼─────┤
3029 │Cuban                        Male  │   13│
3030 │                             Female│    7│
3031 ├───────────────────────────────────┼─────┤
3032 │Mexican                      Male  │  175│
3033 │                             Female│  136│
3034 ├───────────────────────────────────┼─────┤
3035 │Spanish                      Male  │   20│
3036 │                             Female│   28│
3037 ├───────────────────────────────────┼─────┤
3038 │South American               Male  │   21│
3039 │                             Female│   13│
3040 ├───────────────────────────────────┼─────┤
3041 │Central American             Male  │   27│
3042 │                             Female│   25│
3043 ├───────────────────────────────────┼─────┤
3044 │Puerto Rican, OR             Male  │   37│
3045 │                             Female│   41│
3046 ├───────────────────────────────────┼─────┤
3047 │Something else               Male  │   35│
3048 │                             Female│   33│
3049 ├───────────────────────────────────┼─────┤
3050 │Multiple - cannot choose one Male  │    2│
3051 │                             Female│    5│
3052 ╰───────────────────────────────────┴─────╯
3053 ])
3054 AT_CLEANUP
3055
3056 AT_SETUP([CTABLES FORMAT EMPTY])
3057 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
3058 AT_DATA([ctables.sps],
3059 [[GET 'nhtsa.sav'.
3060 CTABLES /FORMAT EMPTY=ZERO /TABLE qnd5a BY qnd5.
3061 CTABLES /FORMAT EMPTY=BLANK /TABLE qnd5a BY qnd5.
3062 CTABLES /FORMAT EMPTY='n/a' /TABLE qnd5a BY qnd5.
3063 ]])
3064 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
3065                                  Custom Tables
3066 ╭─────────────────────────────────────────────┬───────────────────────────────╮
3067 │                                             │   D5. ETHNICITY: Are you of   │
3068 │                                             │  Hispanic or Latino origin or │
3069 │                                             │            descent?           │
3070 │                                             ├───────────────┬───────────────┤
3071 │                                             │      Yes      │       No      │
3072 │                                             ├───────────────┼───────────────┤
3073 │                                             │     Count     │     Count     │
3074 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
3075 │D5a. What would you say is   Cuban           │             20│              0│
3076 │your primary ethnic          Mexican         │            311│              0│
3077 │background?                  Spanish         │             48│              0│
3078 │                             South American  │             34│              0│
3079 │                             Central American│             52│              0│
3080 │                             Puerto Rican, OR│             78│              0│
3081 │                             Something else  │             68│              0│
3082 │                             Multiple -      │              7│              0│
3083 │                             cannot choose   │               │               │
3084 │                             one             │               │               │
3085 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
3086
3087                                  Custom Tables
3088 ╭─────────────────────────────────────────────┬───────────────────────────────╮
3089 │                                             │   D5. ETHNICITY: Are you of   │
3090 │                                             │  Hispanic or Latino origin or │
3091 │                                             │            descent?           │
3092 │                                             ├───────────────┬───────────────┤
3093 │                                             │      Yes      │       No      │
3094 │                                             ├───────────────┼───────────────┤
3095 │                                             │     Count     │     Count     │
3096 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
3097 │D5a. What would you say is   Cuban           │             20│               │
3098 │your primary ethnic          Mexican         │            311│               │
3099 │background?                  Spanish         │             48│               │
3100 │                             South American  │             34│               │
3101 │                             Central American│             52│               │
3102 │                             Puerto Rican, OR│             78│               │
3103 │                             Something else  │             68│               │
3104 │                             Multiple -      │              7│               │
3105 │                             cannot choose   │               │               │
3106 │                             one             │               │               │
3107 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
3108
3109                                  Custom Tables
3110 ╭─────────────────────────────────────────────┬───────────────────────────────╮
3111 │                                             │   D5. ETHNICITY: Are you of   │
3112 │                                             │  Hispanic or Latino origin or │
3113 │                                             │            descent?           │
3114 │                                             ├───────────────┬───────────────┤
3115 │                                             │      Yes      │       No      │
3116 │                                             ├───────────────┼───────────────┤
3117 │                                             │     Count     │     Count     │
3118 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
3119 │D5a. What would you say is   Cuban           │             20│n/a            │
3120 │your primary ethnic          Mexican         │            311│n/a            │
3121 │background?                  Spanish         │             48│n/a            │
3122 │                             South American  │             34│n/a            │
3123 │                             Central American│             52│n/a            │
3124 │                             Puerto Rican, OR│             78│n/a            │
3125 │                             Something else  │             68│n/a            │
3126 │                             Multiple -      │              7│n/a            │
3127 │                             cannot choose   │               │               │
3128 │                             one             │               │               │
3129 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
3130 ])
3131 AT_CLEANUP
3132
3133 AT_SETUP([CTABLES FORMAT MISSING])
3134 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
3135 AT_DATA([ctables.sps],
3136 [[GET 'nhtsa.sav'.
3137 CTABLES /FORMAT MISSING='(no data)' /TABLE qnd5a[COLPCT] BY qnd5.
3138 ]])
3139 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
3140                                  Custom Tables
3141 ╭─────────────────────────────────────────────┬───────────────────────────────╮
3142 │                                             │   D5. ETHNICITY: Are you of   │
3143 │                                             │  Hispanic or Latino origin or │
3144 │                                             │            descent?           │
3145 │                                             ├───────────────┬───────────────┤
3146 │                                             │      Yes      │       No      │
3147 │                                             ├───────────────┼───────────────┤
3148 │                                             │    Column %   │    Column %   │
3149 ├─────────────────────────────────────────────┼───────────────┼───────────────┤
3150 │D5a. What would you say is   Cuban           │           3.2%│(no data)      │
3151 │your primary ethnic          Mexican         │          50.3%│(no data)      │
3152 │background?                  Spanish         │           7.8%│(no data)      │
3153 │                             South American  │           5.5%│(no data)      │
3154 │                             Central American│           8.4%│(no data)      │
3155 │                             Puerto Rican, OR│          12.6%│(no data)      │
3156 │                             Something else  │          11.0%│(no data)      │
3157 │                             Multiple -      │           1.1%│(no data)      │
3158 │                             cannot choose   │               │               │
3159 │                             one             │               │               │
3160 ╰─────────────────────────────────────────────┴───────────────┴───────────────╯
3161 ])
3162 AT_CLEANUP
3163
3164 AT_SETUP([CTABLES HIDESMALLCOUNTS])
3165 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
3166 AT_DATA([ctables.sps],
3167 [[GET 'nhtsa.sav'.
3168 CTABLES /TABLE qn38[c][COUNT, COLPCT].
3169 CTABLES /HIDESMALLCOUNTS /TABLE qn38[c][COUNT, COLPCT].
3170 CTABLES /HIDESMALLCOUNTS COUNT=10 /TABLE qn38[c][COUNT, COLPCT].
3171 ]])
3172 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
3173                                  Custom Tables
3174 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
3175 │                                                              │Count│Column %│
3176 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
3177 │38. How many drinks did you have on that         Less than one│    7│     .5%│
3178 │occasion?                                        1            │  491│   34.9%│
3179 │                                                 2            │  462│   32.9%│
3180 │                                                 3            │  229│   16.3%│
3181 │                                                 4            │   82│    5.8%│
3182 │                                                 5            │   56│    4.0%│
3183 │                                                 6            │   32│    2.3%│
3184 │                                                 7            │    9│     .6%│
3185 │                                                 8            │    8│     .6%│
3186 │                                                 9            │    4│     .3%│
3187 │                                                 10           │    6│     .4%│
3188 │                                                 11           │    2│     .1%│
3189 │                                                 12           │    5│     .4%│
3190 │                                                 14           │    1│     .1%│
3191 │                                                 15           │    1│     .1%│
3192 │                                                 18           │    1│     .1%│
3193 │                                                 20           │    4│     .3%│
3194 │                                                 25           │    1│     .1%│
3195 │                                                 30           │    3│     .2%│
3196 │                                                 60           │    1│     .1%│
3197 │                                                 99+          │    0│     .0%│
3198 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
3199
3200                                  Custom Tables
3201 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
3202 │                                                              │Count│Column %│
3203 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
3204 │38. How many drinks did you have on that         Less than one│    7│     .5%│
3205 │occasion?                                        1            │  491│   34.9%│
3206 │                                                 2            │  462│   32.9%│
3207 │                                                 3            │  229│   16.3%│
3208 │                                                 4            │   82│    5.8%│
3209 │                                                 5            │   56│    4.0%│
3210 │                                                 6            │   32│    2.3%│
3211 │                                                 7            │    9│     .6%│
3212 │                                                 8            │    8│     .6%│
3213 │                                                 9            │<5   │     .3%│
3214 │                                                 10           │    6│     .4%│
3215 │                                                 11           │<5   │     .1%│
3216 │                                                 12           │    5│     .4%│
3217 │                                                 14           │<5   │     .1%│
3218 │                                                 15           │<5   │     .1%│
3219 │                                                 18           │<5   │     .1%│
3220 │                                                 20           │<5   │     .3%│
3221 │                                                 25           │<5   │     .1%│
3222 │                                                 30           │<5   │     .2%│
3223 │                                                 60           │<5   │     .1%│
3224 │                                                 99+          │<5   │     .0%│
3225 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
3226
3227                                  Custom Tables
3228 ╭──────────────────────────────────────────────────────────────┬─────┬────────╮
3229 │                                                              │Count│Column %│
3230 ├──────────────────────────────────────────────────────────────┼─────┼────────┤
3231 │38. How many drinks did you have on that         Less than one│<10  │     .5%│
3232 │occasion?                                        1            │  491│   34.9%│
3233 │                                                 2            │  462│   32.9%│
3234 │                                                 3            │  229│   16.3%│
3235 │                                                 4            │   82│    5.8%│
3236 │                                                 5            │   56│    4.0%│
3237 │                                                 6            │   32│    2.3%│
3238 │                                                 7            │<10  │     .6%│
3239 │                                                 8            │<10  │     .6%│
3240 │                                                 9            │<10  │     .3%│
3241 │                                                 10           │<10  │     .4%│
3242 │                                                 11           │<10  │     .1%│
3243 │                                                 12           │<10  │     .4%│
3244 │                                                 14           │<10  │     .1%│
3245 │                                                 15           │<10  │     .1%│
3246 │                                                 18           │<10  │     .1%│
3247 │                                                 20           │<10  │     .3%│
3248 │                                                 25           │<10  │     .1%│
3249 │                                                 30           │<10  │     .2%│
3250 │                                                 60           │<10  │     .1%│
3251 │                                                 99+          │<10  │     .0%│
3252 ╰──────────────────────────────────────────────────────────────┴─────┴────────╯
3253 ])
3254 AT_CLEANUP
3255
3256 AT_SETUP([CTABLES FORMAT MINCOLWIDTH MAXCOLWIDTH])
3257 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
3258 AT_DATA([ctables.sps],
3259 [[GET 'nhtsa.sav'.
3260 CTABLES /FORMAT MINCOLWIDTH=1 MAXCOLWIDTH=2 UNITS=INCHES /TABLE BY qns3a.
3261 ]])
3262 AT_CHECK([pspp ctables.sps -o - -O box=unicode -o pspp.spv], [0], [dnl
3263  Custom Tables
3264 ╭────────────╮
3265 │S3a. GENDER:│
3266 ├─────┬──────┤
3267 │ Male│Female│
3268 ├─────┼──────┤
3269 │Count│ Count│
3270 ├─────┼──────┤
3271 │ 3132│  3867│
3272 ╰─────┴──────╯
3273 ])
3274 AT_CHECK([pspp-output get-table-look pspp.spv pspp.stt])
3275 AT_CHECK([sed 's/ /\n/g' pspp.stt | grep ColumnWidth | sort], [0], [dnl
3276 maximumColumnWidth="192"
3277 minimumColumnWidth="96"
3278 ])
3279 AT_CLEANUP
3280
3281 AT_SETUP([CTABLES special formats])
3282 AT_KEYWORDS([NEGPAREN NEQUAL PAREN PCTPAREN])
3283 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
3284 AT_DATA([ctables.sps],
3285 [[GET 'nhtsa.sav'.
3286 COMPUTE x = qnd3 - 4.
3287 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].
3288 ]])
3289 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
3290                            Custom Tables
3291 ╭─┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────╮
3292 │ │Minimum│Minimum│Minimum│Minimum│Maximum│Maximum│Maximum│Maximum│
3293 ├─┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
3294 │x│(3.0)  │N=-3.0 │(-3.0) │(-3.0%)│8.0    │N=8.0  │(8.0)  │(8.0%) │
3295 ╰─┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────╯
3296 ])
3297 AT_CLEANUP
3298
3299 AT_SETUP([CTABLES TITLES])
3300 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
3301 AT_DATA([ctables.sps],
3302 [[GET 'nhtsa.sav'.
3303 CTABLES
3304     /VLABELS VARIABLES=qn1 DISPLAY=NONE
3305     /TABLE ((qn1[c][COUNT])) BY qns3a[c] > qnd5
3306     /TITLES TITLE='How often do you drive?' 'second line of title'
3307             CAPTION='Generated )TIME on )DATE'
3308             CORNER=')TABLE'.
3309 ]])
3310 AT_CHECK([pspp ctables.sps -O box=unicode | sed 's/..:..:../HH:MM:SS/
3311 s&../../..&MM/DD/YY&'], [0], [dnl
3312                             How often do you drive?
3313                               second line of title
3314 ╭───────────────────────────────────┬─────────────────────────────────────────╮
3315 │                                   │               S3a. GENDER:              │
3316 │                                   ├────────────────────┬────────────────────┤
3317 │                                   │        Male        │       Female       │
3318 │                                   ├────────────────────┼────────────────────┤
3319 │                                   │ D5. ETHNICITY: Are │ D5. ETHNICITY: Are │
3320 │                                   │ you of Hispanic or │ you of Hispanic or │
3321 │                                   │  Latino origin or  │  Latino origin or  │
3322 │( ( 1. How often do you usually    │      descent?      │      descent?      │
3323 │drive a car or other motor         ├─────────┬──────────┼─────────┬──────────┤
3324 │vehicle?) ) BY S3a. GENDER: > D5.  │   Yes   │    No    │   Yes   │    No    │
3325 │ETHNICITY: Are you of Hispanic or  ├─────────┼──────────┼─────────┼──────────┤
3326 │Latino origin or descent?          │  Count  │   Count  │  Count  │   Count  │
3327 ├───────────────────────────────────┼─────────┼──────────┼─────────┼──────────┤
3328 │Every day                          │      218│      2066│      166│      2175│
3329 │Several days a week                │       44│       391│       45│       782│
3330 │Once a week or less                │       16│       109│       12│       223│
3331 │Only certain times a year          │       15│        41│       11│        61│
3332 │Never                              │       39│       150│       56│       278│
3333 ╰───────────────────────────────────┴─────────┴──────────┴─────────┴──────────╯
3334 Generated HH:MM:SS on MM/DD/YY
3335 ])
3336 AT_CLEANUP
3337
3338 AT_SETUP([CTABLES area definitions])
3339 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
3340 AT_DATA([ctables.sps],
3341 [[GET 'nhtsa.sav'.
3342 CTABLES
3343     /VLABELS VARIABLES=ALL DISPLAY=NAME
3344     /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3345     /SLABELS POSITION=ROW
3346     /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[ROWID, LAYERROWID]
3347     /SLABELS POSITION=ROW
3348     /TABLE qn61 > qn57 BY qnd7a > qn86 + qn64b BY qns3a[COLID, LAYERCOLID]
3349     /SLABELS POSITION=ROW.
3350 ]])
3351 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=80], [0], [dnl
3352                     Custom Tables
3353 Male
3354 ╭─────────────────────────────┬─────────────┬──────╮
3355 │                             │    QND7A    │ QN64B│
3356 │                             ├──────┬──────┼───┬──┤
3357 │                             │  Yes │  No  │   │  │
3358 │                             ├──────┼──────┤   │  │
3359 │                             │ QN86 │ QN86 │   │  │
3360 │                             ├───┬──┼───┬──┤   │  │
3361 │                             │Yes│No│Yes│No│Yes│No│
3362 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
3363 │QN61 Yes QN57 Yes Table ID   │  1│ 1│  1│ 1│  2│ 2│
3364 │                  Layer ID   │  1│ 1│  1│ 1│  2│ 2│
3365 │                  Subtable ID│  1│ 1│  2│ 2│  3│ 3│
3366 │             ╶───────────────┼───┼──┼───┼──┼───┼──┤
3367 │              No  Table ID   │  1│ 1│  1│ 1│  2│ 2│
3368 │                  Layer ID   │  1│ 1│  1│ 1│  2│ 2│
3369 │                  Subtable ID│  1│ 1│  2│ 2│  3│ 3│
3370 │    ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
3371 │     No  QN57 Yes Table ID   │  1│ 1│  1│ 1│  2│ 2│
3372 │                  Layer ID   │  1│ 1│  1│ 1│  2│ 2│
3373 │                  Subtable ID│  4│ 4│  5│ 5│  6│ 6│
3374 │             ╶───────────────┼───┼──┼───┼──┼───┼──┤
3375 │              No  Table ID   │  1│ 1│  1│ 1│  2│ 2│
3376 │                  Layer ID   │  1│ 1│  1│ 1│  2│ 2│
3377 │                  Subtable ID│  4│ 4│  5│ 5│  6│ 6│
3378 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
3379
3380                     Custom Tables
3381 Female
3382 ╭─────────────────────────────┬─────────────┬──────╮
3383 │                             │    QND7A    │ QN64B│
3384 │                             ├──────┬──────┼───┬──┤
3385 │                             │  Yes │  No  │   │  │
3386 │                             ├──────┼──────┤   │  │
3387 │                             │ QN86 │ QN86 │   │  │
3388 │                             ├───┬──┼───┬──┤   │  │
3389 │                             │Yes│No│Yes│No│Yes│No│
3390 ├─────────────────────────────┼───┼──┼───┼──┼───┼──┤
3391 │QN61 Yes QN57 Yes Table ID   │  1│ 1│  1│ 1│  2│ 2│
3392 │                  Layer ID   │  3│ 3│  3│ 3│  4│ 4│
3393 │                  Subtable ID│  7│ 7│  8│ 8│  9│ 9│
3394 │             ╶───────────────┼───┼──┼───┼──┼───┼──┤
3395 │              No  Table ID   │  1│ 1│  1│ 1│  2│ 2│
3396 │                  Layer ID   │  3│ 3│  3│ 3│  4│ 4│
3397 │                  Subtable ID│  7│ 7│  8│ 8│  9│ 9│
3398 │    ╶────────────────────────┼───┼──┼───┼──┼───┼──┤
3399 │     No  QN57 Yes Table ID   │  1│ 1│  1│ 1│  2│ 2│
3400 │                  Layer ID   │  3│ 3│  3│ 3│  4│ 4│
3401 │                  Subtable ID│ 10│10│ 11│11│ 12│12│
3402 │             ╶───────────────┼───┼──┼───┼──┼───┼──┤
3403 │              No  Table ID   │  1│ 1│  1│ 1│  2│ 2│
3404 │                  Layer ID   │  3│ 3│  3│ 3│  4│ 4│
3405 │                  Subtable ID│ 10│10│ 11│11│ 12│12│
3406 ╰─────────────────────────────┴───┴──┴───┴──┴───┴──╯
3407
3408                     Custom Tables
3409 Male
3410 ╭──────────────────────────────┬─────────────┬──────╮
3411 │                              │    QND7A    │ QN64B│
3412 │                              ├──────┬──────┼───┬──┤
3413 │                              │  Yes │  No  │   │  │
3414 │                              ├──────┼──────┤   │  │
3415 │                              │ QN86 │ QN86 │   │  │
3416 │                              ├───┬──┼───┬──┤   │  │
3417 │                              │Yes│No│Yes│No│Yes│No│
3418 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
3419 │QN61 Yes QN57 Yes Row ID      │  1│ 1│  2│ 2│  3│ 3│
3420 │                  Layer Row ID│  1│ 1│  1│ 1│  2│ 2│
3421 │             ╶────────────────┼───┼──┼───┼──┼───┼──┤
3422 │              No  Row ID      │  4│ 4│  5│ 5│  6│ 6│
3423 │                  Layer Row ID│  3│ 3│  3│ 3│  4│ 4│
3424 │    ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
3425 │     No  QN57 Yes Row ID      │  7│ 7│  8│ 8│  9│ 9│
3426 │                  Layer Row ID│  5│ 5│  5│ 5│  6│ 6│
3427 │             ╶────────────────┼───┼──┼───┼──┼───┼──┤
3428 │              No  Row ID      │ 10│10│ 11│11│ 12│12│
3429 │                  Layer Row ID│  7│ 7│  7│ 7│  8│ 8│
3430 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
3431
3432                     Custom Tables
3433 Female
3434 ╭──────────────────────────────┬─────────────┬──────╮
3435 │                              │    QND7A    │ QN64B│
3436 │                              ├──────┬──────┼───┬──┤
3437 │                              │  Yes │  No  │   │  │
3438 │                              ├──────┼──────┤   │  │
3439 │                              │ QN86 │ QN86 │   │  │
3440 │                              ├───┬──┼───┬──┤   │  │
3441 │                              │Yes│No│Yes│No│Yes│No│
3442 ├──────────────────────────────┼───┼──┼───┼──┼───┼──┤
3443 │QN61 Yes QN57 Yes Row ID      │ 13│13│ 14│14│ 15│15│
3444 │                  Layer Row ID│  9│ 9│  9│ 9│ 10│10│
3445 │             ╶────────────────┼───┼──┼───┼──┼───┼──┤
3446 │              No  Row ID      │ 16│16│ 17│17│ 18│18│
3447 │                  Layer Row ID│ 11│11│ 11│11│ 12│12│
3448 │    ╶─────────────────────────┼───┼──┼───┼──┼───┼──┤
3449 │     No  QN57 Yes Row ID      │ 19│19│ 20│20│ 21│21│
3450 │                  Layer Row ID│ 13│13│ 13│13│ 14│14│
3451 │             ╶────────────────┼───┼──┼───┼──┼───┼──┤
3452 │              No  Row ID      │ 22│22│ 23│23│ 24│24│
3453 │                  Layer Row ID│ 15│15│ 15│15│ 16│16│
3454 ╰──────────────────────────────┴───┴──┴───┴──┴───┴──╯
3455
3456                       Custom Tables
3457 Male
3458 ╭─────────────────────────────────┬─────────────┬──────╮
3459 │                                 │    QND7A    │ QN64B│
3460 │                                 ├──────┬──────┼───┬──┤
3461 │                                 │  Yes │  No  │   │  │
3462 │                                 ├──────┼──────┤   │  │
3463 │                                 │ QN86 │ QN86 │   │  │
3464 │                                 ├───┬──┼───┬──┤   │  │
3465 │                                 │Yes│No│Yes│No│Yes│No│
3466 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
3467 │QN61 Yes QN57 Yes Column ID      │  1│ 2│  3│ 4│  5│ 6│
3468 │                  Layer Column ID│  1│ 2│  3│ 4│  5│ 6│
3469 │             ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3470 │              No  Column ID      │  1│ 2│  3│ 4│  5│ 6│
3471 │                  Layer Column ID│  1│ 2│  3│ 4│  5│ 6│
3472 │    ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3473 │     No  QN57 Yes Column ID      │  7│ 8│  9│10│ 11│12│
3474 │                  Layer Column ID│  1│ 2│  3│ 4│  5│ 6│
3475 │             ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3476 │              No  Column ID      │  7│ 8│  9│10│ 11│12│
3477 │                  Layer Column ID│  1│ 2│  3│ 4│  5│ 6│
3478 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3479
3480                       Custom Tables
3481 Female
3482 ╭─────────────────────────────────┬─────────────┬──────╮
3483 │                                 │    QND7A    │ QN64B│
3484 │                                 ├──────┬──────┼───┬──┤
3485 │                                 │  Yes │  No  │   │  │
3486 │                                 ├──────┼──────┤   │  │
3487 │                                 │ QN86 │ QN86 │   │  │
3488 │                                 ├───┬──┼───┬──┤   │  │
3489 │                                 │Yes│No│Yes│No│Yes│No│
3490 ├─────────────────────────────────┼───┼──┼───┼──┼───┼──┤
3491 │QN61 Yes QN57 Yes Column ID      │ 13│14│ 15│16│ 17│18│
3492 │                  Layer Column ID│  7│ 8│  9│10│ 11│12│
3493 │             ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3494 │              No  Column ID      │ 13│14│ 15│16│ 17│18│
3495 │                  Layer Column ID│  7│ 8│  9│10│ 11│12│
3496 │    ╶────────────────────────────┼───┼──┼───┼──┼───┼──┤
3497 │     No  QN57 Yes Column ID      │ 19│20│ 21│22│ 23│24│
3498 │                  Layer Column ID│  7│ 8│  9│10│ 11│12│
3499 │             ╶───────────────────┼───┼──┼───┼──┼───┼──┤
3500 │              No  Column ID      │ 19│20│ 21│22│ 23│24│
3501 │                  Layer Column ID│  7│ 8│  9│10│ 11│12│
3502 ╰─────────────────────────────────┴───┴──┴───┴──┴───┴──╯
3503 ])
3504 AT_CLEANUP
3505
3506 AT_SETUP([CTABLES area definitions with CLABELS ROWLABELS=OPPOSITE])
3507 AT_KEYWORDS([ROWLABELS OPPOSITE])
3508 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
3509 AT_DATA([ctables.sps],
3510 [[GET 'nhtsa.sav'.
3511 CTABLES
3512     /VLABELS VARIABLES=ALL DISPLAY=NAME
3513     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3514     /SLABELS POSITION=ROW
3515     /CLABELS ROWLABELS=OPPOSITE
3516     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3517     /SLABELS POSITION=ROW
3518     /CLABELS ROWLABELS=OPPOSITE
3519     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3520     /SLABELS POSITION=ROW
3521     /CLABELS ROWLABELS=OPPOSITE.
3522 ]])
3523 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3524                                         Custom Tables
3525 Male
3526 ╭──────────────────────────────────┬───────────────────────────────────────────────────────╮
3527 │                                  │                          QN27                         │
3528 │                                  ├───────────────────────────┬───────────────────────────┤
3529 │                                  │            Yes            │             No            │
3530 │                                  ├───────────────────────────┼───────────────────────────┤
3531 │                                  │           QND7A           │           QND7A           │
3532 │                                  ├─────────────┬─────────────┼─────────────┬─────────────┤
3533 │                                  │     Yes     │      No     │     Yes     │      No     │
3534 │                                  ├─────────────┼─────────────┼─────────────┼─────────────┤
3535 │                                  │     QN86    │     QN86    │     QN86    │     QN86    │
3536 │                                  ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3537 │                                  │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3538 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3539 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3540 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3541 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3542 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3543 │                       Subtable ID│  1│ 1│  2│ 2│  3│ 3│  4│ 4│  5│ 5│  6│ 6│  7│ 7│  8│ 8│
3544 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3545 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3546 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3547 │                       Subtable ID│  1│ 1│  2│ 2│  3│ 3│  4│ 4│  5│ 5│  6│ 6│  7│ 7│  8│ 8│
3548 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3549 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3550 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3551 │                       Subtable ID│  9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3552 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3553 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3554 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3555 │                       Subtable ID│  9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3556 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3557
3558                                         Custom Tables
3559 Female
3560 ╭──────────────────────────────────┬───────────────────────────────────────────────────────╮
3561 │                                  │                          QN27                         │
3562 │                                  ├───────────────────────────┬───────────────────────────┤
3563 │                                  │            Yes            │             No            │
3564 │                                  ├───────────────────────────┼───────────────────────────┤
3565 │                                  │           QND7A           │           QND7A           │
3566 │                                  ├─────────────┬─────────────┼─────────────┬─────────────┤
3567 │                                  │     Yes     │      No     │     Yes     │      No     │
3568 │                                  ├─────────────┼─────────────┼─────────────┼─────────────┤
3569 │                                  │     QN86    │     QN86    │     QN86    │     QN86    │
3570 │                                  ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3571 │                                  │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3572 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3573 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3574 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3575 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3576 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3577 │                       Subtable ID│ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3578 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3579 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3580 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3581 │                       Subtable ID│ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3582 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3583 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3584 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3585 │                       Subtable ID│ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3586 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3587 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3588 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3589 │                       Subtable ID│ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3590 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3591
3592                                         Custom Tables
3593 Male
3594 ╭───────────────────────────────────┬───────────────────────────────────────────────────────╮
3595 │                                   │                          QN27                         │
3596 │                                   ├───────────────────────────┬───────────────────────────┤
3597 │                                   │            Yes            │             No            │
3598 │                                   ├───────────────────────────┼───────────────────────────┤
3599 │                                   │           QND7A           │           QND7A           │
3600 │                                   ├─────────────┬─────────────┼─────────────┬─────────────┤
3601 │                                   │     Yes     │      No     │     Yes     │      No     │
3602 │                                   ├─────────────┼─────────────┼─────────────┼─────────────┤
3603 │                                   │     QN86    │     QN86    │     QN86    │     QN86    │
3604 │                                   ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3605 │                                   │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3606 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3607 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3608 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3609 │QN26 Yes QN61 Yes QN57 Row ID      │  1│ 1│  2│ 2│  3│ 3│  4│ 4│  5│ 5│  6│ 6│  7│ 7│  8│ 8│
3610 │                       Layer Row ID│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
3611 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3612 │              No  QN57 Row ID      │  9│ 9│ 10│10│ 11│11│ 12│12│ 13│13│ 14│14│ 15│15│ 16│16│
3613 │                       Layer Row ID│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
3614 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3615 │     No  QN61 Yes QN57 Row ID      │ 17│17│ 18│18│ 19│19│ 20│20│ 21│21│ 22│22│ 23│23│ 24│24│
3616 │                       Layer Row ID│  3│ 3│  3│ 3│  3│ 3│  3│ 3│  3│ 3│  3│ 3│  3│ 3│  3│ 3│
3617 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3618 │              No  QN57 Row ID      │ 25│25│ 26│26│ 27│27│ 28│28│ 29│29│ 30│30│ 31│31│ 32│32│
3619 │                       Layer Row ID│  4│ 4│  4│ 4│  4│ 4│  4│ 4│  4│ 4│  4│ 4│  4│ 4│  4│ 4│
3620 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3621
3622                                         Custom Tables
3623 Female
3624 ╭───────────────────────────────────┬───────────────────────────────────────────────────────╮
3625 │                                   │                          QN27                         │
3626 │                                   ├───────────────────────────┬───────────────────────────┤
3627 │                                   │            Yes            │             No            │
3628 │                                   ├───────────────────────────┼───────────────────────────┤
3629 │                                   │           QND7A           │           QND7A           │
3630 │                                   ├─────────────┬─────────────┼─────────────┬─────────────┤
3631 │                                   │     Yes     │      No     │     Yes     │      No     │
3632 │                                   ├─────────────┼─────────────┼─────────────┼─────────────┤
3633 │                                   │     QN86    │     QN86    │     QN86    │     QN86    │
3634 │                                   ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3635 │                                   │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3636 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3637 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3638 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3639 │QN26 Yes QN61 Yes QN57 Row ID      │ 33│33│ 34│34│ 35│35│ 36│36│ 37│37│ 38│38│ 39│39│ 40│40│
3640 │                       Layer Row ID│  5│ 5│  5│ 5│  5│ 5│  5│ 5│  5│ 5│  5│ 5│  5│ 5│  5│ 5│
3641 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3642 │              No  QN57 Row ID      │ 41│41│ 42│42│ 43│43│ 44│44│ 45│45│ 46│46│ 47│47│ 48│48│
3643 │                       Layer Row ID│  6│ 6│  6│ 6│  6│ 6│  6│ 6│  6│ 6│  6│ 6│  6│ 6│  6│ 6│
3644 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3645 │     No  QN61 Yes QN57 Row ID      │ 49│49│ 50│50│ 51│51│ 52│52│ 53│53│ 54│54│ 55│55│ 56│56│
3646 │                       Layer Row ID│  7│ 7│  7│ 7│  7│ 7│  7│ 7│  7│ 7│  7│ 7│  7│ 7│  7│ 7│
3647 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3648 │              No  QN57 Row ID      │ 57│57│ 58│58│ 59│59│ 60│60│ 61│61│ 62│62│ 63│63│ 64│64│
3649 │                       Layer Row ID│  8│ 8│  8│ 8│  8│ 8│  8│ 8│  8│ 8│  8│ 8│  8│ 8│  8│ 8│
3650 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3651
3652                                           Custom Tables
3653 Male
3654 ╭──────────────────────────────────────┬───────────────────────────────────────────────────────╮
3655 │                                      │                          QN27                         │
3656 │                                      ├───────────────────────────┬───────────────────────────┤
3657 │                                      │            Yes            │             No            │
3658 │                                      ├───────────────────────────┼───────────────────────────┤
3659 │                                      │           QND7A           │           QND7A           │
3660 │                                      ├─────────────┬─────────────┼─────────────┬─────────────┤
3661 │                                      │     Yes     │      No     │     Yes     │      No     │
3662 │                                      ├─────────────┼─────────────┼─────────────┼─────────────┤
3663 │                                      │     QN86    │     QN86    │     QN86    │     QN86    │
3664 │                                      ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3665 │                                      │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3666 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3667 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3668 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3669 │QN26 Yes QN61 Yes QN57 Column ID      │  1│ 2│  3│ 4│  5│ 6│  7│ 8│  9│10│ 11│12│ 13│14│ 15│16│
3670 │                       Layer Column ID│  1│ 2│  3│ 4│  5│ 6│  7│ 8│  9│10│ 11│12│ 13│14│ 15│16│
3671 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3672 │              No  QN57 Column ID      │  1│ 2│  3│ 4│  5│ 6│  7│ 8│  9│10│ 11│12│ 13│14│ 15│16│
3673 │                       Layer Column ID│  1│ 2│  3│ 4│  5│ 6│  7│ 8│  9│10│ 11│12│ 13│14│ 15│16│
3674 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3675 │     No  QN61 Yes QN57 Column ID      │ 17│18│ 19│20│ 21│22│ 23│24│ 25│26│ 27│28│ 29│30│ 31│32│
3676 │                       Layer Column ID│  1│ 2│  3│ 4│  5│ 6│  7│ 8│  9│10│ 11│12│ 13│14│ 15│16│
3677 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3678 │              No  QN57 Column ID      │ 17│18│ 19│20│ 21│22│ 23│24│ 25│26│ 27│28│ 29│30│ 31│32│
3679 │                       Layer Column ID│  1│ 2│  3│ 4│  5│ 6│  7│ 8│  9│10│ 11│12│ 13│14│ 15│16│
3680 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3681
3682                                           Custom Tables
3683 Female
3684 ╭──────────────────────────────────────┬───────────────────────────────────────────────────────╮
3685 │                                      │                          QN27                         │
3686 │                                      ├───────────────────────────┬───────────────────────────┤
3687 │                                      │            Yes            │             No            │
3688 │                                      ├───────────────────────────┼───────────────────────────┤
3689 │                                      │           QND7A           │           QND7A           │
3690 │                                      ├─────────────┬─────────────┼─────────────┬─────────────┤
3691 │                                      │     Yes     │      No     │     Yes     │      No     │
3692 │                                      ├─────────────┼─────────────┼─────────────┼─────────────┤
3693 │                                      │     QN86    │     QN86    │     QN86    │     QN86    │
3694 │                                      ├──────┬──────┼──────┬──────┼──────┬──────┼──────┬──────┤
3695 │                                      │  Yes │  No  │  Yes │  No  │  Yes │  No  │  Yes │  No  │
3696 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┼───┬──┤
3697 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│Yes│No│
3698 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3699 │QN26 Yes QN61 Yes QN57 Column ID      │ 33│34│ 35│36│ 37│38│ 39│40│ 41│42│ 43│44│ 45│46│ 47│48│
3700 │                       Layer Column ID│ 17│18│ 19│20│ 21│22│ 23│24│ 25│26│ 27│28│ 29│30│ 31│32│
3701 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3702 │              No  QN57 Column ID      │ 33│34│ 35│36│ 37│38│ 39│40│ 41│42│ 43│44│ 45│46│ 47│48│
3703 │                       Layer Column ID│ 17│18│ 19│20│ 21│22│ 23│24│ 25│26│ 27│28│ 29│30│ 31│32│
3704 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3705 │     No  QN61 Yes QN57 Column ID      │ 49│50│ 51│52│ 53│54│ 55│56│ 57│58│ 59│60│ 61│62│ 63│64│
3706 │                       Layer Column ID│ 17│18│ 19│20│ 21│22│ 23│24│ 25│26│ 27│28│ 29│30│ 31│32│
3707 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┼───┼──┤
3708 │              No  QN57 Column ID      │ 49│50│ 51│52│ 53│54│ 55│56│ 57│58│ 59│60│ 61│62│ 63│64│
3709 │                       Layer Column ID│ 17│18│ 19│20│ 21│22│ 23│24│ 25│26│ 27│28│ 29│30│ 31│32│
3710 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──┴───┴──╯
3711 ])
3712 AT_CLEANUP
3713
3714 AT_SETUP([CTABLES area definitions with CLABELS COLLABELS=OPPOSITE])
3715 AT_KEYWORDS([COLLABELS OPPOSITE])
3716 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
3717 AT_DATA([ctables.sps],
3718 [[GET 'nhtsa.sav'.
3719 CTABLES
3720     /VLABELS VARIABLES=ALL DISPLAY=NAME
3721     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
3722     /SLABELS POSITION=ROW
3723     /CLABELS COLLABELS=OPPOSITE
3724     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
3725     /SLABELS POSITION=ROW
3726     /CLABELS COLLABELS=OPPOSITE
3727     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
3728     /SLABELS POSITION=ROW
3729     /CLABELS COLLABELS=OPPOSITE.
3730 ]])
3731 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
3732                           Custom Tables
3733 Male
3734 ╭──────────────────────────────────────────┬───────────────────╮
3735 │                                          │        QN27       │
3736 │                                          ├─────────┬─────────┤
3737 │                                          │   Yes   │    No   │
3738 │                                          ├─────────┼─────────┤
3739 │                                          │  QND7A  │  QND7A  │
3740 │                                          ├────┬────┼────┬────┤
3741 │                                          │ Yes│ No │ Yes│ No │
3742 │                                          ├────┼────┼────┼────┤
3743 │                                          │QN86│QN86│QN86│QN86│
3744 ├──────────────────────────────────────────┼────┼────┼────┼────┤
3745 │QN26 Yes QN61 Yes QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3746 │                               Layer ID   │   1│   1│   1│   1│
3747 │                               Subtable ID│   1│   1│   2│   2│
3748 │                          ╶───────────────┼────┼────┼────┼────┤
3749 │                           No  Table ID   │   1│   1│   1│   1│
3750 │                               Layer ID   │   1│   1│   1│   1│
3751 │                               Subtable ID│   1│   1│   2│   2│
3752 │                      ╶───────────────────┼────┼────┼────┼────┤
3753 │                       No  Yes Table ID   │   1│   1│   1│   1│
3754 │                               Layer ID   │   1│   1│   1│   1│
3755 │                               Subtable ID│   3│   3│   4│   4│
3756 │                          ╶───────────────┼────┼────┼────┼────┤
3757 │                           No  Table ID   │   1│   1│   1│   1│
3758 │                               Layer ID   │   1│   1│   1│   1│
3759 │                               Subtable ID│   3│   3│   4│   4│
3760 │             ╶────────────────────────────┼────┼────┼────┼────┤
3761 │              No  QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3762 │                               Layer ID   │   1│   1│   1│   1│
3763 │                               Subtable ID│   5│   5│   6│   6│
3764 │                          ╶───────────────┼────┼────┼────┼────┤
3765 │                           No  Table ID   │   1│   1│   1│   1│
3766 │                               Layer ID   │   1│   1│   1│   1│
3767 │                               Subtable ID│   5│   5│   6│   6│
3768 │                      ╶───────────────────┼────┼────┼────┼────┤
3769 │                       No  Yes Table ID   │   1│   1│   1│   1│
3770 │                               Layer ID   │   1│   1│   1│   1│
3771 │                               Subtable ID│   7│   7│   8│   8│
3772 │                          ╶───────────────┼────┼────┼────┼────┤
3773 │                           No  Table ID   │   1│   1│   1│   1│
3774 │                               Layer ID   │   1│   1│   1│   1│
3775 │                               Subtable ID│   7│   7│   8│   8│
3776 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
3777 │     No  QN61 Yes QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3778 │                               Layer ID   │   1│   1│   1│   1│
3779 │                               Subtable ID│   9│   9│  10│  10│
3780 │                          ╶───────────────┼────┼────┼────┼────┤
3781 │                           No  Table ID   │   1│   1│   1│   1│
3782 │                               Layer ID   │   1│   1│   1│   1│
3783 │                               Subtable ID│   9│   9│  10│  10│
3784 │                      ╶───────────────────┼────┼────┼────┼────┤
3785 │                       No  Yes Table ID   │   1│   1│   1│   1│
3786 │                               Layer ID   │   1│   1│   1│   1│
3787 │                               Subtable ID│  11│  11│  12│  12│
3788 │                          ╶───────────────┼────┼────┼────┼────┤
3789 │                           No  Table ID   │   1│   1│   1│   1│
3790 │                               Layer ID   │   1│   1│   1│   1│
3791 │                               Subtable ID│  11│  11│  12│  12│
3792 │             ╶────────────────────────────┼────┼────┼────┼────┤
3793 │              No  QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3794 │                               Layer ID   │   1│   1│   1│   1│
3795 │                               Subtable ID│  13│  13│  14│  14│
3796 │                          ╶───────────────┼────┼────┼────┼────┤
3797 │                           No  Table ID   │   1│   1│   1│   1│
3798 │                               Layer ID   │   1│   1│   1│   1│
3799 │                               Subtable ID│  13│  13│  14│  14│
3800 │                      ╶───────────────────┼────┼────┼────┼────┤
3801 │                       No  Yes Table ID   │   1│   1│   1│   1│
3802 │                               Layer ID   │   1│   1│   1│   1│
3803 │                               Subtable ID│  15│  15│  16│  16│
3804 │                          ╶───────────────┼────┼────┼────┼────┤
3805 │                           No  Table ID   │   1│   1│   1│   1│
3806 │                               Layer ID   │   1│   1│   1│   1│
3807 │                               Subtable ID│  15│  15│  16│  16│
3808 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
3809
3810                           Custom Tables
3811 Female
3812 ╭──────────────────────────────────────────┬───────────────────╮
3813 │                                          │        QN27       │
3814 │                                          ├─────────┬─────────┤
3815 │                                          │   Yes   │    No   │
3816 │                                          ├─────────┼─────────┤
3817 │                                          │  QND7A  │  QND7A  │
3818 │                                          ├────┬────┼────┬────┤
3819 │                                          │ Yes│ No │ Yes│ No │
3820 │                                          ├────┼────┼────┼────┤
3821 │                                          │QN86│QN86│QN86│QN86│
3822 ├──────────────────────────────────────────┼────┼────┼────┼────┤
3823 │QN26 Yes QN61 Yes QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3824 │                               Layer ID   │   2│   2│   2│   2│
3825 │                               Subtable ID│  17│  17│  18│  18│
3826 │                          ╶───────────────┼────┼────┼────┼────┤
3827 │                           No  Table ID   │   1│   1│   1│   1│
3828 │                               Layer ID   │   2│   2│   2│   2│
3829 │                               Subtable ID│  17│  17│  18│  18│
3830 │                      ╶───────────────────┼────┼────┼────┼────┤
3831 │                       No  Yes Table ID   │   1│   1│   1│   1│
3832 │                               Layer ID   │   2│   2│   2│   2│
3833 │                               Subtable ID│  19│  19│  20│  20│
3834 │                          ╶───────────────┼────┼────┼────┼────┤
3835 │                           No  Table ID   │   1│   1│   1│   1│
3836 │                               Layer ID   │   2│   2│   2│   2│
3837 │                               Subtable ID│  19│  19│  20│  20│
3838 │             ╶────────────────────────────┼────┼────┼────┼────┤
3839 │              No  QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3840 │                               Layer ID   │   2│   2│   2│   2│
3841 │                               Subtable ID│  21│  21│  22│  22│
3842 │                          ╶───────────────┼────┼────┼────┼────┤
3843 │                           No  Table ID   │   1│   1│   1│   1│
3844 │                               Layer ID   │   2│   2│   2│   2│
3845 │                               Subtable ID│  21│  21│  22│  22│
3846 │                      ╶───────────────────┼────┼────┼────┼────┤
3847 │                       No  Yes Table ID   │   1│   1│   1│   1│
3848 │                               Layer ID   │   2│   2│   2│   2│
3849 │                               Subtable ID│  23│  23│  24│  24│
3850 │                          ╶───────────────┼────┼────┼────┼────┤
3851 │                           No  Table ID   │   1│   1│   1│   1│
3852 │                               Layer ID   │   2│   2│   2│   2│
3853 │                               Subtable ID│  23│  23│  24│  24│
3854 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
3855 │     No  QN61 Yes QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3856 │                               Layer ID   │   2│   2│   2│   2│
3857 │                               Subtable ID│  25│  25│  26│  26│
3858 │                          ╶───────────────┼────┼────┼────┼────┤
3859 │                           No  Table ID   │   1│   1│   1│   1│
3860 │                               Layer ID   │   2│   2│   2│   2│
3861 │                               Subtable ID│  25│  25│  26│  26│
3862 │                      ╶───────────────────┼────┼────┼────┼────┤
3863 │                       No  Yes Table ID   │   1│   1│   1│   1│
3864 │                               Layer ID   │   2│   2│   2│   2│
3865 │                               Subtable ID│  27│  27│  28│  28│
3866 │                          ╶───────────────┼────┼────┼────┼────┤
3867 │                           No  Table ID   │   1│   1│   1│   1│
3868 │                               Layer ID   │   2│   2│   2│   2│
3869 │                               Subtable ID│  27│  27│  28│  28│
3870 │             ╶────────────────────────────┼────┼────┼────┼────┤
3871 │              No  QN57 Yes Yes Table ID   │   1│   1│   1│   1│
3872 │                               Layer ID   │   2│   2│   2│   2│
3873 │                               Subtable ID│  29│  29│  30│  30│
3874 │                          ╶───────────────┼────┼────┼────┼────┤
3875 │                           No  Table ID   │   1│   1│   1│   1│
3876 │                               Layer ID   │   2│   2│   2│   2│
3877 │                               Subtable ID│  29│  29│  30│  30│
3878 │                      ╶───────────────────┼────┼────┼────┼────┤
3879 │                       No  Yes Table ID   │   1│   1│   1│   1│
3880 │                               Layer ID   │   2│   2│   2│   2│
3881 │                               Subtable ID│  31│  31│  32│  32│
3882 │                          ╶───────────────┼────┼────┼────┼────┤
3883 │                           No  Table ID   │   1│   1│   1│   1│
3884 │                               Layer ID   │   2│   2│   2│   2│
3885 │                               Subtable ID│  31│  31│  32│  32│
3886 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
3887
3888                           Custom Tables
3889 Male
3890 ╭───────────────────────────────────────────┬───────────────────╮
3891 │                                           │        QN27       │
3892 │                                           ├─────────┬─────────┤
3893 │                                           │   Yes   │    No   │
3894 │                                           ├─────────┼─────────┤
3895 │                                           │  QND7A  │  QND7A  │
3896 │                                           ├────┬────┼────┬────┤
3897 │                                           │ Yes│ No │ Yes│ No │
3898 │                                           ├────┼────┼────┼────┤
3899 │                                           │QN86│QN86│QN86│QN86│
3900 ├───────────────────────────────────────────┼────┼────┼────┼────┤
3901 │QN26 Yes QN61 Yes QN57 Yes Yes Row ID      │   1│   1│   3│   3│
3902 │                               Layer Row ID│   1│   1│   1│   1│
3903 │                          ╶────────────────┼────┼────┼────┼────┤
3904 │                           No  Row ID      │   2│   2│   4│   4│
3905 │                               Layer Row ID│   2│   2│   2│   2│
3906 │                      ╶────────────────────┼────┼────┼────┼────┤
3907 │                       No  Yes Row ID      │   5│   5│   7│   7│
3908 │                               Layer Row ID│   3│   3│   3│   3│
3909 │                          ╶────────────────┼────┼────┼────┼────┤
3910 │                           No  Row ID      │   6│   6│   8│   8│
3911 │                               Layer Row ID│   4│   4│   4│   4│
3912 │             ╶─────────────────────────────┼────┼────┼────┼────┤
3913 │              No  QN57 Yes Yes Row ID      │   9│   9│  11│  11│
3914 │                               Layer Row ID│   5│   5│   5│   5│
3915 │                          ╶────────────────┼────┼────┼────┼────┤
3916 │                           No  Row ID      │  10│  10│  12│  12│
3917 │                               Layer Row ID│   6│   6│   6│   6│
3918 │                      ╶────────────────────┼────┼────┼────┼────┤
3919 │                       No  Yes Row ID      │  13│  13│  15│  15│
3920 │                               Layer Row ID│   7│   7│   7│   7│
3921 │                          ╶────────────────┼────┼────┼────┼────┤
3922 │                           No  Row ID      │  14│  14│  16│  16│
3923 │                               Layer Row ID│   8│   8│   8│   8│
3924 │    ╶──────────────────────────────────────┼────┼────┼────┼────┤
3925 │     No  QN61 Yes QN57 Yes Yes Row ID      │  17│  17│  19│  19│
3926 │                               Layer Row ID│   9│   9│   9│   9│
3927 │                          ╶────────────────┼────┼────┼────┼────┤
3928 │                           No  Row ID      │  18│  18│  20│  20│
3929 │                               Layer Row ID│  10│  10│  10│  10│
3930 │                      ╶────────────────────┼────┼────┼────┼────┤
3931 │                       No  Yes Row ID      │  21│  21│  23│  23│
3932 │                               Layer Row ID│  11│  11│  11│  11│
3933 │                          ╶────────────────┼────┼────┼────┼────┤
3934 │                           No  Row ID      │  22│  22│  24│  24│
3935 │                               Layer Row ID│  12│  12│  12│  12│
3936 │             ╶─────────────────────────────┼────┼────┼────┼────┤
3937 │              No  QN57 Yes Yes Row ID      │  25│  25│  27│  27│
3938 │                               Layer Row ID│  13│  13│  13│  13│
3939 │                          ╶────────────────┼────┼────┼────┼────┤
3940 │                           No  Row ID      │  26│  26│  28│  28│
3941 │                               Layer Row ID│  14│  14│  14│  14│
3942 │                      ╶────────────────────┼────┼────┼────┼────┤
3943 │                       No  Yes Row ID      │  29│  29│  31│  31│
3944 │                               Layer Row ID│  15│  15│  15│  15│
3945 │                          ╶────────────────┼────┼────┼────┼────┤
3946 │                           No  Row ID      │  30│  30│  32│  32│
3947 │                               Layer Row ID│  16│  16│  16│  16│
3948 ╰───────────────────────────────────────────┴────┴────┴────┴────╯
3949
3950                           Custom Tables
3951 Female
3952 ╭───────────────────────────────────────────┬───────────────────╮
3953 │                                           │        QN27       │
3954 │                                           ├─────────┬─────────┤
3955 │                                           │   Yes   │    No   │
3956 │                                           ├─────────┼─────────┤
3957 │                                           │  QND7A  │  QND7A  │
3958 │                                           ├────┬────┼────┬────┤
3959 │                                           │ Yes│ No │ Yes│ No │
3960 │                                           ├────┼────┼────┼────┤
3961 │                                           │QN86│QN86│QN86│QN86│
3962 ├───────────────────────────────────────────┼────┼────┼────┼────┤
3963 │QN26 Yes QN61 Yes QN57 Yes Yes Row ID      │  33│  33│  35│  35│
3964 │                               Layer Row ID│  17│  17│  17│  17│
3965 │                          ╶────────────────┼────┼────┼────┼────┤
3966 │                           No  Row ID      │  34│  34│  36│  36│
3967 │                               Layer Row ID│  18│  18│  18│  18│
3968 │                      ╶────────────────────┼────┼────┼────┼────┤
3969 │                       No  Yes Row ID      │  37│  37│  39│  39│
3970 │                               Layer Row ID│  19│  19│  19│  19│
3971 │                          ╶────────────────┼────┼────┼────┼────┤
3972 │                           No  Row ID      │  38│  38│  40│  40│
3973 │                               Layer Row ID│  20│  20│  20│  20│
3974 │             ╶─────────────────────────────┼────┼────┼────┼────┤
3975 │              No  QN57 Yes Yes Row ID      │  41│  41│  43│  43│
3976 │                               Layer Row ID│  21│  21│  21│  21│
3977 │                          ╶────────────────┼────┼────┼────┼────┤
3978 │                           No  Row ID      │  42│  42│  44│  44│
3979 │                               Layer Row ID│  22│  22│  22│  22│
3980 │                      ╶────────────────────┼────┼────┼────┼────┤
3981 │                       No  Yes Row ID      │  45│  45│  47│  47│
3982 │                               Layer Row ID│  23│  23│  23│  23│
3983 │                          ╶────────────────┼────┼────┼────┼────┤
3984 │                           No  Row ID      │  46│  46│  48│  48│
3985 │                               Layer Row ID│  24│  24│  24│  24│
3986 │    ╶──────────────────────────────────────┼────┼────┼────┼────┤
3987 │     No  QN61 Yes QN57 Yes Yes Row ID      │  49│  49│  51│  51│
3988 │                               Layer Row ID│  25│  25│  25│  25│
3989 │                          ╶────────────────┼────┼────┼────┼────┤
3990 │                           No  Row ID      │  50│  50│  52│  52│
3991 │                               Layer Row ID│  26│  26│  26│  26│
3992 │                      ╶────────────────────┼────┼────┼────┼────┤
3993 │                       No  Yes Row ID      │  53│  53│  55│  55│
3994 │                               Layer Row ID│  27│  27│  27│  27│
3995 │                          ╶────────────────┼────┼────┼────┼────┤
3996 │                           No  Row ID      │  54│  54│  56│  56│
3997 │                               Layer Row ID│  28│  28│  28│  28│
3998 │             ╶─────────────────────────────┼────┼────┼────┼────┤
3999 │              No  QN57 Yes Yes Row ID      │  57│  57│  59│  59│
4000 │                               Layer Row ID│  29│  29│  29│  29│
4001 │                          ╶────────────────┼────┼────┼────┼────┤
4002 │                           No  Row ID      │  58│  58│  60│  60│
4003 │                               Layer Row ID│  30│  30│  30│  30│
4004 │                      ╶────────────────────┼────┼────┼────┼────┤
4005 │                       No  Yes Row ID      │  61│  61│  63│  63│
4006 │                               Layer Row ID│  31│  31│  31│  31│
4007 │                          ╶────────────────┼────┼────┼────┼────┤
4008 │                           No  Row ID      │  62│  62│  64│  64│
4009 │                               Layer Row ID│  32│  32│  32│  32│
4010 ╰───────────────────────────────────────────┴────┴────┴────┴────╯
4011
4012                             Custom Tables
4013 Male
4014 ╭──────────────────────────────────────────────┬───────────────────╮
4015 │                                              │        QN27       │
4016 │                                              ├─────────┬─────────┤
4017 │                                              │   Yes   │    No   │
4018 │                                              ├─────────┼─────────┤
4019 │                                              │  QND7A  │  QND7A  │
4020 │                                              ├────┬────┼────┬────┤
4021 │                                              │ Yes│ No │ Yes│ No │
4022 │                                              ├────┼────┼────┼────┤
4023 │                                              │QN86│QN86│QN86│QN86│
4024 ├──────────────────────────────────────────────┼────┼────┼────┼────┤
4025 │QN26 Yes QN61 Yes QN57 Yes Yes Column ID      │   1│   2│   3│   4│
4026 │                               Layer Column ID│   1│   2│   3│   4│
4027 │                          ╶───────────────────┼────┼────┼────┼────┤
4028 │                           No  Column ID      │   1│   2│   3│   4│
4029 │                               Layer Column ID│   1│   2│   3│   4│
4030 │                      ╶───────────────────────┼────┼────┼────┼────┤
4031 │                       No  Yes Column ID      │   5│   6│   7│   8│
4032 │                               Layer Column ID│   1│   2│   3│   4│
4033 │                          ╶───────────────────┼────┼────┼────┼────┤
4034 │                           No  Column ID      │   5│   6│   7│   8│
4035 │                               Layer Column ID│   1│   2│   3│   4│
4036 │             ╶────────────────────────────────┼────┼────┼────┼────┤
4037 │              No  QN57 Yes Yes Column ID      │   9│  10│  11│  12│
4038 │                               Layer Column ID│   1│   2│   3│   4│
4039 │                          ╶───────────────────┼────┼────┼────┼────┤
4040 │                           No  Column ID      │   9│  10│  11│  12│
4041 │                               Layer Column ID│   1│   2│   3│   4│
4042 │                      ╶───────────────────────┼────┼────┼────┼────┤
4043 │                       No  Yes Column ID      │  13│  14│  15│  16│
4044 │                               Layer Column ID│   1│   2│   3│   4│
4045 │                          ╶───────────────────┼────┼────┼────┼────┤
4046 │                           No  Column ID      │  13│  14│  15│  16│
4047 │                               Layer Column ID│   1│   2│   3│   4│
4048 │    ╶─────────────────────────────────────────┼────┼────┼────┼────┤
4049 │     No  QN61 Yes QN57 Yes Yes Column ID      │  17│  18│  19│  20│
4050 │                               Layer Column ID│   1│   2│   3│   4│
4051 │                          ╶───────────────────┼────┼────┼────┼────┤
4052 │                           No  Column ID      │  17│  18│  19│  20│
4053 │                               Layer Column ID│   1│   2│   3│   4│
4054 │                      ╶───────────────────────┼────┼────┼────┼────┤
4055 │                       No  Yes Column ID      │  21│  22│  23│  24│
4056 │                               Layer Column ID│   1│   2│   3│   4│
4057 │                          ╶───────────────────┼────┼────┼────┼────┤
4058 │                           No  Column ID      │  21│  22│  23│  24│
4059 │                               Layer Column ID│   1│   2│   3│   4│
4060 │             ╶────────────────────────────────┼────┼────┼────┼────┤
4061 │              No  QN57 Yes Yes Column ID      │  25│  26│  27│  28│
4062 │                               Layer Column ID│   1│   2│   3│   4│
4063 │                          ╶───────────────────┼────┼────┼────┼────┤
4064 │                           No  Column ID      │  25│  26│  27│  28│
4065 │                               Layer Column ID│   1│   2│   3│   4│
4066 │                      ╶───────────────────────┼────┼────┼────┼────┤
4067 │                       No  Yes Column ID      │  29│  30│  31│  32│
4068 │                               Layer Column ID│   1│   2│   3│   4│
4069 │                          ╶───────────────────┼────┼────┼────┼────┤
4070 │                           No  Column ID      │  29│  30│  31│  32│
4071 │                               Layer Column ID│   1│   2│   3│   4│
4072 ╰──────────────────────────────────────────────┴────┴────┴────┴────╯
4073
4074                             Custom Tables
4075 Female
4076 ╭──────────────────────────────────────────────┬───────────────────╮
4077 │                                              │        QN27       │
4078 │                                              ├─────────┬─────────┤
4079 │                                              │   Yes   │    No   │
4080 │                                              ├─────────┼─────────┤
4081 │                                              │  QND7A  │  QND7A  │
4082 │                                              ├────┬────┼────┬────┤
4083 │                                              │ Yes│ No │ Yes│ No │
4084 │                                              ├────┼────┼────┼────┤
4085 │                                              │QN86│QN86│QN86│QN86│
4086 ├──────────────────────────────────────────────┼────┼────┼────┼────┤
4087 │QN26 Yes QN61 Yes QN57 Yes Yes Column ID      │  33│  34│  35│  36│
4088 │                               Layer Column ID│   5│   6│   7│   8│
4089 │                          ╶───────────────────┼────┼────┼────┼────┤
4090 │                           No  Column ID      │  33│  34│  35│  36│
4091 │                               Layer Column ID│   5│   6│   7│   8│
4092 │                      ╶───────────────────────┼────┼────┼────┼────┤
4093 │                       No  Yes Column ID      │  37│  38│  39│  40│
4094 │                               Layer Column ID│   5│   6│   7│   8│
4095 │                          ╶───────────────────┼────┼────┼────┼────┤
4096 │                           No  Column ID      │  37│  38│  39│  40│
4097 │                               Layer Column ID│   5│   6│   7│   8│
4098 │             ╶────────────────────────────────┼────┼────┼────┼────┤
4099 │              No  QN57 Yes Yes Column ID      │  41│  42│  43│  44│
4100 │                               Layer Column ID│   5│   6│   7│   8│
4101 │                          ╶───────────────────┼────┼────┼────┼────┤
4102 │                           No  Column ID      │  41│  42│  43│  44│
4103 │                               Layer Column ID│   5│   6│   7│   8│
4104 │                      ╶───────────────────────┼────┼────┼────┼────┤
4105 │                       No  Yes Column ID      │  45│  46│  47│  48│
4106 │                               Layer Column ID│   5│   6│   7│   8│
4107 │                          ╶───────────────────┼────┼────┼────┼────┤
4108 │                           No  Column ID      │  45│  46│  47│  48│
4109 │                               Layer Column ID│   5│   6│   7│   8│
4110 │    ╶─────────────────────────────────────────┼────┼────┼────┼────┤
4111 │     No  QN61 Yes QN57 Yes Yes Column ID      │  49│  50│  51│  52│
4112 │                               Layer Column ID│   5│   6│   7│   8│
4113 │                          ╶───────────────────┼────┼────┼────┼────┤
4114 │                           No  Column ID      │  49│  50│  51│  52│
4115 │                               Layer Column ID│   5│   6│   7│   8│
4116 │                      ╶───────────────────────┼────┼────┼────┼────┤
4117 │                       No  Yes Column ID      │  53│  54│  55│  56│
4118 │                               Layer Column ID│   5│   6│   7│   8│
4119 │                          ╶───────────────────┼────┼────┼────┼────┤
4120 │                           No  Column ID      │  53│  54│  55│  56│
4121 │                               Layer Column ID│   5│   6│   7│   8│
4122 │             ╶────────────────────────────────┼────┼────┼────┼────┤
4123 │              No  QN57 Yes Yes Column ID      │  57│  58│  59│  60│
4124 │                               Layer Column ID│   5│   6│   7│   8│
4125 │                          ╶───────────────────┼────┼────┼────┼────┤
4126 │                           No  Column ID      │  57│  58│  59│  60│
4127 │                               Layer Column ID│   5│   6│   7│   8│
4128 │                      ╶───────────────────────┼────┼────┼────┼────┤
4129 │                       No  Yes Column ID      │  61│  62│  63│  64│
4130 │                               Layer Column ID│   5│   6│   7│   8│
4131 │                          ╶───────────────────┼────┼────┼────┼────┤
4132 │                           No  Column ID      │  61│  62│  63│  64│
4133 │                               Layer Column ID│   5│   6│   7│   8│
4134 ╰──────────────────────────────────────────────┴────┴────┴────┴────╯
4135 ])
4136 AT_CLEANUP
4137
4138 AT_SETUP([CTABLES area definitions with CLABELS ROWLABELS=LAYER])
4139 AT_KEYWORDS([ROWLABELS LAYER])
4140 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
4141 AT_DATA([ctables.sps],
4142 [[GET 'nhtsa.sav'.
4143 CTABLES
4144     /VLABELS VARIABLES=ALL DISPLAY=NAME
4145     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
4146     /SLABELS POSITION=ROW
4147     /CLABELS ROWLABELS=LAYER
4148     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
4149     /SLABELS POSITION=ROW
4150     /CLABELS ROWLABELS=LAYER
4151     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
4152     /SLABELS POSITION=ROW
4153     /CLABELS ROWLABELS=LAYER.
4154 ]])
4155 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
4156                           Custom Tables
4157 Male
4158 Yes
4159 ╭──────────────────────────────────┬───────────────────────────╮
4160 │                                  │            QN27           │
4161 │                                  ├─────────────┬─────────────┤
4162 │                                  │     Yes     │      No     │
4163 │                                  ├─────────────┼─────────────┤
4164 │                                  │    QND7A    │    QND7A    │
4165 │                                  ├──────┬──────┼──────┬──────┤
4166 │                                  │  Yes │  No  │  Yes │  No  │
4167 │                                  ├──────┼──────┼──────┼──────┤
4168 │                                  │ QN86 │ QN86 │ QN86 │ QN86 │
4169 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┤
4170 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│
4171 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4172 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4173 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4174 │                       Subtable ID│  1│ 1│  3│ 3│  5│ 5│  7│ 7│
4175 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4176 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4177 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4178 │                       Subtable ID│  1│ 1│  3│ 3│  5│ 5│  7│ 7│
4179 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4180 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4181 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4182 │                       Subtable ID│  9│ 9│ 11│11│ 13│13│ 15│15│
4183 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4184 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4185 │                       Layer ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4186 │                       Subtable ID│  9│ 9│ 11│11│ 13│13│ 15│15│
4187 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4188
4189                           Custom Tables
4190 Male
4191 No
4192 ╭──────────────────────────────────┬───────────────────────────╮
4193 │                                  │            QN27           │
4194 │                                  ├─────────────┬─────────────┤
4195 │                                  │     Yes     │      No     │
4196 │                                  ├─────────────┼─────────────┤
4197 │                                  │    QND7A    │    QND7A    │
4198 │                                  ├──────┬──────┼──────┬──────┤
4199 │                                  │  Yes │  No  │  Yes │  No  │
4200 │                                  ├──────┼──────┼──────┼──────┤
4201 │                                  │ QN86 │ QN86 │ QN86 │ QN86 │
4202 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┤
4203 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│
4204 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4205 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4206 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│
4207 │                       Subtable ID│  2│ 2│  4│ 4│  6│ 6│  8│ 8│
4208 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4209 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4210 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│
4211 │                       Subtable ID│  2│ 2│  4│ 4│  6│ 6│  8│ 8│
4212 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4213 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4214 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│
4215 │                       Subtable ID│ 10│10│ 12│12│ 14│14│ 16│16│
4216 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4217 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4218 │                       Layer ID   │  2│ 2│  2│ 2│  2│ 2│  2│ 2│
4219 │                       Subtable ID│ 10│10│ 12│12│ 14│14│ 16│16│
4220 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4221
4222                           Custom Tables
4223 Female
4224 Yes
4225 ╭──────────────────────────────────┬───────────────────────────╮
4226 │                                  │            QN27           │
4227 │                                  ├─────────────┬─────────────┤
4228 │                                  │     Yes     │      No     │
4229 │                                  ├─────────────┼─────────────┤
4230 │                                  │    QND7A    │    QND7A    │
4231 │                                  ├──────┬──────┼──────┬──────┤
4232 │                                  │  Yes │  No  │  Yes │  No  │
4233 │                                  ├──────┼──────┼──────┼──────┤
4234 │                                  │ QN86 │ QN86 │ QN86 │ QN86 │
4235 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┤
4236 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│
4237 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4238 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4239 │                       Layer ID   │  3│ 3│  3│ 3│  3│ 3│  3│ 3│
4240 │                       Subtable ID│ 17│17│ 19│19│ 21│21│ 23│23│
4241 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4242 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4243 │                       Layer ID   │  3│ 3│  3│ 3│  3│ 3│  3│ 3│
4244 │                       Subtable ID│ 17│17│ 19│19│ 21│21│ 23│23│
4245 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4246 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4247 │                       Layer ID   │  3│ 3│  3│ 3│  3│ 3│  3│ 3│
4248 │                       Subtable ID│ 25│25│ 27│27│ 29│29│ 31│31│
4249 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4250 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4251 │                       Layer ID   │  3│ 3│  3│ 3│  3│ 3│  3│ 3│
4252 │                       Subtable ID│ 25│25│ 27│27│ 29│29│ 31│31│
4253 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4254
4255                           Custom Tables
4256 Female
4257 No
4258 ╭──────────────────────────────────┬───────────────────────────╮
4259 │                                  │            QN27           │
4260 │                                  ├─────────────┬─────────────┤
4261 │                                  │     Yes     │      No     │
4262 │                                  ├─────────────┼─────────────┤
4263 │                                  │    QND7A    │    QND7A    │
4264 │                                  ├──────┬──────┼──────┬──────┤
4265 │                                  │  Yes │  No  │  Yes │  No  │
4266 │                                  ├──────┼──────┼──────┼──────┤
4267 │                                  │ QN86 │ QN86 │ QN86 │ QN86 │
4268 │                                  ├───┬──┼───┬──┼───┬──┼───┬──┤
4269 │                                  │Yes│No│Yes│No│Yes│No│Yes│No│
4270 ├──────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4271 │QN26 Yes QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4272 │                       Layer ID   │  4│ 4│  4│ 4│  4│ 4│  4│ 4│
4273 │                       Subtable ID│ 18│18│ 20│20│ 22│22│ 24│24│
4274 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4275 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4276 │                       Layer ID   │  4│ 4│  4│ 4│  4│ 4│  4│ 4│
4277 │                       Subtable ID│ 18│18│ 20│20│ 22│22│ 24│24│
4278 │    ╶─────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4279 │     No  QN61 Yes QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4280 │                       Layer ID   │  4│ 4│  4│ 4│  4│ 4│  4│ 4│
4281 │                       Subtable ID│ 26│26│ 28│28│ 30│30│ 32│32│
4282 │             ╶────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4283 │              No  QN57 Table ID   │  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4284 │                       Layer ID   │  4│ 4│  4│ 4│  4│ 4│  4│ 4│
4285 │                       Subtable ID│ 26│26│ 28│28│ 30│30│ 32│32│
4286 ╰──────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4287
4288                           Custom Tables
4289 Male
4290 Yes
4291 ╭───────────────────────────────────┬───────────────────────────╮
4292 │                                   │            QN27           │
4293 │                                   ├─────────────┬─────────────┤
4294 │                                   │     Yes     │      No     │
4295 │                                   ├─────────────┼─────────────┤
4296 │                                   │    QND7A    │    QND7A    │
4297 │                                   ├──────┬──────┼──────┬──────┤
4298 │                                   │  Yes │  No  │  Yes │  No  │
4299 │                                   ├──────┼──────┼──────┼──────┤
4300 │                                   │ QN86 │ QN86 │ QN86 │ QN86 │
4301 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┤
4302 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│
4303 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4304 │QN26 Yes QN61 Yes QN57 Row ID      │  1│ 1│  3│ 3│  5│ 5│  7│ 7│
4305 │                       Layer Row ID│  1│ 1│  1│ 1│  1│ 1│  1│ 1│
4306 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4307 │              No  QN57 Row ID      │  9│ 9│ 11│11│ 13│13│ 15│15│
4308 │                       Layer Row ID│  3│ 3│  3│ 3│  3│ 3│  3│ 3│
4309 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4310 │     No  QN61 Yes QN57 Row ID      │ 17│17│ 19│19│ 21│21│ 23│23│
4311 │                       Layer Row ID│  5│ 5│  5│ 5│  5│ 5│  5│ 5│
4312 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4313 │              No  QN57 Row ID      │ 25│25│ 27│27│ 29│29│ 31│31│
4314 │                       Layer Row ID│  7│ 7│  7│ 7│  7│ 7│  7│ 7│
4315 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4316
4317                           Custom Tables
4318 Male
4319 No
4320 ╭───────────────────────────────────┬───────────────────────────╮
4321 │                                   │            QN27           │
4322 │                                   ├─────────────┬─────────────┤
4323 │                                   │     Yes     │      No     │
4324 │                                   ├─────────────┼─────────────┤
4325 │                                   │    QND7A    │    QND7A    │
4326 │                                   ├──────┬──────┼──────┬──────┤
4327 │                                   │  Yes │  No  │  Yes │  No  │
4328 │                                   ├──────┼──────┼──────┼──────┤
4329 │                                   │ QN86 │ QN86 │ QN86 │ QN86 │
4330 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┤
4331 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│
4332 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4333 │QN26 Yes QN61 Yes QN57 Row ID      │  2│ 2│  4│ 4│  6│ 6│  8│ 8│
4334 │                       Layer Row ID│  2│ 2│  2│ 2│  2│ 2│  2│ 2│
4335 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4336 │              No  QN57 Row ID      │ 10│10│ 12│12│ 14│14│ 16│16│
4337 │                       Layer Row ID│  4│ 4│  4│ 4│  4│ 4│  4│ 4│
4338 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4339 │     No  QN61 Yes QN57 Row ID      │ 18│18│ 20│20│ 22│22│ 24│24│
4340 │                       Layer Row ID│  6│ 6│  6│ 6│  6│ 6│  6│ 6│
4341 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4342 │              No  QN57 Row ID      │ 26│26│ 28│28│ 30│30│ 32│32│
4343 │                       Layer Row ID│  8│ 8│  8│ 8│  8│ 8│  8│ 8│
4344 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4345
4346                           Custom Tables
4347 Female
4348 Yes
4349 ╭───────────────────────────────────┬───────────────────────────╮
4350 │                                   │            QN27           │
4351 │                                   ├─────────────┬─────────────┤
4352 │                                   │     Yes     │      No     │
4353 │                                   ├─────────────┼─────────────┤
4354 │                                   │    QND7A    │    QND7A    │
4355 │                                   ├──────┬──────┼──────┬──────┤
4356 │                                   │  Yes │  No  │  Yes │  No  │
4357 │                                   ├──────┼──────┼──────┼──────┤
4358 │                                   │ QN86 │ QN86 │ QN86 │ QN86 │
4359 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┤
4360 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│
4361 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4362 │QN26 Yes QN61 Yes QN57 Row ID      │ 33│33│ 35│35│ 37│37│ 39│39│
4363 │                       Layer Row ID│  9│ 9│  9│ 9│  9│ 9│  9│ 9│
4364 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4365 │              No  QN57 Row ID      │ 41│41│ 43│43│ 45│45│ 47│47│
4366 │                       Layer Row ID│ 11│11│ 11│11│ 11│11│ 11│11│
4367 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4368 │     No  QN61 Yes QN57 Row ID      │ 49│49│ 51│51│ 53│53│ 55│55│
4369 │                       Layer Row ID│ 13│13│ 13│13│ 13│13│ 13│13│
4370 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4371 │              No  QN57 Row ID      │ 57│57│ 59│59│ 61│61│ 63│63│
4372 │                       Layer Row ID│ 15│15│ 15│15│ 15│15│ 15│15│
4373 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4374
4375                           Custom Tables
4376 Female
4377 No
4378 ╭───────────────────────────────────┬───────────────────────────╮
4379 │                                   │            QN27           │
4380 │                                   ├─────────────┬─────────────┤
4381 │                                   │     Yes     │      No     │
4382 │                                   ├─────────────┼─────────────┤
4383 │                                   │    QND7A    │    QND7A    │
4384 │                                   ├──────┬──────┼──────┬──────┤
4385 │                                   │  Yes │  No  │  Yes │  No  │
4386 │                                   ├──────┼──────┼──────┼──────┤
4387 │                                   │ QN86 │ QN86 │ QN86 │ QN86 │
4388 │                                   ├───┬──┼───┬──┼───┬──┼───┬──┤
4389 │                                   │Yes│No│Yes│No│Yes│No│Yes│No│
4390 ├───────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4391 │QN26 Yes QN61 Yes QN57 Row ID      │ 34│34│ 36│36│ 38│38│ 40│40│
4392 │                       Layer Row ID│ 10│10│ 10│10│ 10│10│ 10│10│
4393 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4394 │              No  QN57 Row ID      │ 42│42│ 44│44│ 46│46│ 48│48│
4395 │                       Layer Row ID│ 12│12│ 12│12│ 12│12│ 12│12│
4396 │    ╶──────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4397 │     No  QN61 Yes QN57 Row ID      │ 50│50│ 52│52│ 54│54│ 56│56│
4398 │                       Layer Row ID│ 14│14│ 14│14│ 14│14│ 14│14│
4399 │             ╶─────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4400 │              No  QN57 Row ID      │ 58│58│ 60│60│ 62│62│ 64│64│
4401 │                       Layer Row ID│ 16│16│ 16│16│ 16│16│ 16│16│
4402 ╰───────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4403
4404                             Custom Tables
4405 Male
4406 Yes
4407 ╭──────────────────────────────────────┬───────────────────────────╮
4408 │                                      │            QN27           │
4409 │                                      ├─────────────┬─────────────┤
4410 │                                      │     Yes     │      No     │
4411 │                                      ├─────────────┼─────────────┤
4412 │                                      │    QND7A    │    QND7A    │
4413 │                                      ├──────┬──────┼──────┬──────┤
4414 │                                      │  Yes │  No  │  Yes │  No  │
4415 │                                      ├──────┼──────┼──────┼──────┤
4416 │                                      │ QN86 │ QN86 │ QN86 │ QN86 │
4417 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┤
4418 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│
4419 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4420 │QN26 Yes QN61 Yes QN57 Column ID      │  1│ 3│  5│ 7│  9│11│ 13│15│
4421 │                       Layer Column ID│  1│ 3│  5│ 7│  9│11│ 13│15│
4422 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4423 │              No  QN57 Column ID      │  1│ 3│  5│ 7│  9│11│ 13│15│
4424 │                       Layer Column ID│  1│ 3│  5│ 7│  9│11│ 13│15│
4425 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4426 │     No  QN61 Yes QN57 Column ID      │ 17│19│ 21│23│ 25│27│ 29│31│
4427 │                       Layer Column ID│  1│ 3│  5│ 7│  9│11│ 13│15│
4428 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4429 │              No  QN57 Column ID      │ 17│19│ 21│23│ 25│27│ 29│31│
4430 │                       Layer Column ID│  1│ 3│  5│ 7│  9│11│ 13│15│
4431 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4432
4433                             Custom Tables
4434 Male
4435 No
4436 ╭──────────────────────────────────────┬───────────────────────────╮
4437 │                                      │            QN27           │
4438 │                                      ├─────────────┬─────────────┤
4439 │                                      │     Yes     │      No     │
4440 │                                      ├─────────────┼─────────────┤
4441 │                                      │    QND7A    │    QND7A    │
4442 │                                      ├──────┬──────┼──────┬──────┤
4443 │                                      │  Yes │  No  │  Yes │  No  │
4444 │                                      ├──────┼──────┼──────┼──────┤
4445 │                                      │ QN86 │ QN86 │ QN86 │ QN86 │
4446 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┤
4447 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│
4448 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4449 │QN26 Yes QN61 Yes QN57 Column ID      │  2│ 4│  6│ 8│ 10│12│ 14│16│
4450 │                       Layer Column ID│  2│ 4│  6│ 8│ 10│12│ 14│16│
4451 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4452 │              No  QN57 Column ID      │  2│ 4│  6│ 8│ 10│12│ 14│16│
4453 │                       Layer Column ID│  2│ 4│  6│ 8│ 10│12│ 14│16│
4454 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4455 │     No  QN61 Yes QN57 Column ID      │ 18│20│ 22│24│ 26│28│ 30│32│
4456 │                       Layer Column ID│  2│ 4│  6│ 8│ 10│12│ 14│16│
4457 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4458 │              No  QN57 Column ID      │ 18│20│ 22│24│ 26│28│ 30│32│
4459 │                       Layer Column ID│  2│ 4│  6│ 8│ 10│12│ 14│16│
4460 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4461
4462                             Custom Tables
4463 Female
4464 Yes
4465 ╭──────────────────────────────────────┬───────────────────────────╮
4466 │                                      │            QN27           │
4467 │                                      ├─────────────┬─────────────┤
4468 │                                      │     Yes     │      No     │
4469 │                                      ├─────────────┼─────────────┤
4470 │                                      │    QND7A    │    QND7A    │
4471 │                                      ├──────┬──────┼──────┬──────┤
4472 │                                      │  Yes │  No  │  Yes │  No  │
4473 │                                      ├──────┼──────┼──────┼──────┤
4474 │                                      │ QN86 │ QN86 │ QN86 │ QN86 │
4475 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┤
4476 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│
4477 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4478 │QN26 Yes QN61 Yes QN57 Column ID      │ 33│35│ 37│39│ 41│43│ 45│47│
4479 │                       Layer Column ID│ 17│19│ 21│23│ 25│27│ 29│31│
4480 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4481 │              No  QN57 Column ID      │ 33│35│ 37│39│ 41│43│ 45│47│
4482 │                       Layer Column ID│ 17│19│ 21│23│ 25│27│ 29│31│
4483 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4484 │     No  QN61 Yes QN57 Column ID      │ 49│51│ 53│55│ 57│59│ 61│63│
4485 │                       Layer Column ID│ 17│19│ 21│23│ 25│27│ 29│31│
4486 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4487 │              No  QN57 Column ID      │ 49│51│ 53│55│ 57│59│ 61│63│
4488 │                       Layer Column ID│ 17│19│ 21│23│ 25│27│ 29│31│
4489 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4490
4491                             Custom Tables
4492 Female
4493 No
4494 ╭──────────────────────────────────────┬───────────────────────────╮
4495 │                                      │            QN27           │
4496 │                                      ├─────────────┬─────────────┤
4497 │                                      │     Yes     │      No     │
4498 │                                      ├─────────────┼─────────────┤
4499 │                                      │    QND7A    │    QND7A    │
4500 │                                      ├──────┬──────┼──────┬──────┤
4501 │                                      │  Yes │  No  │  Yes │  No  │
4502 │                                      ├──────┼──────┼──────┼──────┤
4503 │                                      │ QN86 │ QN86 │ QN86 │ QN86 │
4504 │                                      ├───┬──┼───┬──┼───┬──┼───┬──┤
4505 │                                      │Yes│No│Yes│No│Yes│No│Yes│No│
4506 ├──────────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4507 │QN26 Yes QN61 Yes QN57 Column ID      │ 34│36│ 38│40│ 42│44│ 46│48│
4508 │                       Layer Column ID│ 18│20│ 22│24│ 26│28│ 30│32│
4509 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4510 │              No  QN57 Column ID      │ 34│36│ 38│40│ 42│44│ 46│48│
4511 │                       Layer Column ID│ 18│20│ 22│24│ 26│28│ 30│32│
4512 │    ╶─────────────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4513 │     No  QN61 Yes QN57 Column ID      │ 50│52│ 54│56│ 58│60│ 62│64│
4514 │                       Layer Column ID│ 18│20│ 22│24│ 26│28│ 30│32│
4515 │             ╶────────────────────────┼───┼──┼───┼──┼───┼──┼───┼──┤
4516 │              No  QN57 Column ID      │ 50│52│ 54│56│ 58│60│ 62│64│
4517 │                       Layer Column ID│ 18│20│ 22│24│ 26│28│ 30│32│
4518 ╰──────────────────────────────────────┴───┴──┴───┴──┴───┴──┴───┴──╯
4519 ])
4520 AT_CLEANUP
4521
4522 AT_SETUP([CTABLES area definitions with CLABELS COLLABELS=LAYER])
4523 AT_KEYWORDS([COLLABELS LAYER])
4524 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
4525 AT_DATA([ctables.sps],
4526 [[GET 'nhtsa.sav'.
4527 CTABLES
4528     /VLABELS VARIABLES=ALL DISPLAY=NAME
4529     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[TABLEID, LAYERID, SUBTABLEID]
4530     /SLABELS POSITION=ROW
4531     /CLABELS COLLABELS=LAYER
4532     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[ROWID, LAYERROWID]
4533     /SLABELS POSITION=ROW
4534     /CLABELS COLLABELS=LAYER
4535     /TABLE qn26 > qn61 > qn57 BY qn27 > qnd7a > qn86 BY qns3a[COLID, LAYERCOLID]
4536     /SLABELS POSITION=ROW
4537     /CLABELS COLLABELS=LAYER.
4538 ]])
4539 AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
4540                         Custom Tables
4541 Male
4542 Yes
4543 ╭──────────────────────────────────────┬───────────────────╮
4544 │                                      │        QN27       │
4545 │                                      ├─────────┬─────────┤
4546 │                                      │   Yes   │    No   │
4547 │                                      ├─────────┼─────────┤
4548 │                                      │  QND7A  │  QND7A  │
4549 │                                      ├────┬────┼────┬────┤
4550 │                                      │ Yes│ No │ Yes│ No │
4551 │                                      ├────┼────┼────┼────┤
4552 │                                      │QN86│QN86│QN86│QN86│
4553 ├──────────────────────────────────────┼────┼────┼────┼────┤
4554 │QN26 Yes QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4555 │                           Layer ID   │   1│   1│   1│   1│
4556 │                           Subtable ID│   1│   1│   3│   3│
4557 │                      ╶───────────────┼────┼────┼────┼────┤
4558 │                       No  Table ID   │   1│   1│   1│   1│
4559 │                           Layer ID   │   1│   1│   1│   1│
4560 │                           Subtable ID│   1│   1│   3│   3│
4561 │             ╶────────────────────────┼────┼────┼────┼────┤
4562 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4563 │                           Layer ID   │   1│   1│   1│   1│
4564 │                           Subtable ID│   5│   5│   7│   7│
4565 │                      ╶───────────────┼────┼────┼────┼────┤
4566 │                       No  Table ID   │   1│   1│   1│   1│
4567 │                           Layer ID   │   1│   1│   1│   1│
4568 │                           Subtable ID│   5│   5│   7│   7│
4569 │    ╶─────────────────────────────────┼────┼────┼────┼────┤
4570 │     No  QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4571 │                           Layer ID   │   1│   1│   1│   1│
4572 │                           Subtable ID│   9│   9│  11│  11│
4573 │                      ╶───────────────┼────┼────┼────┼────┤
4574 │                       No  Table ID   │   1│   1│   1│   1│
4575 │                           Layer ID   │   1│   1│   1│   1│
4576 │                           Subtable ID│   9│   9│  11│  11│
4577 │             ╶────────────────────────┼────┼────┼────┼────┤
4578 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4579 │                           Layer ID   │   1│   1│   1│   1│
4580 │                           Subtable ID│  13│  13│  15│  15│
4581 │                      ╶───────────────┼────┼────┼────┼────┤
4582 │                       No  Table ID   │   1│   1│   1│   1│
4583 │                           Layer ID   │   1│   1│   1│   1│
4584 │                           Subtable ID│  13│  13│  15│  15│
4585 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4586
4587                         Custom Tables
4588 Male
4589 No
4590 ╭──────────────────────────────────────┬───────────────────╮
4591 │                                      │        QN27       │
4592 │                                      ├─────────┬─────────┤
4593 │                                      │   Yes   │    No   │
4594 │                                      ├─────────┼─────────┤
4595 │                                      │  QND7A  │  QND7A  │
4596 │                                      ├────┬────┼────┬────┤
4597 │                                      │ Yes│ No │ Yes│ No │
4598 │                                      ├────┼────┼────┼────┤
4599 │                                      │QN86│QN86│QN86│QN86│
4600 ├──────────────────────────────────────┼────┼────┼────┼────┤
4601 │QN26 Yes QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4602 │                           Layer ID   │   2│   2│   2│   2│
4603 │                           Subtable ID│   2│   2│   4│   4│
4604 │                      ╶───────────────┼────┼────┼────┼────┤
4605 │                       No  Table ID   │   1│   1│   1│   1│
4606 │                           Layer ID   │   2│   2│   2│   2│
4607 │                           Subtable ID│   2│   2│   4│   4│
4608 │             ╶────────────────────────┼────┼────┼────┼────┤
4609 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4610 │                           Layer ID   │   2│   2│   2│   2│
4611 │                           Subtable ID│   6│   6│   8│   8│
4612 │                      ╶───────────────┼────┼────┼────┼────┤
4613 │                       No  Table ID   │   1│   1│   1│   1│
4614 │                           Layer ID   │   2│   2│   2│   2│
4615 │                           Subtable ID│   6│   6│   8│   8│
4616 │    ╶─────────────────────────────────┼────┼────┼────┼────┤
4617 │     No  QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4618 │                           Layer ID   │   2│   2│   2│   2│
4619 │                           Subtable ID│  10│  10│  12│  12│
4620 │                      ╶───────────────┼────┼────┼────┼────┤
4621 │                       No  Table ID   │   1│   1│   1│   1│
4622 │                           Layer ID   │   2│   2│   2│   2│
4623 │                           Subtable ID│  10│  10│  12│  12│
4624 │             ╶────────────────────────┼────┼────┼────┼────┤
4625 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4626 │                           Layer ID   │   2│   2│   2│   2│
4627 │                           Subtable ID│  14│  14│  16│  16│
4628 │                      ╶───────────────┼────┼────┼────┼────┤
4629 │                       No  Table ID   │   1│   1│   1│   1│
4630 │                           Layer ID   │   2│   2│   2│   2│
4631 │                           Subtable ID│  14│  14│  16│  16│
4632 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4633
4634                         Custom Tables
4635 Female
4636 Yes
4637 ╭──────────────────────────────────────┬───────────────────╮
4638 │                                      │        QN27       │
4639 │                                      ├─────────┬─────────┤
4640 │                                      │   Yes   │    No   │
4641 │                                      ├─────────┼─────────┤
4642 │                                      │  QND7A  │  QND7A  │
4643 │                                      ├────┬────┼────┬────┤
4644 │                                      │ Yes│ No │ Yes│ No │
4645 │                                      ├────┼────┼────┼────┤
4646 │                                      │QN86│QN86│QN86│QN86│
4647 ├──────────────────────────────────────┼────┼────┼────┼────┤
4648 │QN26 Yes QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4649 │                           Layer ID   │   3│   3│   3│   3│
4650 │                           Subtable ID│  17│  17│  19│  19│
4651 │                      ╶───────────────┼────┼────┼────┼────┤
4652 │                       No  Table ID   │   1│   1│   1│   1│
4653 │                           Layer ID   │   3│   3│   3│   3│
4654 │                           Subtable ID│  17│  17│  19│  19│
4655 │             ╶────────────────────────┼────┼────┼────┼────┤
4656 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4657 │                           Layer ID   │   3│   3│   3│   3│
4658 │                           Subtable ID│  21│  21│  23│  23│
4659 │                      ╶───────────────┼────┼────┼────┼────┤
4660 │                       No  Table ID   │   1│   1│   1│   1│
4661 │                           Layer ID   │   3│   3│   3│   3│
4662 │                           Subtable ID│  21│  21│  23│  23│
4663 │    ╶─────────────────────────────────┼────┼────┼────┼────┤
4664 │     No  QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4665 │                           Layer ID   │   3│   3│   3│   3│
4666 │                           Subtable ID│  25│  25│  27│  27│
4667 │                      ╶───────────────┼────┼────┼────┼────┤
4668 │                       No  Table ID   │   1│   1│   1│   1│
4669 │                           Layer ID   │   3│   3│   3│   3│
4670 │                           Subtable ID│  25│  25│  27│  27│
4671 │             ╶────────────────────────┼────┼────┼────┼────┤
4672 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4673 │                           Layer ID   │   3│   3│   3│   3│
4674 │                           Subtable ID│  29│  29│  31│  31│
4675 │                      ╶───────────────┼────┼────┼────┼────┤
4676 │                       No  Table ID   │   1│   1│   1│   1│
4677 │                           Layer ID   │   3│   3│   3│   3│
4678 │                           Subtable ID│  29│  29│  31│  31│
4679 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4680
4681                         Custom Tables
4682 Female
4683 No
4684 ╭──────────────────────────────────────┬───────────────────╮
4685 │                                      │        QN27       │
4686 │                                      ├─────────┬─────────┤
4687 │                                      │   Yes   │    No   │
4688 │                                      ├─────────┼─────────┤
4689 │                                      │  QND7A  │  QND7A  │
4690 │                                      ├────┬────┼────┬────┤
4691 │                                      │ Yes│ No │ Yes│ No │
4692 │                                      ├────┼────┼────┼────┤
4693 │                                      │QN86│QN86│QN86│QN86│
4694 ├──────────────────────────────────────┼────┼────┼────┼────┤
4695 │QN26 Yes QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4696 │                           Layer ID   │   4│   4│   4│   4│
4697 │                           Subtable ID│  18│  18│  20│  20│
4698 │                      ╶───────────────┼────┼────┼────┼────┤
4699 │                       No  Table ID   │   1│   1│   1│   1│
4700 │                           Layer ID   │   4│   4│   4│   4│
4701 │                           Subtable ID│  18│  18│  20│  20│
4702 │             ╶────────────────────────┼────┼────┼────┼────┤
4703 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4704 │                           Layer ID   │   4│   4│   4│   4│
4705 │                           Subtable ID│  22│  22│  24│  24│
4706 │                      ╶───────────────┼────┼────┼────┼────┤
4707 │                       No  Table ID   │   1│   1│   1│   1│
4708 │                           Layer ID   │   4│   4│   4│   4│
4709 │                           Subtable ID│  22│  22│  24│  24│
4710 │    ╶─────────────────────────────────┼────┼────┼────┼────┤
4711 │     No  QN61 Yes QN57 Yes Table ID   │   1│   1│   1│   1│
4712 │                           Layer ID   │   4│   4│   4│   4│
4713 │                           Subtable ID│  26│  26│  28│  28│
4714 │                      ╶───────────────┼────┼────┼────┼────┤
4715 │                       No  Table ID   │   1│   1│   1│   1│
4716 │                           Layer ID   │   4│   4│   4│   4│
4717 │                           Subtable ID│  26│  26│  28│  28│
4718 │             ╶────────────────────────┼────┼────┼────┼────┤
4719 │              No  QN57 Yes Table ID   │   1│   1│   1│   1│
4720 │                           Layer ID   │   4│   4│   4│   4│
4721 │                           Subtable ID│  30│  30│  32│  32│
4722 │                      ╶───────────────┼────┼────┼────┼────┤
4723 │                       No  Table ID   │   1│   1│   1│   1│
4724 │                           Layer ID   │   4│   4│   4│   4│
4725 │                           Subtable ID│  30│  30│  32│  32│
4726 ╰──────────────────────────────────────┴────┴────┴────┴────╯
4727
4728                         Custom Tables
4729 Male
4730 Yes
4731 ╭───────────────────────────────────────┬───────────────────╮
4732 │                                       │        QN27       │
4733 │                                       ├─────────┬─────────┤
4734 │                                       │   Yes   │    No   │
4735 │                                       ├─────────┼─────────┤
4736 │                                       │  QND7A  │  QND7A  │
4737 │                                       ├────┬────┼────┬────┤
4738 │                                       │ Yes│ No │ Yes│ No │
4739 │                                       ├────┼────┼────┼────┤
4740 │                                       │QN86│QN86│QN86│QN86│
4741 ├───────────────────────────────────────┼────┼────┼────┼────┤
4742 │QN26 Yes QN61 Yes QN57 Yes Row ID      │   1│   1│   3│   3│
4743 │                           Layer Row ID│   1│   1│   1│   1│
4744 │                      ╶────────────────┼────┼────┼────┼────┤
4745 │                       No  Row ID      │   5│   5│   7│   7│
4746 │                           Layer Row ID│   3│   3│   3│   3│
4747 │             ╶─────────────────────────┼────┼────┼────┼────┤
4748 │              No  QN57 Yes Row ID      │   9│   9│  11│  11│
4749 │                           Layer Row ID│   5│   5│   5│   5│
4750 │                      ╶────────────────┼────┼────┼────┼────┤
4751 │                       No  Row ID      │  13│  13│  15│  15│
4752 │                           Layer Row ID│   7│   7│   7│   7│
4753 │    ╶──────────────────────────────────┼────┼────┼────┼────┤
4754 │     No  QN61 Yes QN57 Yes Row ID      │  17│  17│  19│  19│
4755 │                           Layer Row ID│   9│   9│   9│   9│
4756 │                      ╶────────────────┼────┼────┼────┼────┤
4757 │                       No  Row ID      │  21│  21│  23│  23│
4758 │                           Layer Row ID│  11│  11│  11│  11│
4759 │             ╶─────────────────────────┼────┼────┼────┼────┤
4760 │              No  QN57 Yes Row ID      │  25│  25│  27│  27│
4761 │                           Layer Row ID│  13│  13│  13│  13│
4762 │                      ╶────────────────┼────┼────┼────┼────┤
4763 │                       No  Row ID      │  29│  29│  31│  31│
4764 │                           Layer Row ID│  15│  15│  15│  15│
4765 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4766
4767                         Custom Tables
4768 Male
4769 No
4770 ╭───────────────────────────────────────┬───────────────────╮
4771 │                                       │        QN27       │
4772 │                                       ├─────────┬─────────┤
4773 │                                       │   Yes   │    No   │
4774 │                                       ├─────────┼─────────┤
4775 │                                       │  QND7A  │  QND7A  │
4776 │                                       ├────┬────┼────┬────┤
4777 │                                       │ Yes│ No │ Yes│ No │
4778 │                                       ├────┼────┼────┼────┤
4779 │                                       │QN86│QN86│QN86│QN86│
4780 ├───────────────────────────────────────┼────┼────┼────┼────┤
4781 │QN26 Yes QN61 Yes QN57 Yes Row ID      │   2│   2│   4│   4│
4782 │                           Layer Row ID│   2│   2│   2│   2│
4783 │                      ╶────────────────┼────┼────┼────┼────┤
4784 │                       No  Row ID      │   6│   6│   8│   8│
4785 │                           Layer Row ID│   4│   4│   4│   4│
4786 │             ╶─────────────────────────┼────┼────┼────┼────┤
4787 │              No  QN57 Yes Row ID      │  10│  10│  12│  12│
4788 │                           Layer Row ID│   6│   6│   6│   6│
4789 │                      ╶────────────────┼────┼────┼────┼────┤
4790 │                       No  Row ID      │  14│  14│  16│  16│
4791 │                           Layer Row ID│   8│   8│   8│   8│
4792 │    ╶──────────────────────────────────┼────┼────┼────┼────┤
4793 │     No  QN61 Yes QN57 Yes Row ID      │  18│  18│  20│  20│
4794 │                           Layer Row ID│  10│  10│  10│  10│
4795 │                      ╶────────────────┼────┼────┼────┼────┤
4796 │                       No  Row ID      │  22│  22│  24│  24│
4797 │                           Layer Row ID│  12│  12│  12│  12│
4798 │             ╶─────────────────────────┼────┼────┼────┼────┤
4799 │              No  QN57 Yes Row ID      │  26│  26│  28│  28│
4800 │                           Layer Row ID│  14│  14│  14│  14│
4801 │                      ╶────────────────┼────┼────┼────┼────┤
4802 │                       No  Row ID      │  30│  30│  32│  32│
4803 │                           Layer Row ID│  16│  16│  16│  16│
4804 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4805
4806                         Custom Tables
4807 Female
4808 Yes
4809 ╭───────────────────────────────────────┬───────────────────╮
4810 │                                       │        QN27       │
4811 │                                       ├─────────┬─────────┤
4812 │                                       │   Yes   │    No   │
4813 │                                       ├─────────┼─────────┤
4814 │                                       │  QND7A  │  QND7A  │
4815 │                                       ├────┬────┼────┬────┤
4816 │                                       │ Yes│ No │ Yes│ No │
4817 │                                       ├────┼────┼────┼────┤
4818 │                                       │QN86│QN86│QN86│QN86│
4819 ├───────────────────────────────────────┼────┼────┼────┼────┤
4820 │QN26 Yes QN61 Yes QN57 Yes Row ID      │  33│  33│  35│  35│
4821 │                           Layer Row ID│  17│  17│  17│  17│
4822 │                      ╶────────────────┼────┼────┼────┼────┤
4823 │                       No  Row ID      │  37│  37│  39│  39│
4824 │                           Layer Row ID│  19│  19│  19│  19│
4825 │             ╶─────────────────────────┼────┼────┼────┼────┤
4826 │              No  QN57 Yes Row ID      │  41│  41│  43│  43│
4827 │                           Layer Row ID│  21│  21│  21│  21│
4828 │                      ╶────────────────┼────┼────┼────┼────┤
4829 │                       No  Row ID      │  45│  45│  47│  47│
4830 │                           Layer Row ID│  23│  23│  23│  23│
4831 │    ╶──────────────────────────────────┼────┼────┼────┼────┤
4832 │     No  QN61 Yes QN57 Yes Row ID      │  49│  49│  51│  51│
4833 │                           Layer Row ID│  25│  25│  25│  25│
4834 │                      ╶────────────────┼────┼────┼────┼────┤
4835 │                       No  Row ID      │  53│  53│  55│  55│
4836 │                           Layer Row ID│  27│  27│  27│  27│
4837 │             ╶─────────────────────────┼────┼────┼────┼────┤
4838 │              No  QN57 Yes Row ID      │  57│  57│  59│  59│
4839 │                           Layer Row ID│  29│  29│  29│  29│
4840 │                      ╶────────────────┼────┼────┼────┼────┤
4841 │                       No  Row ID      │  61│  61│  63│  63│
4842 │                           Layer Row ID│  31│  31│  31│  31│
4843 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4844
4845                         Custom Tables
4846 Female
4847 No
4848 ╭───────────────────────────────────────┬───────────────────╮
4849 │                                       │        QN27       │
4850 │                                       ├─────────┬─────────┤
4851 │                                       │   Yes   │    No   │
4852 │                                       ├─────────┼─────────┤
4853 │                                       │  QND7A  │  QND7A  │
4854 │                                       ├────┬────┼────┬────┤
4855 │                                       │ Yes│ No │ Yes│ No │
4856 │                                       ├────┼────┼────┼────┤
4857 │                                       │QN86│QN86│QN86│QN86│
4858 ├───────────────────────────────────────┼────┼────┼────┼────┤
4859 │QN26 Yes QN61 Yes QN57 Yes Row ID      │  34│  34│  36│  36│
4860 │                           Layer Row ID│  18│  18│  18│  18│
4861 │                      ╶────────────────┼────┼────┼────┼────┤
4862 │                       No  Row ID      │  38│  38│  40│  40│
4863 │                           Layer Row ID│  20│  20│  20│  20│
4864 │             ╶─────────────────────────┼────┼────┼────┼────┤
4865 │              No  QN57 Yes Row ID      │  42│  42│  44│  44│
4866 │                           Layer Row ID│  22│  22│  22│  22│
4867 │                      ╶────────────────┼────┼────┼────┼────┤
4868 │                       No  Row ID      │  46│  46│  48│  48│
4869 │                           Layer Row ID│  24│  24│  24│  24│
4870 │    ╶──────────────────────────────────┼────┼────┼────┼────┤
4871 │     No  QN61 Yes QN57 Yes Row ID      │  50│  50│  52│  52│
4872 │                           Layer Row ID│  26│  26│  26│  26│
4873 │                      ╶────────────────┼────┼────┼────┼────┤
4874 │                       No  Row ID      │  54│  54│  56│  56│
4875 │                           Layer Row ID│  28│  28│  28│  28│
4876 │             ╶─────────────────────────┼────┼────┼────┼────┤
4877 │              No  QN57 Yes Row ID      │  58│  58│  60│  60│
4878 │                           Layer Row ID│  30│  30│  30│  30│
4879 │                      ╶────────────────┼────┼────┼────┼────┤
4880 │                       No  Row ID      │  62│  62│  64│  64│
4881 │                           Layer Row ID│  32│  32│  32│  32│
4882 ╰───────────────────────────────────────┴────┴────┴────┴────╯
4883
4884                           Custom Tables
4885 Male
4886 Yes
4887 ╭──────────────────────────────────────────┬───────────────────╮
4888 │                                          │        QN27       │
4889 │                                          ├─────────┬─────────┤
4890 │                                          │   Yes   │    No   │
4891 │                                          ├─────────┼─────────┤
4892 │                                          │  QND7A  │  QND7A  │
4893 │                                          ├────┬────┼────┬────┤
4894 │                                          │ Yes│ No │ Yes│ No │
4895 │                                          ├────┼────┼────┼────┤
4896 │                                          │QN86│QN86│QN86│QN86│
4897 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4898 │QN26 Yes QN61 Yes QN57 Yes Column ID      │   1│   3│   5│   7│
4899 │                           Layer Column ID│   1│   3│   5│   7│
4900 │                      ╶───────────────────┼────┼────┼────┼────┤
4901 │                       No  Column ID      │   1│   3│   5│   7│
4902 │                           Layer Column ID│   1│   3│   5│   7│
4903 │             ╶────────────────────────────┼────┼────┼────┼────┤
4904 │              No  QN57 Yes Column ID      │   9│  11│  13│  15│
4905 │                           Layer Column ID│   1│   3│   5│   7│
4906 │                      ╶───────────────────┼────┼────┼────┼────┤
4907 │                       No  Column ID      │   9│  11│  13│  15│
4908 │                           Layer Column ID│   1│   3│   5│   7│
4909 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
4910 │     No  QN61 Yes QN57 Yes Column ID      │  17│  19│  21│  23│
4911 │                           Layer Column ID│   1│   3│   5│   7│
4912 │                      ╶───────────────────┼────┼────┼────┼────┤
4913 │                       No  Column ID      │  17│  19│  21│  23│
4914 │                           Layer Column ID│   1│   3│   5│   7│
4915 │             ╶────────────────────────────┼────┼────┼────┼────┤
4916 │              No  QN57 Yes Column ID      │  25│  27│  29│  31│
4917 │                           Layer Column ID│   1│   3│   5│   7│
4918 │                      ╶───────────────────┼────┼────┼────┼────┤
4919 │                       No  Column ID      │  25│  27│  29│  31│
4920 │                           Layer Column ID│   1│   3│   5│   7│
4921 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4922
4923                           Custom Tables
4924 Male
4925 No
4926 ╭──────────────────────────────────────────┬───────────────────╮
4927 │                                          │        QN27       │
4928 │                                          ├─────────┬─────────┤
4929 │                                          │   Yes   │    No   │
4930 │                                          ├─────────┼─────────┤
4931 │                                          │  QND7A  │  QND7A  │
4932 │                                          ├────┬────┼────┬────┤
4933 │                                          │ Yes│ No │ Yes│ No │
4934 │                                          ├────┼────┼────┼────┤
4935 │                                          │QN86│QN86│QN86│QN86│
4936 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4937 │QN26 Yes QN61 Yes QN57 Yes Column ID      │   2│   4│   6│   8│
4938 │                           Layer Column ID│   2│   4│   6│   8│
4939 │                      ╶───────────────────┼────┼────┼────┼────┤
4940 │                       No  Column ID      │   2│   4│   6│   8│
4941 │                           Layer Column ID│   2│   4│   6│   8│
4942 │             ╶────────────────────────────┼────┼────┼────┼────┤
4943 │              No  QN57 Yes Column ID      │  10│  12│  14│  16│
4944 │                           Layer Column ID│   2│   4│   6│   8│
4945 │                      ╶───────────────────┼────┼────┼────┼────┤
4946 │                       No  Column ID      │  10│  12│  14│  16│
4947 │                           Layer Column ID│   2│   4│   6│   8│
4948 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
4949 │     No  QN61 Yes QN57 Yes Column ID      │  18│  20│  22│  24│
4950 │                           Layer Column ID│   2│   4│   6│   8│
4951 │                      ╶───────────────────┼────┼────┼────┼────┤
4952 │                       No  Column ID      │  18│  20│  22│  24│
4953 │                           Layer Column ID│   2│   4│   6│   8│
4954 │             ╶────────────────────────────┼────┼────┼────┼────┤
4955 │              No  QN57 Yes Column ID      │  26│  28│  30│  32│
4956 │                           Layer Column ID│   2│   4│   6│   8│
4957 │                      ╶───────────────────┼────┼────┼────┼────┤
4958 │                       No  Column ID      │  26│  28│  30│  32│
4959 │                           Layer Column ID│   2│   4│   6│   8│
4960 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
4961
4962                           Custom Tables
4963 Female
4964 Yes
4965 ╭──────────────────────────────────────────┬───────────────────╮
4966 │                                          │        QN27       │
4967 │                                          ├─────────┬─────────┤
4968 │                                          │   Yes   │    No   │
4969 │                                          ├─────────┼─────────┤
4970 │                                          │  QND7A  │  QND7A  │
4971 │                                          ├────┬────┼────┬────┤
4972 │                                          │ Yes│ No │ Yes│ No │
4973 │                                          ├────┼────┼────┼────┤
4974 │                                          │QN86│QN86│QN86│QN86│
4975 ├──────────────────────────────────────────┼────┼────┼────┼────┤
4976 │QN26 Yes QN61 Yes QN57 Yes Column ID      │  33│  35│  37│  39│
4977 │                           Layer Column ID│   9│  11│  13│  15│
4978 │                      ╶───────────────────┼────┼────┼────┼────┤
4979 │                       No  Column ID      │  33│  35│  37│  39│
4980 │                           Layer Column ID│   9│  11│  13│  15│
4981 │             ╶────────────────────────────┼────┼────┼────┼────┤
4982 │              No  QN57 Yes Column ID      │  41│  43│  45│  47│
4983 │                           Layer Column ID│   9│  11│  13│  15│
4984 │                      ╶───────────────────┼────┼────┼────┼────┤
4985 │                       No  Column ID      │  41│  43│  45│  47│
4986 │                           Layer Column ID│   9│  11│  13│  15│
4987 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
4988 │     No  QN61 Yes QN57 Yes Column ID      │  49│  51│  53│  55│
4989 │                           Layer Column ID│   9│  11│  13│  15│
4990 │                      ╶───────────────────┼────┼────┼────┼────┤
4991 │                       No  Column ID      │  49│  51│  53│  55│
4992 │                           Layer Column ID│   9│  11│  13│  15│
4993 │             ╶────────────────────────────┼────┼────┼────┼────┤
4994 │              No  QN57 Yes Column ID      │  57│  59│  61│  63│
4995 │                           Layer Column ID│   9│  11│  13│  15│
4996 │                      ╶───────────────────┼────┼────┼────┼────┤
4997 │                       No  Column ID      │  57│  59│  61│  63│
4998 │                           Layer Column ID│   9│  11│  13│  15│
4999 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
5000
5001                           Custom Tables
5002 Female
5003 No
5004 ╭──────────────────────────────────────────┬───────────────────╮
5005 │                                          │        QN27       │
5006 │                                          ├─────────┬─────────┤
5007 │                                          │   Yes   │    No   │
5008 │                                          ├─────────┼─────────┤
5009 │                                          │  QND7A  │  QND7A  │
5010 │                                          ├────┬────┼────┬────┤
5011 │                                          │ Yes│ No │ Yes│ No │
5012 │                                          ├────┼────┼────┼────┤
5013 │                                          │QN86│QN86│QN86│QN86│
5014 ├──────────────────────────────────────────┼────┼────┼────┼────┤
5015 │QN26 Yes QN61 Yes QN57 Yes Column ID      │  34│  36│  38│  40│
5016 │                           Layer Column ID│  10│  12│  14│  16│
5017 │                      ╶───────────────────┼────┼────┼────┼────┤
5018 │                       No  Column ID      │  34│  36│  38│  40│
5019 │                           Layer Column ID│  10│  12│  14│  16│
5020 │             ╶────────────────────────────┼────┼────┼────┼────┤
5021 │              No  QN57 Yes Column ID      │  42│  44│  46│  48│
5022 │                           Layer Column ID│  10│  12│  14│  16│
5023 │                      ╶───────────────────┼────┼────┼────┼────┤
5024 │                       No  Column ID      │  42│  44│  46│  48│
5025 │                           Layer Column ID│  10│  12│  14│  16│
5026 │    ╶─────────────────────────────────────┼────┼────┼────┼────┤
5027 │     No  QN61 Yes QN57 Yes Column ID      │  50│  52│  54│  56│
5028 │                           Layer Column ID│  10│  12│  14│  16│
5029 │                      ╶───────────────────┼────┼────┼────┼────┤
5030 │                       No  Column ID      │  50│  52│  54│  56│
5031 │                           Layer Column ID│  10│  12│  14│  16│
5032 │             ╶────────────────────────────┼────┼────┼────┼────┤
5033 │              No  QN57 Yes Column ID      │  58│  60│  62│  64│
5034 │                           Layer Column ID│  10│  12│  14│  16│
5035 │                      ╶───────────────────┼────┼────┼────┼────┤
5036 │                       No  Column ID      │  58│  60│  62│  64│
5037 │                           Layer Column ID│  10│  12│  14│  16│
5038 ╰──────────────────────────────────────────┴────┴────┴────┴────╯
5039 ])
5040 AT_CLEANUP
5041
5042 AT_SETUP([CTABLES categorical summary functions])
5043 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
5044 AT_DATA([ctables.sps],
5045 [[GET 'nhtsa.sav'.
5046 CTABLES
5047     /TABLE region BY qnd5a[COUNT, ROWPCT, ROWPCT.VALIDN, ROWPCT.TOTALN, TOTAL[COUNT, VALIDN, TOTALN]]
5048     /CATEGORIES VARIABLES=qnd5a TOTAL=YES MISSING=INCLUDE
5049     /SLABELS POSITION=ROW.
5050 ]])
5051 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
5052                                                       Custom Tables
5053 ╭─────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────╮
5054 │                 │                     D5a. What would you say is your primary ethnic background?                     │
5055 │                 ├─────┬───────┬───────┬──────────┬──────────┬─────────┬──────────┬──────────────┬──────┬───────┬─────┤
5056 │                 │     │       │       │          │          │         │          │  Multiple -  │      │       │     │
5057 │                 │     │       │       │   South  │  Central │  Puerto │ Something│ cannot choose│ Don't│       │     │
5058 │                 │Cuban│Mexican│Spanish│ American │ American │Rican, OR│   else   │      one     │ know │Refused│Total│
5059 ├─────────────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
5060 │Region NE Count  │    6│      8│      8│        11│         7│       39│        23│             2│     0│      1│  105│
5061 │          Row %  │ 5.7%│   7.6%│   7.6%│     10.5%│      6.7%│    37.1%│     21.9%│          1.9%│   .0%│   1.0%│     │
5062 │          Row    │ 5.8%│   7.7%│   7.7%│     10.6%│      6.7%│    37.5%│     22.1%│          1.9%│   .0%│    .0%│     │
5063 │          Valid N│     │       │       │          │          │         │          │              │      │       │     │
5064 │          %      │     │       │       │          │          │         │          │              │      │       │     │
5065 │          Row    │  .4%│    .6%│    .6%│       .8%│       .5%│     2.8%│      1.6%│           .1%│   .0%│    .1%│     │
5066 │          Total N│     │       │       │          │          │         │          │              │      │       │     │
5067 │          %      │     │       │       │          │          │         │          │              │      │       │     │
5068 │          Valid N│     │       │       │          │          │         │          │              │      │       │  104│
5069 │          Total N│     │       │       │          │          │         │          │              │      │       │ 1409│
5070 │      ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
5071 │       MW Count  │    3│     24│      1│         4│         5│        9│         6│             0│     0│      1│   53│
5072 │          Row %  │ 5.7%│  45.3%│   1.9%│      7.5%│      9.4%│    17.0%│     11.3%│           .0%│   .0%│   1.9%│     │
5073 │          Row    │ 5.8%│  46.2%│   1.9%│      7.7%│      9.6%│    17.3%│     11.5%│           .0%│   .0%│    .0%│     │
5074 │          Valid N│     │       │       │          │          │         │          │              │      │       │     │
5075 │          %      │     │       │       │          │          │         │          │              │      │       │     │
5076 │          Row    │  .2%│   1.5%│    .1%│       .2%│       .3%│      .5%│       .4%│           .0%│   .0%│    .1%│     │
5077 │          Total N│     │       │       │          │          │         │          │              │      │       │     │
5078 │          %      │     │       │       │          │          │         │          │              │      │       │     │
5079 │          Valid N│     │       │       │          │          │         │          │              │      │       │   52│
5080 │          Total N│     │       │       │          │          │         │          │              │      │       │ 1654│
5081 │      ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
5082 │       S  Count  │   10│    113│     11│        14│        25│       23│        20│             2│     3│      2│  223│
5083 │          Row %  │ 4.5%│  50.7%│   4.9%│      6.3%│     11.2%│    10.3%│      9.0%│           .9%│  1.3%│    .9%│     │
5084 │          Row    │ 4.6%│  51.8%│   5.0%│      6.4%│     11.5%│    10.6%│      9.2%│           .9%│   .0%│    .0%│     │
5085 │          Valid N│     │       │       │          │          │         │          │              │      │       │     │
5086 │          %      │     │       │       │          │          │         │          │              │      │       │     │
5087 │          Row    │  .4%│   4.7%│    .5%│       .6%│      1.0%│     1.0%│       .8%│           .1%│   .1%│    .1%│     │
5088 │          Total N│     │       │       │          │          │         │          │              │      │       │     │
5089 │          %      │     │       │       │          │          │         │          │              │      │       │     │
5090 │          Valid N│     │       │       │          │          │         │          │              │      │       │  218│
5091 │          Total N│     │       │       │          │          │         │          │              │      │       │ 2390│
5092 │      ╶──────────┼─────┼───────┼───────┼──────────┼──────────┼─────────┼──────────┼──────────────┼──────┼───────┼─────┤
5093 │       W  Count  │    1│    166│     28│         5│        15│        7│        19│             3│     0│      1│  245│
5094 │          Row %  │  .4%│  67.8%│  11.4%│      2.0%│      6.1%│     2.9%│      7.8%│          1.2%│   .0%│    .4%│     │
5095 │          Row    │  .4%│  68.0%│  11.5%│      2.0%│      6.1%│     2.9%│      7.8%│          1.2%│   .0%│    .0%│     │
5096 │          Valid N│     │       │       │          │          │         │          │              │      │       │     │
5097 │          %      │     │       │       │          │          │         │          │              │      │       │     │
5098 │          Row    │  .1%│  10.7%│   1.8%│       .3%│      1.0%│      .5%│      1.2%│           .2%│   .0%│    .1%│     │
5099 │          Total N│     │       │       │          │          │         │          │              │      │       │     │
5100 │          %      │     │       │       │          │          │         │          │              │      │       │     │
5101 │          Valid N│     │       │       │          │          │         │          │              │      │       │  244│
5102 │          Total N│     │       │       │          │          │         │          │              │      │       │ 1546│
5103 ╰─────────────────┴─────┴───────┴───────┴──────────┴──────────┴─────────┴──────────┴──────────────┴──────┴───────┴─────╯
5104 ])
5105 AT_CLEANUP
5106
5107 AT_SETUP([CTABLES scale summary functions])
5108 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
5109 AT_DATA([ctables.sps],
5110 [[GET 'nhtsa.sav'.
5111 SET TVAR=NAME.
5112
5113 * Use SPLIT FILE with FREQUENCIES to generate output equivalent to
5114   CTABLES later, to make the results easier to verify.
5115 SPLIT FILE BY REGION.
5116 FREQUENCIES
5117     qn19a
5118     /STATISTICS=MEAN SEMEAN MEDIAN MODE STDDEV VARIANCE RANGE MINIMUM MAXIMUM SUM
5119     /FORMAT NOTABLE /MISSING=INCLUDE.
5120 SPLIT FILE OFF.
5121
5122 CTABLES
5123     /VLABELS VARIABLE=qn19a DISPLAY=NONE
5124     /TABLE region BY qn19a[VALIDN, MISSING, MEAN, SEMEAN, MEDIAN, MODE, STDDEV, VARIANCE, RANGE, MINIMUM, MAXIMUM, SUM, COUNT, TOTALN, ROWPCT.SUM]
5125     /CATEGORIES VARIABLES=qn19a TOTAL=YES MISSING=INCLUDE
5126     /SLABELS POSITION=ROW
5127     /CLABELS ROWLABELS=OPPOSITE.
5128 ]])
5129 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
5130                    Statistics
5131 ╭─────────┬───────────────────────────────────╮
5132 │         │               REGION              │
5133 │         ├────────┬────────┬────────┬────────┤
5134 │         │   NE   │   MW   │    S   │    W   │
5135 │         ├────────┼────────┼────────┼────────┤
5136 │         │  QN19A │  QN19A │  QN19A │  QN19A │
5137 ├─────────┼────────┼────────┼────────┼────────┤
5138 │N Valid  │     936│    1019│    1276│     950│
5139 │  Missing│     473│     635│    1114│     596│
5140 ├─────────┼────────┼────────┼────────┼────────┤
5141 │Mean     │   19.33│   19.83│   20.29│   19.87│
5142 ├─────────┼────────┼────────┼────────┼────────┤
5143 │S.E. Mean│     .14│     .16│     .18│     .17│
5144 ├─────────┼────────┼────────┼────────┼────────┤
5145 │Median   │   18.00│   19.00│   19.00│   19.00│
5146 ├─────────┼────────┼────────┼────────┼────────┤
5147 │Mode     │   18.00│   18.00│   18.00│   18.00│
5148 ├─────────┼────────┼────────┼────────┼────────┤
5149 │Std Dev  │    4.41│    5.15│    6.44│    5.25│
5150 ├─────────┼────────┼────────┼────────┼────────┤
5151 │Variance │   19.41│   26.47│   41.43│   27.59│
5152 ├─────────┼────────┼────────┼────────┼────────┤
5153 │Range    │   59.00│   71.00│   75.00│   61.00│
5154 ├─────────┼────────┼────────┼────────┼────────┤
5155 │Minimum  │     .00│    4.00│    4.00│    4.00│
5156 ├─────────┼────────┼────────┼────────┼────────┤
5157 │Maximum  │   59.00│   75.00│   79.00│   65.00│
5158 ├─────────┼────────┼────────┼────────┼────────┤
5159 │Sum      │18092.00│20206.00│25886.00│18877.00│
5160 ╰─────────┴────────┴────────┴────────┴────────╯
5161
5162                          Custom Tables
5163 ╭────────────────────────┬────────┬────────┬────────┬────────╮
5164 │                        │   NE   │   MW   │    S   │    W   │
5165 ├────────────────────────┼────────┼────────┼────────┼────────┤
5166 │REGION Valid N          │     936│    1019│    1276│     950│
5167 │       Missing          │  473.00│  635.00│ 1114.00│  596.00│
5168 │       Mean             │   19.33│   19.83│   20.29│   19.87│
5169 │       Std Error of Mean│     .14│     .16│     .18│     .17│
5170 │       Median           │   18.00│   19.00│   19.00│   19.00│
5171 │       Mode             │   18.00│   18.00│   18.00│   18.00│
5172 │       Std Deviation    │    4.41│    5.15│    6.44│    5.25│
5173 │       Variance         │   19.41│   26.47│   41.43│   27.59│
5174 │       Range            │   59.00│   71.00│   75.00│   61.00│
5175 │       Minimum          │     .00│    4.00│    4.00│    4.00│
5176 │       Maximum          │   59.00│   75.00│   79.00│   65.00│
5177 │       Sum              │18092.00│20206.00│25886.00│18877.00│
5178 │       Count            │    1409│    1654│    2390│    1546│
5179 │       Total N          │    1409│    1654│    2390│    1546│
5180 │       Row Sum %        │   21.8%│   24.3%│   31.2%│   22.7%│
5181 ╰────────────────────────┴────────┴────────┴────────┴────────╯
5182 ])
5183 AT_CLEANUP
5184
5185 AT_SETUP([CTABLES scale summary functions - weighting])
5186 weight=1
5187 c=10
5188 for a in 1 2 9; do
5189     for b in 3 4 9; do
5190         for n in 1 2 3 4 5 6 7 8 9 10; do
5191             if test $c -lt 15; then
5192                 cval=.
5193             else
5194                 cval=$c
5195             fi
5196             printf "$weight $a $b $cval\n"
5197             weight=$(expr \( $weight + 3 \) % 7 + 2)
5198             c=$(expr \( $c + 13 \) % 29 + 7)
5199         done
5200     done
5201 done > ctables.txt
5202
5203 AT_DATA([analysis.sps],
5204 [[* Use SPLIT FILE with FREQUENCIES to generate output equivalent to
5205   CTABLES later, to make the results easier to verify.
5206 SPLIT FILE BY a b.
5207 FREQUENCIES
5208     c
5209     /STATISTICS=MEAN SEMEAN MEDIAN MODE STDDEV VARIANCE RANGE MINIMUM MAXIMUM SUM
5210     /FORMAT NOTABLE /MISSING=INCLUDE.
5211 SPLIT FILE OFF.
5212
5213 CTABLES
5214     /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
5215     /SLABELS POSITION=ROW
5216     /CATEGORIES VARIABLES=a b MISSING=INCLUDE.
5217 ]])
5218
5219 AT_DATA([ctables.sps],
5220 [[DATA LIST LIST NOTABLE FILE='ctables.txt'
5221     /w (F5.0) a b c (f2.0).
5222 VAR LEVEL w c (SCALE) a b (NOMINAL).
5223 MISSING VALUES a b (9).
5224
5225 INCLUDE 'analysis.sps'.
5226
5227 WEIGHT BY w.
5228 INCLUDE 'analysis.sps'.
5229
5230 * Same as original analysis using unweighted versions of summaries.
5231 CTABLES
5232     /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
5233     /SLABELS POSITION=ROW
5234     /CATEGORIES VARIABLES=a b MISSING=INCLUDE.
5235 ]])
5236 AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
5237                                 Statistics
5238 ╭─────────┬──────────────────────────────────────────────────────────────╮
5239 │         │                               a                              │
5240 │         ├────────────────────┬────────────────────┬────────────────────┤
5241 │         │          1         │          2         │          9         │
5242 │         ├────────────────────┼────────────────────┼────────────────────┤
5243 │         │          b         │          b         │          b         │
5244 │         ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
5245 │         │   3  │   4  │   9  │   3  │   4  │   9  │   3  │   4  │   9  │
5246 │         ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5247 │         │   c  │   c  │   c  │   c  │   c  │   c  │   c  │   c  │   c  │
5248 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5249 │N Valid  │     7│     6│     8│     7│     7│     8│     7│     7│     8│
5250 │  Missing│     3│     4│     2│     3│     3│     2│     3│     3│     2│
5251 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5252 │Mean     │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
5253 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5254 │S.E. Mean│  2.44│  2.14│  2.58│  2.44│  2.18│  2.43│  2.36│  2.18│  2.47│
5255 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5256 │Median   │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
5257 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5258 │Mode     │    16│    18│    15│    16│    18│    15│    16│    18│    15│
5259 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5260 │Std Dev  │  6.47│  5.24│  7.31│  6.47│  5.77│  6.88│  6.24│  5.77│  6.98│
5261 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5262 │Variance │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
5263 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5264 │Range    │ 18.00│ 13.00│ 20.00│ 18.00│ 15.00│ 20.00│ 18.00│ 15.00│ 20.00│
5265 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5266 │Minimum  │    16│    18│    15│    16│    18│    15│    16│    18│    15│
5267 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5268 │Maximum  │    34│    31│    35│    34│    33│    35│    34│    33│    35│
5269 ├─────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5270 │Sum      │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
5271 ╰─────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
5272
5273                                     Custom Tables
5274 ╭───────────────────┬──────────────────────────────────────────────────────────────╮
5275 │                   │                               a                              │
5276 │                   ├────────────────────┬────────────────────┬────────────────────┤
5277 │                   │          1         │          2         │          9         │
5278 │                   ├────────────────────┼────────────────────┼────────────────────┤
5279 │                   │          b         │          b         │          b         │
5280 │                   ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
5281 │                   │   3  │   4  │   9  │   3  │   4  │   9  │   3  │   4  │   9  │
5282 ├───────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5283 │c Valid N          │     7│     6│     8│     7│     7│     8│     7│     7│     8│
5284 │  Missing          │     3│     4│     2│     3│     3│     2│     3│     3│     2│
5285 │  Mean             │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
5286 │  Std Error of Mean│  2.44│  2.14│  2.58│  2.44│  2.18│  2.43│  2.36│  2.18│  2.47│
5287 │  Median           │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
5288 │  Mode             │    16│    18│    15│    16│    18│    15│    16│    18│    15│
5289 │  Std Deviation    │  6.47│  5.24│  7.31│  6.47│  5.77│  6.88│  6.24│  5.77│  6.98│
5290 │  Variance         │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
5291 │  Range            │ 18.00│ 13.00│ 20.00│ 18.00│ 15.00│ 20.00│ 18.00│ 15.00│ 20.00│
5292 │  Minimum          │    16│    18│    15│    16│    18│    15│    16│    18│    15│
5293 │  Maximum          │    34│    31│    35│    34│    33│    35│    34│    33│    35│
5294 │  Sum              │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
5295 │  Count            │    10│    10│    10│    10│    10│    10│    10│    10│    10│
5296 │  Total N          │    10│    10│    10│    10│    10│    10│    10│    10│    10│
5297 │  Layer Row Sum %  │ 11.1%│  9.0%│ 12.1%│ 11.1%│ 11.1%│ 11.9%│ 10.9%│ 10.9%│ 11.7%│
5298 ╰───────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
5299
5300                                   Statistics
5301 ╭─────────┬─────────────────────────────────────────────────────────────────╮
5302 │         │                                a                                │
5303 │         ├─────────────────────┬─────────────────────┬─────────────────────┤
5304 │         │          1          │          2          │          9          │
5305 │         ├─────────────────────┼─────────────────────┼─────────────────────┤
5306 │         │          b          │          b          │          b          │
5307 │         ├───────┬──────┬──────┼──────┬───────┬──────┼──────┬──────┬───────┤
5308 │         │   3   │   4  │   9  │   3  │   4   │   9  │   3  │   4  │   9   │
5309 │         ├───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5310 │         │   c   │   c  │   c  │   c  │   c   │   c  │   c  │   c  │   c   │
5311 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5312 │N Valid  │     40│    35│    41│    26│     38│    40│    34│    32│     39│
5313 │  Missing│      6│    14│    11│    22│     13│     7│    16│    21│     10│
5314 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5315 │Mean     │  27.23│ 24.20│ 22.63│ 27.96│  27.21│ 23.48│ 23.71│ 25.47│  26.03│
5316 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5317 │S.E. Mean│    .93│   .75│  1.03│  1.12│    .84│   .87│  1.01│  1.05│   1.01│
5318 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5319 │Median   │  30.00│ 22.00│ 19.00│ 30.00│  29.00│ 24.00│ 23.00│ 24.00│  28.00│
5320 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5321 │Mode     │     34│    29│    19│    34│     33│    28│    23│    18│     30│
5322 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5323 │Std Dev  │   5.89│  4.42│  6.59│  5.69│   5.16│  5.50│  5.87│  5.94│   6.30│
5324 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5325 │Variance │  34.64│ 19.52│ 43.39│ 32.36│  26.66│ 30.20│ 34.46│ 35.29│  39.71│
5326 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5327 │Range    │  18.00│ 13.00│ 20.00│ 18.00│  15.00│ 20.00│ 18.00│ 15.00│  20.00│
5328 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5329 │Minimum  │     16│    18│    15│    16│     18│    15│    16│    18│     15│
5330 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5331 │Maximum  │     34│    31│    35│    34│     33│    35│    34│    33│     35│
5332 ├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5333 │Sum      │1089.00│847.00│928.00│727.00│1034.00│939.00│806.00│815.00│1015.00│
5334 ╰─────────┴───────┴──────┴──────┴──────┴───────┴──────┴──────┴──────┴───────╯
5335
5336                                      Custom Tables
5337 ╭───────────────────┬─────────────────────────────────────────────────────────────────╮
5338 │                   │                                a                                │
5339 │                   ├─────────────────────┬─────────────────────┬─────────────────────┤
5340 │                   │          1          │          2          │          9          │
5341 │                   ├─────────────────────┼─────────────────────┼─────────────────────┤
5342 │                   │          b          │          b          │          b          │
5343 │                   ├───────┬──────┬──────┼──────┬───────┬──────┼──────┬──────┬───────┤
5344 │                   │   3   │   4  │   9  │   3  │   4   │   9  │   3  │   4  │   9   │
5345 ├───────────────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
5346 │c Valid N          │     40│    35│    41│    26│     38│    40│    34│    32│     39│
5347 │  Missing          │      6│    14│    11│    22│     13│     7│    16│    21│     10│
5348 │  Mean             │  27.22│ 24.20│ 22.63│ 27.96│  27.21│ 23.48│ 23.71│ 25.47│  26.03│
5349 │  Std Error of Mean│    .93│   .75│  1.03│  1.12│    .84│   .87│  1.01│  1.05│   1.01│
5350 │  Median           │  30.00│ 22.00│ 19.00│ 30.00│  29.00│ 24.00│ 23.00│ 24.00│  28.00│
5351 │  Mode             │     34│    29│    19│    34│     33│    28│    23│    18│     30│
5352 │  Std Deviation    │   5.89│  4.42│  6.59│  5.69│   5.16│  5.50│  5.87│  5.94│   6.30│
5353 │  Variance         │  34.64│ 19.52│ 43.39│ 32.36│  26.66│ 30.20│ 34.46│ 35.29│  39.71│
5354 │  Range            │  18.00│ 13.00│ 20.00│ 18.00│  15.00│ 20.00│ 18.00│ 15.00│  20.00│
5355 │  Minimum          │     16│    18│    15│    16│     18│    15│    16│    18│     15│
5356 │  Maximum          │     34│    31│    35│    34│     33│    35│    34│    33│     35│
5357 │  Sum              │1089.00│847.00│928.00│727.00│1034.00│939.00│806.00│815.00│1015.00│
5358 │  Count            │     46│    49│    52│    48│     51│    47│    50│    53│     49│
5359 │  Total N          │     46│    49│    52│    48│     51│    47│    50│    53│     49│
5360 │  Layer Row Sum %  │  13.3%│ 10.3%│ 11.3%│  8.9%│  12.6%│ 11.5%│  9.8%│  9.9%│  12.4%│
5361 ╰───────────────────┴───────┴──────┴──────┴──────┴───────┴──────┴──────┴──────┴───────╯
5362
5363                                          Custom Tables
5364 ╭──────────────────────────────┬──────────────────────────────────────────────────────────────╮
5365 │                              │                               a                              │
5366 │                              ├────────────────────┬────────────────────┬────────────────────┤
5367 │                              │          1         │          2         │          9         │
5368 │                              ├────────────────────┼────────────────────┼────────────────────┤
5369 │                              │          b         │          b         │          b         │
5370 │                              ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
5371 │                              │   3  │   4  │   9  │   3  │   4  │   9  │   3  │   4  │   9  │
5372 ├──────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
5373 │c Unweighted Valid N          │     7│     6│     8│     7│     7│     8│     7│     7│     8│
5374 │  Unweighted Missing          │     3│     4│     2│     3│     3│     2│     3│     3│     2│
5375 │  Unweighted Mean             │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
5376 │  Unweighted Std Error of Mean│  2.44│  2.14│  2.58│  2.44│  2.18│  2.43│  2.36│  2.18│  2.47│
5377 │  Unweighted Median           │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
5378 │  Unweighted Mode             │    16│    18│    15│    16│    18│    15│    16│    18│    15│
5379 │  Unweighted Std Deviation    │  6.47│  5.24│  7.31│  6.47│  5.77│  6.88│  6.24│  5.77│  6.98│
5380 │  Unweighted Variance         │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
5381 │  Unweighted Sum              │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
5382 │  Unweighted Count            │    10│    10│    10│    10│    10│    10│    10│    10│    10│
5383 │  Unweighted Total N          │    10│    10│    10│    10│    10│    10│    10│    10│    10│
5384 │  Unweighted Layer Row Sum %  │ 11.1%│  9.0%│ 12.1%│ 11.1%│ 11.1%│ 11.9%│ 10.9%│ 10.9%│ 11.7%│
5385 ╰──────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
5386 ])
5387 AT_CLEANUP
5388
5389 AT_SETUP([CTABLES hidden scale VLABELS])
5390 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
5391 AT_DATA([ctables.sps],
5392 [[GET 'nhtsa.sav'.
5393 CTABLES
5394     /TABLE region BY qn19a + qn35
5395     /SLABELS POSITION=ROW.
5396 CTABLES
5397     /VLABELS VARIABLE=qn19a DISPLAY=NONE
5398     /TABLE region BY qn19a + qn35
5399     /SLABELS POSITION=ROW.
5400 CTABLES
5401     /VLABELS VARIABLE=qn35 DISPLAY=NONE
5402     /TABLE region BY qn19a + qn35
5403     /SLABELS POSITION=ROW.
5404
5405 * This one in particular caused a crash because no categories were
5406   created on the column axis, so passing in 0 for the index was still
5407   too big for that number of categories.  It was fixed by creating a
5408   name-only category for each variable despite the "NONE" request,
5409   then hiding the entire dimension's labels if all its labels were
5410   set to "NONE".
5411 CTABLES
5412     /VLABELS VARIABLE=qn19a qn35 DISPLAY=NONE
5413     /TABLE region BY qn19a + qn35
5414     /SLABELS POSITION=ROW.
5415 ]])
5416 AT_CHECK([pspp ctables.sps -O box=unicode], [0], [dnl
5417                                  Custom Tables
5418 ╭──────────────┬────────────────────────────┬─────────────────────────────────╮
5419 │              │ 19a. About how old were you│ 35. In the past thirty days, how│
5420 │              │   when you first starting  │   many times have you driven a  │
5421 │              │    drinking alcohol, not   │  motor vehicle WITHIN TWO HOURS │
5422 │              │  counting small tastes or  │     AFTER drinking alcoholic    │
5423 │              │      sips of alcohol.      │            beverages?           │
5424 ├──────────────┼────────────────────────────┼─────────────────────────────────┤
5425 │Region NE Mean│                       19.33│                                2│
5426 │      ╶───────┼────────────────────────────┼─────────────────────────────────┤
5427 │       MW Mean│                       19.83│                                2│
5428 │      ╶───────┼────────────────────────────┼─────────────────────────────────┤
5429 │       S  Mean│                       20.29│                                2│
5430 │      ╶───────┼────────────────────────────┼─────────────────────────────────┤
5431 │       W  Mean│                       19.87│                                2│
5432 ╰──────────────┴────────────────────────────┴─────────────────────────────────╯
5433
5434                                  Custom Tables
5435 ╭──────────────┬─────┬────────────────────────────────────────────────────────╮
5436 │              │     │  35. In the past thirty days, how many times have you  │
5437 │              │     │ driven a motor vehicle WITHIN TWO HOURS AFTER drinking │
5438 │              │QN19A│                  alcoholic beverages?                  │
5439 ├──────────────┼─────┼────────────────────────────────────────────────────────┤
5440 │Region NE Mean│19.33│                                                       2│
5441 │      ╶───────┼─────┼────────────────────────────────────────────────────────┤
5442 │       MW Mean│19.83│                                                       2│
5443 │      ╶───────┼─────┼────────────────────────────────────────────────────────┤
5444 │       S  Mean│20.29│                                                       2│
5445 │      ╶───────┼─────┼────────────────────────────────────────────────────────┤
5446 │       W  Mean│19.87│                                                       2│
5447 ╰──────────────┴─────┴────────────────────────────────────────────────────────╯
5448
5449                                  Custom Tables
5450 ╭──────────────┬─────────────────────────────────────────────────────────┬────╮
5451 │              │   19a. About how old were you when you first starting   │    │
5452 │              │  drinking alcohol, not counting small tastes or sips of │    │
5453 │              │                         alcohol.                        │qn35│
5454 ├──────────────┼─────────────────────────────────────────────────────────┼────┤
5455 │Region NE Mean│                                                    19.33│   2│
5456 │      ╶───────┼─────────────────────────────────────────────────────────┼────┤
5457 │       MW Mean│                                                    19.83│   2│
5458 │      ╶───────┼─────────────────────────────────────────────────────────┼────┤
5459 │       S  Mean│                                                    20.29│   2│
5460 │      ╶───────┼─────────────────────────────────────────────────────────┼────┤
5461 │       W  Mean│                                                    19.87│   2│
5462 ╰──────────────┴─────────────────────────────────────────────────────────┴────╯
5463
5464       Custom Tables
5465 ╭──────────────┬───────╮
5466 │Region NE Mean│19.33 2│
5467 │      ╶───────┼───────┤
5468 │       MW Mean│19.83 2│
5469 │      ╶───────┼───────┤
5470 │       S  Mean│20.29 2│
5471 │      ╶───────┼───────┤
5472 │       W  Mean│19.87 2│
5473 ╰──────────────┴───────╯
5474 ])
5475 AT_CLEANUP
5476
5477 AT_SETUP([CTABLES with SPLIT FILE])
5478 AT_CHECK([ln $top_srcdir/tests/language/stats/nhtsa.sav . || cp $top_srcdir/tests/language/stats/nhtsa.sav .])
5479 AT_DATA([ctables.sps],
5480 [[GET 'nhtsa.sav'.
5481
5482 SORT CASES BY qns3a.
5483
5484 CTABLES /TABLE qn105ba.
5485
5486 * Layered split has no effect on output.
5487 SPLIT FILE BY qns3a.
5488 CTABLES /TABLE qn105ba.
5489
5490 * Add column variable qns3a to compare against separate splits.
5491 CTABLES /TABLE qn105ba BY qns3a.
5492
5493 * Separate splits are truly output separately.
5494 SPLIT FILE SEPARATE BY qns3a.
5495 CTABLES /TABLE qn105ba.
5496 ]])
5497 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
5498                                   Custom Tables
5499 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5500 │                                                                        │Count│
5501 ├────────────────────────────────────────────────────────────────────────┼─────┤
5502 │105b. How likely is it that drivers who have had too much   Almost      │  700│
5503 │to drink to drive safely will A. Get stopped by the police? certain     │     │
5504 │                                                            Very likely │ 1502│
5505 │                                                            Somewhat    │ 2763│
5506 │                                                            likely      │     │
5507 │                                                            Somewhat    │ 1307│
5508 │                                                            unlikely    │     │
5509 │                                                            Very        │  609│
5510 │                                                            unlikely    │     │
5511 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5512
5513                                   Custom Tables
5514 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5515 │                                                                        │Count│
5516 ├────────────────────────────────────────────────────────────────────────┼─────┤
5517 │105b. How likely is it that drivers who have had too much   Almost      │  700│
5518 │to drink to drive safely will A. Get stopped by the police? certain     │     │
5519 │                                                            Very likely │ 1502│
5520 │                                                            Somewhat    │ 2763│
5521 │                                                            likely      │     │
5522 │                                                            Somewhat    │ 1307│
5523 │                                                            unlikely    │     │
5524 │                                                            Very        │  609│
5525 │                                                            unlikely    │     │
5526 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5527
5528                                   Custom Tables
5529 ╭─────────────────────────────────────────────────────────────────┬────────────╮
5530 │                                                                 │S3a. GENDER:│
5531 │                                                                 ├─────┬──────┤
5532 │                                                                 │ Male│Female│
5533 │                                                                 ├─────┼──────┤
5534 │                                                                 │Count│ Count│
5535 ├─────────────────────────────────────────────────────────────────┼─────┼──────┤
5536 │105b. How likely is it that drivers who have had too Almost      │  297│   403│
5537 │much to drink to drive safely will A. Get stopped by certain     │     │      │
5538 │the police?                                          Very likely │  660│   842│
5539 │                                                     Somewhat    │ 1174│  1589│
5540 │                                                     likely      │     │      │
5541 │                                                     Somewhat    │  640│   667│
5542 │                                                     unlikely    │     │      │
5543 │                                                     Very        │  311│   298│
5544 │                                                     unlikely    │     │      │
5545 ╰─────────────────────────────────────────────────────────────────┴─────┴──────╯
5546
5547     Split Values
5548 ╭────────────┬─────╮
5549 │Variable    │Value│
5550 ├────────────┼─────┤
5551 │S3a. GENDER:│Male │
5552 ╰────────────┴─────╯
5553
5554                                   Custom Tables
5555 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5556 │                                                                        │Count│
5557 ├────────────────────────────────────────────────────────────────────────┼─────┤
5558 │105b. How likely is it that drivers who have had too much   Almost      │  297│
5559 │to drink to drive safely will A. Get stopped by the police? certain     │     │
5560 │                                                            Very likely │  660│
5561 │                                                            Somewhat    │ 1174│
5562 │                                                            likely      │     │
5563 │                                                            Somewhat    │  640│
5564 │                                                            unlikely    │     │
5565 │                                                            Very        │  311│
5566 │                                                            unlikely    │     │
5567 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5568
5569      Split Values
5570 ╭────────────┬──────╮
5571 │Variable    │ Value│
5572 ├────────────┼──────┤
5573 │S3a. GENDER:│Female│
5574 ╰────────────┴──────╯
5575
5576                                   Custom Tables
5577 ╭────────────────────────────────────────────────────────────────────────┬─────╮
5578 │                                                                        │Count│
5579 ├────────────────────────────────────────────────────────────────────────┼─────┤
5580 │105b. How likely is it that drivers who have had too much   Almost      │  403│
5581 │to drink to drive safely will A. Get stopped by the police? certain     │     │
5582 │                                                            Very likely │  842│
5583 │                                                            Somewhat    │ 1589│
5584 │                                                            likely      │     │
5585 │                                                            Somewhat    │  667│
5586 │                                                            unlikely    │     │
5587 │                                                            Very        │  298│
5588 │                                                            unlikely    │     │
5589 ╰────────────────────────────────────────────────────────────────────────┴─────╯
5590 ])
5591 AT_CLEANUP
5592
5593 AT_SETUP([CTABLES variable level inference])
5594 AT_DATA([data.txt], [dnl
5595 dnl n1 has 10 unique small values -> nominal.
5596 dnl n2 has 23 unique small values -> nominal.
5597 dnl n3 is all missing -> nominal.
5598 dnl s1 has 24 unique small values -> scale.
5599 dnl s2 has one negative value -> scale.
5600 dnl s3 has one non-integer value -> scale.
5601 dnl s4 has no valid values less than 10 -> scale.
5602 dnl s5 has no valid values less than 10,000 -> scale.
5603 1  1  . 1  1  1    10 10001
5604 2  2  . 2  2  2    11 10002
5605 3  3  . 3  3  3    12 10003
5606 4  4  . 4  4  4    13 10004
5607 5  5  . 5  5  5    14 10005
5608 6  6  . 6  6  6    15 10006
5609 7  7  . 7  7  7    16 10007
5610 8  8  . 8  8  8    17 10008
5611 9  9  . 9  9  9    18 10009
5612 10 10 . 10 10 10.5 19 110000
5613 1  11 . 11 -1 1    11 10001
5614 2  12 . 12 2  2    12 10002
5615 3  13 . 13 3  3    13 10003
5616 4  14 . 14 4  4    14 10004
5617 5  15 . 15 5  5    15 10005
5618 6  16 . 16 6  6    16 10006
5619 7  17 . 17 7  7    17 10007
5620 8  18 . 18 8  8    18 10008
5621 9  19 . 19 9  9    19 10009
5622 1  20 . 20 1  1    20 10001
5623 2  21 . 21 2  2    21 10002
5624 3  22 . 22 3  3    22 10003
5625 4  23 . 23 4  4    23 10004
5626 5  23 . 24 5  5    24 10005
5627 6  23 . 24 6  6    25 10006
5628 ])
5629
5630 AT_DATA([ctables.sps], [dnl
5631 DATA LIST LIST file='data.txt' NOTABLE /n1 to n3 s1 to s5.
5632
5633 * Nominal formats (copied from data that will default to scale).
5634 COMPUTE n4=s1.
5635 COMPUTE n5=s1.
5636 FORMATS n4(WKDAY5) n5(MONTH5).
5637
5638 * Scale formats (copied from data that will default to nominal).
5639 COMPUTE s6=n1.
5640 COMPUTE s7=n1.
5641 COMPUTE s8=n1.
5642 FORMATS s6(DOLLAR6.2) s7(CCA8.2) s8(DATETIME17).
5643
5644 STRING string(A8).
5645
5646 DISPLAY DICTIONARY.
5647 CTABLES /TABLE n1 + n2 + n3 + string + s1 + s2 + s3 + s4 + s5.
5648 DISPLAY DICTIONARY.
5649 ])
5650
5651 AT_CHECK([pspp ctables.sps -O box=unicode -O width=80], [0], [dnl
5652                                     Variables
5653 ╭──────┬────────┬──────────────┬─────┬─────┬─────────┬────────────┬────────────╮
5654 │      │        │  Measurement │     │     │         │            │            │
5655 │Name  │Position│     Level    │ Role│Width│Alignment│Print Format│Write Format│
5656 ├──────┼────────┼──────────────┼─────┼─────┼─────────┼────────────┼────────────┤
5657 │n1    │       1│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5658 │n2    │       2│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5659 │n3    │       3│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5660 │s1    │       4│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5661 │s2    │       5│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5662 │s3    │       6│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5663 │s4    │       7│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5664 │s5    │       8│Unknown       │Input│    8│Right    │F8.2        │F8.2        │
5665 │n4    │       9│Unknown       │Input│    8│Right    │WKDAY5      │WKDAY5      │
5666 │n5    │      10│Unknown       │Input│    8│Right    │MONTH5      │MONTH5      │
5667 │s6    │      11│Unknown       │Input│    8│Right    │DOLLAR6.2   │DOLLAR6.2   │
5668 │s7    │      12│Unknown       │Input│    8│Right    │CCA8.2      │CCA8.2      │
5669 │s8    │      13│Unknown       │Input│    8│Right    │DATETIME17.0│DATETIME17.0│
5670 │string│      14│Nominal       │Input│    8│Left     │A8          │A8          │
5671 ╰──────┴────────┴──────────────┴─────┴─────┴─────────┴────────────┴────────────╯
5672
5673         Custom Tables
5674 ╭────────────┬─────┬────────╮
5675 │            │Count│  Mean  │
5676 ├────────────┼─────┼────────┤
5677 │n1     1.00 │    3│        │
5678 │       2.00 │    3│        │
5679 │       3.00 │    3│        │
5680 │       4.00 │    3│        │
5681 │       5.00 │    3│        │
5682 │       6.00 │    3│        │
5683 │       7.00 │    2│        │
5684 │       8.00 │    2│        │
5685 │       9.00 │    2│        │
5686 │       10.00│    1│        │
5687 ├────────────┼─────┼────────┤
5688 │n2     1.00 │    1│        │
5689 │       2.00 │    1│        │
5690 │       3.00 │    1│        │
5691 │       4.00 │    1│        │
5692 │       5.00 │    1│        │
5693 │       6.00 │    1│        │
5694 │       7.00 │    1│        │
5695 │       8.00 │    1│        │
5696 │       9.00 │    1│        │
5697 │       10.00│    1│        │
5698 │       11.00│    1│        │
5699 │       12.00│    1│        │
5700 │       13.00│    1│        │
5701 │       14.00│    1│        │
5702 │       15.00│    1│        │
5703 │       16.00│    1│        │
5704 │       17.00│    1│        │
5705 │       18.00│    1│        │
5706 │       19.00│    1│        │
5707 │       20.00│    1│        │
5708 │       21.00│    1│        │
5709 │       22.00│    1│        │
5710 │       23.00│    3│        │
5711 ├────────────┼─────┼────────┤
5712 │string      │   25│        │
5713 ├────────────┼─────┼────────┤
5714 │s1          │     │   12.96│
5715 ├────────────┼─────┼────────┤
5716 │s2          │     │    4.76│
5717 ├────────────┼─────┼────────┤
5718 │s3          │     │    4.86│
5719 ├────────────┼─────┼────────┤
5720 │s4          │     │   16.60│
5721 ├────────────┼─────┼────────┤
5722 │s5          │     │14004.44│
5723 ╰────────────┴─────┴────────╯
5724
5725                                     Variables
5726 ╭──────┬────────┬──────────────┬─────┬─────┬─────────┬────────────┬────────────╮
5727 │      │        │  Measurement │     │     │         │            │            │
5728 │Name  │Position│     Level    │ Role│Width│Alignment│Print Format│Write Format│
5729 ├──────┼────────┼──────────────┼─────┼─────┼─────────┼────────────┼────────────┤
5730 │n1    │       1│Nominal       │Input│    8│Right    │F8.2        │F8.2        │
5731 │n2    │       2│Nominal       │Input│    8│Right    │F8.2        │F8.2        │
5732 │n3    │       3│Nominal       │Input│    8│Right    │F8.2        │F8.2        │
5733 │s1    │       4│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5734 │s2    │       5│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5735 │s3    │       6│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5736 │s4    │       7│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5737 │s5    │       8│Scale         │Input│    8│Right    │F8.2        │F8.2        │
5738 │n4    │       9│Nominal       │Input│    8│Right    │WKDAY5      │WKDAY5      │
5739 │n5    │      10│Nominal       │Input│    8│Right    │MONTH5      │MONTH5      │
5740 │s6    │      11│Scale         │Input│    8│Right    │DOLLAR6.2   │DOLLAR6.2   │
5741 │s7    │      12│Scale         │Input│    8│Right    │CCA8.2      │CCA8.2      │
5742 │s8    │      13│Scale         │Input│    8│Right    │DATETIME17.0│DATETIME17.0│
5743 │string│      14│Nominal       │Input│    8│Left     │A8          │A8          │
5744 ╰──────┴────────┴──────────────┴─────┴─────┴─────────┴────────────┴────────────╯
5745 ])
5746 AT_CLEANUP