1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017, 2020 Free Software Foundation, Inc.
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.
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.
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/>.
17 AT_BANNER([MODIFY VARS])
19 AT_SETUP([MODIFY VARS /REORDER])
20 AT_KEYWORDS([REORDER])
21 AT_DATA([modify-variables.sps], [dnl
22 DATA LIST LIST /a b c x y z (F2.0).
27 MODIFY VARS /REORDER (z y x).
29 MODIFY VARS /REORDER (c b a).
32 MODIFY VARS /REORDER BACKWARD (z y x).
34 MODIFY VARS /REORDER BACKWARD (c b a).
37 MODIFY VARS /REORDER BACKWARD ALPHA (ALL).
39 MODIFY VARS /REORDER ALPHA (ALL).
42 AT_CHECK([pspp -O format=csv modify-variables.sps], [0], [dnl
43 Table: Reading free-form data from INLINE.
108 AT_SETUP([MODIFY VARS /RENAME])
109 AT_KEYWORDS([RENAME])
110 AT_DATA([modify-variables.sps], [dnl
111 DATA LIST LIST /a b c x y z (F2.0).
116 MODIFY VARS /RENAME (a b c = one two three).
118 MODIFY VARS /RENAME (one two three = a b c).
120 MODIFY VARS /RENAME (a = a).
122 MODIFY VARS /RENAME (a b c = b c a).
125 AT_CHECK([pspp -O format=csv modify-variables.sps], [0], [dnl
126 Table: Reading free-form data from INLINE.
173 AT_SETUP([MODIFY VARS /DROP and /KEEP])
174 AT_KEYWORDS([DROP KEEP])
175 AT_DATA([modify-variables.sps], [dnl
176 DATA LIST LIST /a b c x y z (F2.0).
183 MODIFY VARS /KEEP ALL.
185 MODIFY VARS /KEEP c TO y.
194 AT_CHECK([pspp -O format=csv modify-variables.sps], [1], [dnl
195 Table: Reading free-form data from INLINE.
235 modify-variables.sps:16: error: MODIFY VARS: MODIFY VARS may not be used to delete all variables from the active dataset dictionary. Use NEW FILE instead.
237 modify-variables.sps:17: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
241 AT_SETUP([MODIFY VARS crash])
242 AT_DATA([modify-variables.sps], [dnl
243 DATA LIST notable LIST /a b c (F2.0).
248 MODIFY VARS /RENAME (a 4 c = one two three).
251 AT_CHECK([pspp -O format=csv modify-variables.sps], [1], [ignore])