1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
* Export some vars to all sheets, some other vars to specific sheets.
* Raynald Levesque 2004/04/07.

GET FILE='c:\\program files\\spss\\employee data.sav'.

* export id gender and jobcat to sheet "id_gender_job".
SAVE TRANSLATE
 /TYPE=odbc
 /CONNECT="DSN=Excel Files;DBQ=C:\\temp\\demo.xls;"
 /TABLE="id_gender_job"
 /KEEP=id gender jobcat
 /UNSELECT=retain
 /REPLACE.

* export id gender and salary to sheet "id_gender_sal".
SAVE TRANSLATE
 /TYPE=odbc
 /CONNECT="DSN=Excel Files;DBQ=C:\\temp\\demo.xls;"
 /TABLE="id_gender_sal"
 /KEEP=id gender salary
 /UNSELECT=retain
 /REPLACE.