1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2021 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/>.
20 AT_DATA([mconvert.sps], [dnl
21 MATRIX DATA VARIABLES=s ROWTYPE_ var01 TO var03/SPLIT s.
31 FORMATS var01 TO var03(F5.2).
37 AT_CHECK([pspp -O format=csv mconvert.sps], [0], [dnl
39 s,ROWTYPE_,VARNAME_,var01,var02,var03
40 0,CORR,var01,1.00,.25,.90
41 0,CORR,var02,.25,1.00,.50
42 0,CORR,var03,.90,.50,1.00
43 0,STDDEV,,1.00,4.00,9.00
44 1,STDDEV,,1.00,4.00,9.00
45 1,COV,var01,1.00,1.00,8.10
46 1,COV,var02,1.00,16.00,18.00
47 1,COV,var03,8.10,18.00,81.00
51 AT_SETUP([MCONVERT from .sav file])
52 AT_DATA([input.sps], [dnl
53 MATRIX DATA VARIABLES=s ROWTYPE_ var01 TO var03/SPLIT s.
63 FORMATS var01 TO var03(F5.2).
65 SAVE OUTFILE='input.sav'.
67 AT_DATA([mconvert.sps], [dnl
68 MCONVERT MATRIX=IN('input.sav').
72 AT_CHECK([pspp -O format=csv input.sps])
73 AT_CHECK([pspp -O format=csv mconvert.sps], [0], [dnl
75 s,ROWTYPE_,VARNAME_,var01,var02,var03
76 0,CORR,var01,1.00,.25,.90
77 0,CORR,var02,.25,1.00,.50
78 0,CORR,var03,.90,.50,1.00
79 0,STDDEV,,1.00,4.00,9.00
80 1,STDDEV,,1.00,4.00,9.00
81 1,COV,var01,1.00,1.00,8.10
82 1,COV,var02,1.00,16.00,18.00
83 1,COV,var03,8.10,18.00,81.00
87 AT_SETUP([MCONVERT to .sav file])
88 AT_DATA([mconvert.sps], [dnl
89 MATRIX DATA VARIABLES=s ROWTYPE_ var01 TO var03/SPLIT s.
99 FORMATS var01 TO var03(F5.2).
101 MCONVERT/REPLACE/OUT('output.sav').
104 AT_DATA([output.sps], [dnl
109 AT_CHECK([pspp -O format=csv mconvert.sps], [0], [dnl
111 s,ROWTYPE_,VARNAME_,var01,var02,var03
112 0,COV,var01,1.00,1.00,8.10
113 0,COV,var02,1.00,16.00,18.00
114 0,COV,var03,8.10,18.00,81.00
115 1,CORR,var01,1.00,.25,.90
116 1,CORR,var02,.25,1.00,.50
117 1,CORR,var03,.90,.50,1.00
118 1,STDDEV,,1.00,4.00,9.00
120 AT_CHECK([pspp -O format=csv output.sps], [0], [dnl
122 s,ROWTYPE_,VARNAME_,var01,var02,var03
123 0,CORR,var01,1.00,.25,.90
124 0,CORR,var02,.25,1.00,.50
125 0,CORR,var03,.90,.50,1.00
126 0,STDDEV,,1.00,4.00,9.00
127 1,STDDEV,,1.00,4.00,9.00
128 1,COV,var01,1.00,1.00,8.10
129 1,COV,var02,1.00,16.00,18.00
130 1,COV,var03,8.10,18.00,81.00
134 AT_SETUP([MCONVERT from .sav file to .sav file])
135 AT_DATA([input.sps], [dnl
136 MATRIX DATA VARIABLES=s ROWTYPE_ var01 TO var03/SPLIT s.
146 FORMATS var01 TO var03(F5.2).
148 SAVE OUTFILE='input.sav'.
150 AT_DATA([mconvert.sps], [dnl
151 MCONVERT MATRIX=IN('input.sav') OUT('output.sav')/REPLACE.
154 AT_DATA([output.sps], [dnl
159 AT_CHECK([pspp -O format=csv input.sps])
160 AT_CHECK([pspp -O format=csv mconvert.sps], [1], [dnl
161 mconvert.sps:2: error: LIST: LIST is allowed only after the active dataset has been defined.
163 AT_CHECK([pspp -O format=csv output.sps], [0], [dnl
165 s,ROWTYPE_,VARNAME_,var01,var02,var03
166 0,CORR,var01,1.00,.25,.90
167 0,CORR,var02,.25,1.00,.50
168 0,CORR,var03,.90,.50,1.00
169 0,STDDEV,,1.00,4.00,9.00
170 1,STDDEV,,1.00,4.00,9.00
171 1,COV,var01,1.00,1.00,8.10
172 1,COV,var02,1.00,16.00,18.00
173 1,COV,var03,8.10,18.00,81.00
177 AT_SETUP([MCONVERT with APPEND])
178 AT_DATA([mconvert.sps], [dnl
179 MATRIX DATA VARIABLES=s ROWTYPE_ var01 TO var03/SPLIT s.
189 FORMATS var01 TO var03(F5.2).
195 AT_CHECK([pspp -O format=csv mconvert.sps], [0], [dnl
197 s,ROWTYPE_,VARNAME_,var01,var02,var03
198 0,COV,var01,1.00,1.00,8.10
199 0,COV,var02,1.00,16.00,18.00
200 0,COV,var03,8.10,18.00,81.00
201 0,CORR,var01,1.00,.25,.90
202 0,CORR,var02,.25,1.00,.50
203 0,CORR,var03,.90,.50,1.00
204 0,STDDEV,,1.00,4.00,9.00
205 1,CORR,var01,1.00,.25,.90
206 1,CORR,var02,.25,1.00,.50
207 1,CORR,var03,.90,.50,1.00
208 1,STDDEV,,1.00,4.00,9.00
209 1,COV,var01,1.00,1.00,8.10
210 1,COV,var02,1.00,16.00,18.00
211 1,COV,var03,8.10,18.00,81.00
215 AT_SETUP([MCONVERT negative test])
216 AT_DATA([mconvert.sps], [MCONVERT.
218 AT_CHECK([pspp mconvert.sps], [1], [dnl
219 mconvert.sps:1: error: MCONVERT: No active file is defined and no external file
220 is specified on MATRIX=IN.