=========================================================================
Date: Tue, 18 Jul 2006 15:18:34 -0500
Reply-To: "Marks, Jim" <Jim.Marks@lodgenet.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Marks, Jim" <Jim.Marks@lodgenet.com>
Subject: Re: Using datasets in SPSS 14
Content-Type: text/plain; charset="us-ascii"
Richard:
Many thanks! I've reading (slowly) thru the syntax manual, and pasted
syntax. This is very helpful in connecting the dots
Maybe you will tackle python next :~)
--jim
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Richard Ristow
Sent: Tuesday, July 18, 2006 2:49 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Using datasets in SPSS 14
In thread "Re: SPSS 14 features, compatibilty and upgrade questions" I
wrote,
>SPSS 14 uses 'dataset' in a particular way. It's essentially a
>generalization of the 'working file' or 'active file' that we all know
>and, mostly, love: It's now called a 'dataset', and there can be more
>than one of them open at a time. (So, there can be more than one Data
>Editor window open.) The working file - what procedures read, what
>transformations write - is now the 'active dataset.'
The rules for creating and managing datasets aren't laid out very
clearly. Here's what I *think* is the case, all or almost all confirmed
by testing:
A. Datasets, dataset names, and what they're good for: As I wrote, the
new term for what was the 'working file' is the 'active dataset.' The
active dataset may, but need not, have a dataset name.
There may also be 'inactive datasets'. They are files just like the
working file, and they have Data Editor windows. All inactive datasets
must have names; inactivating an unnamed dataset, loses it.
(In the documentation, the connection of a dataset name with its dataset
is termed an 'association'. I don't find that useful, since
un-associated dataset names can't exist; and un-associated datasets
can't exist, except the active dataset.)
1. To list all open datasets, active and inactive:
. DATASET DISPLAY.
2. Datasets may remain open, though inactive, and be available for later
use, somewhat like scratch saved files. Creating, naming and copying,
and activating datasets, are described below.
3. Dataset names are accepted in FILE= subcommands for ADD FILES, MATCH
FILES, and UPDATE, and in OUTFILE= subcommands for procedures. (Not,
however, in SAVE OUTFILE= or XSAVE OUTFILE=.)
B. Create a dataset
1. Commands that used to create a new working file, now create a new
dataset, which is active but unnamed. If the previously active dataset
is not named, it is lost. If it is named, it remains open with that
name, but is no longer active.
Commands that create a new working file are, . NEW FILE.
. DATA LIST.
. GET {FILE,DATA,TRANSLATE,CAPTURE,SAS,STATA,...}
. ADD FILES, with no "/FILE=*"
. MATCH FILES, with no "/FILE=*".
(The practical distinction between having "/FILE=*", and not having one,
is new in the dataset system.)
If no DATASET commands are used, the above mirrors the functioning of
the old working file.
2. Create a copy of the working file ('active dataset'); analogous to
SAVE FILE:
. DATASET COPY <name>.
Creates a copy of the active dataset, under name "<name>", as an
inactive dataset. Any dataset that had that name is lost.
A modest nuisance: Unlike SAVE FILE, DATASET COPY doesn't accept a KEEP=
or DROP= lists. (Possible work-around: following DATASET COPY, ADD
FILES/FILE=* with the desired KEEP= and DROP= lists.)
3. Create an empty, named, inactive dataset:
. DATASET DECLARE <name>.
This is of use ONLY to create an empty dataset that can then be named on
OUTFILE= subcommands for procedures that have them, including AGGREGATE.
(Yes, procedures can write to datasets, although SAVE and XSAVE can't.)
C. Keep the active dataset, and switch which dataset is active
1. Name the active dataset, and so cause it to be kept open:
. DATASET NAME <name>.
The active dataset now has name "<name>", whether or not it had a name
before. Any dataset that had that name is lost.
2. Activate an open but inactive dataset; analogous to GET FILE:
. DATASET ACTIVATE <name>
The dataset named "<name>" becomes the active dataset. If the previous
active dataset was unnamed, it is lost. If it was named, it remains
open, but not active, under its name.
D. Modify the active dataset
1. A transformation program keeps the active dataset under the same
name, with changes applied
2. MATCH FILES or ADD FILES with /FILE=* keep the active dataset under
its same name, with added variables or cases. (As stated above, if
/FILE=* is not specified, a new, unnamed dataset becomes active. This is
true even if /FILE=<name> is specified, where '<name>' is the name of
the active dataset.)
E. Control display of the Data Editor windows:
Most DATASET commands take a WINDOW=<status> subcommand (no slash before
'WINDOW'). Allowed values vary by command. Descriptions are from the
SPSS 14 Command Syntax Reference.
1. DATASET NAME and DATASET ACTIVATE:
WINDOW=FRONT
"The Data Editor window containing the dataset is brought to the front
and the dataset becomes the active dataset for dialog boxes."
WINDOW=ASIS
"The Data Editor window containing the dataset is not affected. This is
the default."
2. DATASET COPY and DATASET DECLARE:
WINDOW=MINIMIZED
"The Data Editor window associated with the new dataset is opened in a
minimized state. This is the default."
WINDOW=HIDDEN
"The Data Editor window associated with the new dataset is not
displayed."
WINDOW=FRONT
"The Data Editor window containing the dataset is brought to the front
and the dataset becomes the active dataset for dialog boxes."
F. Deleting a dataset:
. DATASET CLOSE <name>.
* To make the active dataset be a named dataset, use . DATASET NAME
<name> The active dataset is the same as it was, but now has name
"<name>"; any dataset that had that name is lost.
. DATASET ACTIVATE <name>
The dataset named "<name>" becomes the active dataset. If the previous
active dataset was unnamed, it is lost. If it was named, it remains
open, but not active, under its name.