pspp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: UPDATE code


From: Crichton, Ronald
Subject: RE: UPDATE code
Date: Sun, 7 Apr 2013 22:07:44 +0000

Actually, there is a difference between the two input files - subtle, but it's 
there!  (Name and age values are different.) As it happens I think I'm on 
track.  I did some experimental work on the weekend.  My mistake was to think 
that the Master file would actually be updated, but the Master file it is not 
updated during this process.  I had assumed the update function would work like 
a table update in a database, in as much that when the command is run the table 
records are permanently updated.

I now realise that the PSPP update command reads data from the Master file and 
reads data from the Transaction file and from this data the 'active' file is 
manipulated to reflect the intended updates.  The original data in Master 
remains unaffected.  At the end of the run nothing changes.  To retain the 
updates the active file must be saved.  I guess it would be the user's choice 
to save the active file to a new file name or the same name as the Master file.

The user manual is a little ambiguous in this regard. The first sentence states 
"UPDATE updates a master file..." which is not quite correct, as the master 
file is not updated.   Then the first dot point refers to values being replaced 
"in the new active file."  I missed this on my first reading of the manual.  
May I suggest the manual be changed to make it clear that the master file is 
not actually updated and that the active file must be saved to retain a 
permanent record of the updates?

Thank you,  Ron


-----Original Message-----
From: John Darrington [mailto:address@hidden
Sent: Saturday, 6 April 2013 6:38 PM
To: Crichton, Ronald
Cc: address@hidden
Subject: Re: UPDATE code

On Fri, Apr 05, 2013 at 02:35:31AM +0000, Crichton, Ronald wrote:
     I'm trying to get UPDATE to work but I'm not getting it.  Can you please 
tell me where I'm going wrong.

     I created two test files.  The master I called NAT99.sav and here is the 
data:
     1JOE M91
     2MARYF86
     3JACKM98
     4JILLF85
     5BOB M87
     6SUE F92

     And the transaction file I called NAT99_updates.txt, and here is the data:
     1JOE M19
     2MARYF86
     3JACKM98
     4JILLF85
     5XXX M87
     6SUE F29

     I then read each file creating a system file for each one.  Here is the 
code I used, hoping to see the master file updated with changes listed in the 
transaction file.  But the master file isn't updated.  Where am I going wrong?

     get file ='C:\PSPP_update\NAT99.sav'.
     update
                     /file = *
                     /file = 'C:\PSPP_update\NAT99NAT99_updates.txt.sav'
                     /in=infred
                     /by ClientID.
     execute.
     list.


     Thank you,  Ron

Well in your example, nothing very interesting will happen, bacause in both 
"master" and "update"
ClientID contains exactly the same values.  Hence master will get completely 
overwritten by update.  The normal use would have update containing only a 
subset of the values in master.

What are you trying to achieve?

J'



--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3 See 
http://keys.gnupg.net or any PGP keyserver for public key.


CIT is the ACT Large Training Provider of the Year.
Subscribe to CIT Industry Connection - CIT's free, bi monthly publication:
http://cit.edu.au/industry_business/industry_connection/
-----------------------------------------------------------------------
This email, and any attachments, may be confidential and also privileged. If 
you are not the intended recipient, please notify the sender and delete all 
copies of this transmission along with any attachments immediately. You should 
not copy or use it for any purpose, nor disclose its contents to any other 
person.
-----------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]