dictionary: Limit split file variables to 8, for compatibility.
[pspp] / tests / language / dictionary / split-file.at
1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
3 dnl
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
8 dnl
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 dnl
17 AT_BANNER([SPLIT FILE])
18
19 AT_SETUP([SPLIT FILE - basic test])
20 AT_DATA([split-file.sps], [dnl
21 title 'Test SPLIT FILE utility'.
22
23 data list notable /X 1 Y 2.
24 begin data.
25 12
26 16
27 17
28 19
29 15
30 14
31 27
32 20
33 26
34 25
35 28
36 29
37 24
38 end data.
39 split file by x.
40 list.
41 ])
42 AT_CHECK([pspp -o pspp.csv split-file.sps])
43 AT_CHECK([cat pspp.csv], [0], [dnl
44 Table: Split Values
45 Variable,Value
46 X,1
47
48 Table: Data List
49 X,Y
50 1,2
51 1,6
52 1,7
53 1,9
54 1,5
55 1,4
56
57 Table: Split Values
58 Variable,Value
59 X,2
60
61 Table: Data List
62 X,Y
63 2,7
64 2,0
65 2,6
66 2,5
67 2,8
68 2,9
69 2,4
70 ])
71 AT_CLEANUP
72
73 AT_SETUP([SPLIT FILE  - vs procedures])
74 AT_DATA([split-file.sps], [dnl
75
76 * This test is a compendium of those procedures which might
77 * have problems when run in conjunction with SPLITS.
78
79 data list list /a b c q g *.
80 begin data.
81 1 2 3     1  0
82 4 5 6     0  0
83 7 8 9     1  0
84 10 11 12  0  1
85 13 14 15  1  1
86 end data.
87
88 split file by g.
89
90
91 * The commented out lines are ones which currently fail.
92
93 AGGREGATE outfile='foo' /break=c /X=sum(a).
94 AUTORECODE variables = c into d .
95 COUNT e = c (1 2 3 4 5 6 7).
96 CROSSTABS a by b.
97 CORRELATIONS /VARIABLES = a b.
98 DELETE VARIABLES a.
99 DESCRIPTIVES e .
100 EXAMINE c by b.
101 EXPORT outfile='xxx'.
102 FACTOR /VARIABLES = b c d.
103 FILTER BY c.
104 FREQUENCIES b.
105 GLM c BY b.
106 GRAPH /HISTOGRAM = b .
107 GRAPH /SCATTERPLOT(BIVARIATE) = b with c by e .
108 GRAPH /BAR (GROUPED) = MEAN(b) by c by e.
109 GRAPH /BAR = COUNT BY  b.
110 LIST.
111 LOGISTIC REGRESSION q WITH b.
112 MEANS c b.
113 NPAR TESTS /MCNEMAR q.
114 ONEWAY c BY b.
115 QUICK CLUSTER b c.
116 RANK b c.
117 REGRESSION /VARIABLES = c /DEPENDENT = q.
118 RELIABILITY /VARIABLES = c b d.
119 RENAME VARIABLES (b = bb).
120 ROC bb by q(1).
121 SAMPLE 0.9 .
122 SAVE outfile='xx.sav'.
123 SORT CASES by bb.
124 T-TEST /GROUP=q(0,1) /VARIABLES=bb.
125 USE ALL.
126 FLIP /VARIABLES = bb, c .
127
128 execute.
129 finish.
130 ])
131
132 AT_CHECK([pspp -O format=csv split-file.sps], [0],[ignore])
133
134 AT_CLEANUP
135
136 AT_SETUP([SPLIT FILE - split variable limit])
137 AT_DATA([split-file.sps], [dnl
138 DATA LIST LIST NOTABLE /V1 TO V9.
139 SPLIT FILE BY V1 TO V9.
140 ])
141 AT_CHECK([pspp split-file.sps])
142 AT_CLEANUP