Activation of declared dataset: inconsistencies

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Activation of declared dataset: inconsistencies

Kirill Orlov
Hi,
I observe some uncertainty (checked on SPSS 15, 20) from SPSS' side as whether a declared dataset which is empty - because saving out data to it was unsuccesful - should be eligible to activate. This is an important issue. Compare 3 following snippets.

Let's have working dataset x with variables v1 v2 v3 v4 v5.

A)
DATASET ACTIVATE x.
DATASET DECLARE y.
REGRESSION
� /DEPENDENT w1
� /METHOD= ENTER w2 w3 w4 w5 /*Error: wrong variable names*/
� /OUTFILE= COVB(y).
DATASET ACTIVATE y.
VARIABLE LEVEL all (ORDINAL).

� Still, DATASET ACTIVATE y does bring forward the empty dataset y.
(And so, VARIABLE LEVEL command does not spoil dataset x.)

B)
DATASET ACTIVATE x.
DATASET DECLARE y.
MATRIX.
DO IF 1=2. /*False*/
SAVE 99 /OUTFILE= y. /*so this won't be done*/
END IF.
END MATRIX.
DATASET ACTIVATE y.
VAR LEVEL all (ORDINAL).

In this case, saving doesn't take place because of condition. Still, even in this case DATASET ACTIVATE y does bring forward the empty dataset y.
(And so, VARIABLE LEVEL command does not spoil dataset x.)

C)
DATASET ACTIVATE x.
DATASET DECLARE y.
CORRELATE w1 w2 w3 w4 w5 /*Error: wrong variable names*/
� /MATRIX= OUT(y).
DATASET ACTIVATE y.
VAR LEVEL all (ORDINAL).

This case is like (A): saving to y doesn't take place because of the error. However, unlike (A) or (B), DATASET ACTIVATE y doesn't work, issuing message: "Dataset y has no data. Execution of this command stops". As the consequence, VARIABLE LEVEL command - which was intended for dataset y - acts on dataset x instead, spoiling it.

I believe that behaviour in cases (A) and (B) is correct, and in case (C) it is malignant. If so, a declared but still empty dataset should be eligible to activate, and thus,

DATASET DECLARE y.
DATASET ACTIVATE y.

should work and should NOT produce message "Dataset y has no data. Execution of this command stops".