Date: Thu, 27 Jun 2002 20:45:23 -0400
Reply-To: Raynald Levesque <rlevesque@videotron.ca>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Raynald Levesque <rlevesque@videotron.ca>
Subject: Re: Still battling with syntax
In-Reply-To: <000001c21e25$8c6b4a20$322814ac@data>
Content-Type: text/plain; charset="us-ascii"
Hi
** Test #1 (this works).
DATA LIST LIST /born gender ethnicit.
BEGIN DATA.
1 1 1
2 . 2
3 3 3
END DATA.
LIST.
SAVE OUTFILE='C:\temp\DB1a.sav'.
DATA LIST LIST /born gender ethnicit.
BEGIN DATA.
1 2 2
2 . 3
3 4 .
END DATA.
LIST.
SAVE OUTFILE='C:\temp\DB1.sav'.
UPDATE FILE='C:\temp\DB1a.sav'
/FILE='C:\temp\DB1.sav'
/BY BORN /KEEP BORN, GENDER, ETHNICIT .
LIST.
* The result of the lsit command is as expected:
BORN GENDER ETHNICIT
1.00 2.00 2.00
2.00 . 3.00
3.00 4.00 3.00
Number of cases read: 3 Number of cases listed: 3
*************************.
*test #2 (This reproduces the error you are getting).
DATA LIST LIST /born gender ethnicit.
BEGIN DATA.
2 . 2
1 1 1
3 3 3
END DATA.
LIST.
SAVE OUTFILE='C:\temp\DB1a.sav'.
DATA LIST LIST /born gender ethnicit.
BEGIN DATA.
1 2 2
2 . 3
3 4 .
END DATA.
LIST.
SAVE OUTFILE='C:\temp\DB1.sav'.
UPDATE FILE='C:\temp\DB1a.sav'
/FILE='C:\temp\DB1.sav'
/BY BORN /KEEP BORN, GENDER, ETHNICIT .
LIST.
*************************.
*test #3 (Making #2 work).
DATA LIST LIST /born gender ethnicit.
BEGIN DATA.
2 . 2
1 1 1
3 3 3
END DATA.
LIST.
SORT CASES BY born.
SAVE OUTFILE='C:\temp\DB1a.sav'.
DATA LIST LIST /born gender ethnicit.
BEGIN DATA.
1 2 2
2 . 3
3 4 .
END DATA.
LIST.
* Next line is not really necessary given the above data.
SORT CASES BY born.
SAVE OUTFILE='C:\temp\DB1.sav'.
UPDATE FILE='C:\temp\DB1a.sav'
/FILE='C:\temp\DB1.sav'
/BY BORN /KEEP BORN, GENDER, ETHNICIT .
LIST.
* Same output as in test #1 is obtained.
HTH
Raynald Levesque rlevesque@videotron.ca
Visit my SPSS Pages http://pages.infinit.net/rlevesqu/index.htm
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Alex Davidson
Sent: June 27, 2002 5:57 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Still battling with syntax
Hi everyone
Thank you to all those kind souls who pointed me the right way, but I
still need more help. Now the syntax has improved to read:
UPDATE FILE='C:\Program Files\SPSS\DB1a.sav' /FILE='C:\Program
Files\SPSS\DB1.sav' /BY BORN /KEEP BORN, GENDER, ETHNICIT .
But I still get errors
"File #1_
KEY: 1.23E+10
>Error # 5141
>File out of order doing ADD FILES or UPDATE. All files must be in
>non-descending order on the BY variables. Use SORT CASES to sort the
file
>in order.
>This command not executed.
>Note # 35
>There is no working file to be restored. The state of the SPSS
Processor
>is as if a NEW FILE command had been executed."
A new file opens up with the three fields that I want to update and the
message at the bottom says "transformation pending" with no further
details..
This is after trying to resort my data file by the three fields in
ascending order...help!!!
Alex
_________________________________________________
Dr Alex Davidson
Odyssey House
Private Bag MBE M230
AUCKLAND
ph. 623 1447 ext. 708