1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
*(Q) I have a data base (a *.sav file) whose key consist of 4 variables. There 
	is also second *.sav file containing a list of keys which must be removed from the data base,
	How can I do that.

*(A) rlevesque@videotron.ca 2001/09/17.

DATA LIST LIST /id1 id2 id3 id4 data1.
BEGIN DATA
1 1 1 1 1
1 2 1 1 2
2 1 1 1 3
2 2 2 2 4
END DATA.
LIST.
SORT CASES BY id1 id2 id3 id4.
SAVE OUTFILE='c:\\temp\\database.sav'.

DATA LIST LIST /id1 id2 id3 id4.
BEGIN DATA
1 1 1 1 
2 2 2 2 
END DATA.
LIST.
SORT CASES BY id1 id2 id3 id4.
SAVE OUTFILE='c:\\temp\\delete list.sav'.

***** Start job.
GET FILE='c:\\temp\\delete list.sav'.
COMPUTE del=1.
SAVE OUTFILE='c:\\temp\\delete list.sav'.

GET FILE='c:\\temp\\database.sav'.


MATCH FILES /FILE=*
 /TABLE='C:\\Temp\\delete list.sav'
 /BY id1 id2 id3 id4.

* Next lines deletes unwanted cases.
SELECT IF MISSING(del).
* Delete the variable del.
MATCH FILES FILE=* /DROP=del.