Date: Wed, 6 Feb 2002 07:26:48 -0500
Reply-To: Raynald Levesque <firstname.lastname@example.org>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Raynald Levesque <email@example.com>
Subject: Re: QUERY: On importing from Access
Content-Type: text/plain; charset="iso-8859-1"
Construct a query in access to link the main table and code table.
Import this query so that SPSS datafile now contains BOTH the crop
crop codes. Then apply the syntax "Apply lab1 as label to var1 by
syntax.SPS" which you will find at the following URL
Raynald Levesque firstname.lastname@example.org
Visit my SPSS Pages http://pages.infinit.net/rlevesqu/index.htm
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Jayasinghe, Gayathri (IWMI-HQ)
Sent: February 6, 2002 1:33 AM
Subject: QUERY: On importing from Access
This is a long shot I know but thought I'd ask anyway because this is a
recurrent need for an efficient solution every time I import from an Access
database, and that is nearly every time I work with a dataset.
Access database consists of main table with a variable for crop code and a
code table containing crop code and crop description for lookup. This is a
scaled down example. The real datasets have many coded variables and as
many lookup tables.
1 - Rice
3 - Maize
4 - Cowpea
Question: Is it possible to import the main table so that the SPSS datafile
contains the numeric crop codes, but have the value labels picked up from
the code tables?
At the moment I have two options.
1/ Import the main table. Write VALUE LABELS syntax to label the crop code
with crop description.
2/ Construct a query in access to link the main table and code table.
Import this query so that SPSS datafile now contains the crop descriptions
instead of crop codes. Then use autorecode. However, autorecode may recode
the crops with different codes than those appearing in the original access
code tables. This is not ideal.
Any suggestions much appreciated!
International Water Management Institute
P O Box 2075, Colombo, Sri Lanka.
NB: Please note the new telephone and fax numbers
Phone: ++ 94 -1- 787404 ++94-1- 784080
Fax: ++ 94 -1- 786854
Water for food, nature and rural development. Research results, useful data,