dnl PSPP - a program for statistical analysis. dnl Copyright (C) 2017 Free Software Foundation, Inc. dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation, either version 3 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . dnl AT_BANNER([MODIFY VARS]) AT_SETUP([MODIFY VARS /REORDER]) AT_KEYWORDS([REORDER]) AT_DATA([modify-variables.sps], [dnl DATA LIST LIST /a b c x y z (F2.0). BEGIN DATA. 1 2 3 4 5 6 END DATA. MODIFY VARS /REORDER (z y x). DISPLAY INDEX. MODIFY VARS /REORDER (c b a). DISPLAY INDEX. MODIFY VARS /REORDER BACKWARD (z y x). DISPLAY INDEX. MODIFY VARS /REORDER BACKWARD (c b a). DISPLAY INDEX. MODIFY VARS /REORDER BACKWARD ALPHA (ALL). DISPLAY INDEX. MODIFY VARS /REORDER ALPHA (ALL). DISPLAY INDEX. ]) AT_CHECK([pspp -O format=csv modify-variables.sps], [0], [dnl Table: Reading free-form data from INLINE. Variable,Format a,F2.0 b,F2.0 c,F2.0 x,F2.0 y,F2.0 z,F2.0 Table: Variables Name,Position z,1 y,2 x,3 a,4 b,5 c,6 Table: Variables Name,Position c,1 b,2 a,3 z,4 y,5 x,6 Table: Variables Name,Position x,1 y,2 z,3 c,4 b,5 a,6 Table: Variables Name,Position a,1 b,2 c,3 x,4 y,5 z,6 Table: Variables Name,Position z,1 y,2 x,3 c,4 b,5 a,6 Table: Variables Name,Position a,1 b,2 c,3 x,4 y,5 z,6 ]) AT_CLEANUP AT_SETUP([MODIFY VARS /RENAME]) AT_KEYWORDS([RENAME]) AT_DATA([modify-variables.sps], [dnl DATA LIST LIST /a b c x y z (F2.0). BEGIN DATA. 1 2 3 4 5 6 END DATA. MODIFY VARS /RENAME (a b c = one two three). DISPLAY INDEX. MODIFY VARS /RENAME (one two three = a b c). DISPLAY INDEX. MODIFY VARS /RENAME (a = a). DISPLAY INDEX. MODIFY VARS /RENAME (a b c = b c a). DISPLAY INDEX. ]) AT_CHECK([pspp -O format=csv modify-variables.sps], [0], [dnl Table: Reading free-form data from INLINE. Variable,Format a,F2.0 b,F2.0 c,F2.0 x,F2.0 y,F2.0 z,F2.0 Table: Variables Name,Position one,1 two,2 three,3 x,4 y,5 z,6 Table: Variables Name,Position a,1 b,2 c,3 x,4 y,5 z,6 Table: Variables Name,Position a,1 b,2 c,3 x,4 y,5 z,6 Table: Variables Name,Position b,1 c,2 a,3 x,4 y,5 z,6 ]) AT_CLEANUP AT_SETUP([MODIFY VARS /DROP and /KEEP]) AT_KEYWORDS([DROP KEEP]) AT_DATA([modify-variables.sps], [dnl DATA LIST LIST /a b c x y z (F2.0). BEGIN DATA. 1 2 3 4 5 6 END DATA. MODIFY VARS /DROP a. DISPLAY INDEX. MODIFY VARS /KEEP ALL. DISPLAY INDEX. MODIFY VARS /KEEP c TO y. DISPLAY INDEX. MODIFY VARS /DROP x. DISPLAY INDEX. MODIFY VARS /KEEP y. DISPLAY INDEX. MODIFY VARS /DROP y. DISPLAY INDEX. ]) AT_CHECK([pspp -O format=csv modify-variables.sps], [1], [dnl Table: Reading free-form data from INLINE. Variable,Format a,F2.0 b,F2.0 c,F2.0 x,F2.0 y,F2.0 z,F2.0 Table: Variables Name,Position b,1 c,2 x,3 y,4 z,5 Table: Variables Name,Position b,1 c,2 x,3 y,4 z,5 Table: Variables Name,Position c,1 x,2 y,3 Table: Variables Name,Position c,1 y,2 Table: Variables Name,Position y,1 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. modify-variables.sps:17: error: Stopping syntax file processing here to avoid a cascade of dependent command failures. ]) AT_CLEANUP