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
* To write a COMMA delimited file.
WRITE OUTFILE=OUT TABLE/ VAR1 ',' VAR2 ',' VAR3 ',' VAR4.



*---------------------------------------------------------------------------------------------------------------.
* To write a TAB delimited file.

/*
You can use SAVE TRANSLATE to create a TAB delimited file that only contains
the variables you want in the file. First, sort the file into the order you
want the tab delimited file to be in. Then, use this command:
*/.

SAVE TRANSLATE OUTFILE = 'tabfile.dat' /TYPE=TAB /FIELDNAMES /KEEP= record artist rank.

/*
The above syntax will create a TAB DELIMITED file that contains the variables
record, artist and rank with the variable names at the top of the columns.
If you don't want to include the variable names, leave off the /FIELDNAMES
subcommand. This command is also available through the menus by going to
File -> Save As and selected Tab Delimited as the type of file. However,
that will save the entire data file into the tab delimited file.

You can also use SAVE TRANSLATE to write an Excel or dBase format file.
More information on SAVE TRANSLATE can be found on pages 876 - 884 in the
SPSS Base 9.0 Syntax Reference Guide.
*/.