SAVE TRANSLATE
SAVE TRANSLATE translates the active dataset into a file that can be used by other software applications. Supported formats are include Excel, dBASE , CSV, tab-delimited text files, SAS, Stata, SPSS/PC+ data files, and ODBC database sources. For ODBC database sources, it can also manipulate database tables.
SAVE TRANSLATE
[{/OUTFILE=file }]
{/CONNECT=ODBC connect string}
[{/UNENCRYPTED}]
{/ENCRYPTED }
[/TYPE={CSV }]
{DB2 }
{DB3 }
{DB4 }
{ODBC }
{PC }
{SAS }
{STATA}
{SYM }
{SLK }
{TAB }
{WKS }
{WK1 }
{WK3 }
{XLS }
[/VERSION={1}]
{2}
{3}
{4}
{5}
{6}
{7}
{8}
{9}
{10}
{11}
{12}
{13}
{X}
[/ENCODING={'Locale'}] [BOM={YES}]
{'System'} {NO }
{'value' }
[/FIELDNAMES]
[/CELLS={VALUES}]
{LABELS}
[/TEXTOPTIONS [DELIMITER='char'] [QUALIFIER='char']
[DECIMAL={DOT }]
{COMMA}
[FORMAT={PLAIN }]]
{VARIABLE}
[/EDITION={INTERCOOLED}
{SE }
[/PLATFORM={ALPHA}]
{WINDOWS}
{UNIX}
[{/VALFILE=filename}]
[/TABLE = 'database table name']
[/SQL = 'SQL statement' [/SQL = 'SQL statement']]
[/BULKLOADING]
[METHOD={OFF }]
{BATCH}
{ODBC }
[BATCHSIZE=integer]
[BINDING={ROW }]
{COLUMN}
[{/APPEND }]
{/REPLACE}
[/RENAME=(old varlist=new varlist)[(...)]
[/KEEP={ALL }]
{varlist}
[/DROP=varlist]
[/UNSELECTED=[{RETAIN}]
{DELETE}
[/MISSING={IGNORE}]
{RECODE}
[{/COMPRESSED }]
{/UNCOMPRESSED}
[/MAP]
- OUTFILE is not valid for TYPE=ODBC but is required for all other types.
- CONNECT is required for TYPE=ODBC but is invalid for all other types.
- APPEND, SQL, ENCRYPTED, and TABLE are available only for TYPE=ODBC.
- ENCODING is available only for TYPE=SAS, TYPE=STATA, TYPE=TABand TYPE=CSV.
- FIELDNAMES is available for spreadsheet formats and text data formats.
- PLATFORM and VALFILE are available only for TYPE=SAS, and PLATFORM is required.
- CELLS is available for TYPE=XLS /VERSION=8, TYPE=TAB, and TYPE=CSV.
- TEXTOPTIONS is available only for TYPE=TAB and TYPE=CSV.
- EDITION is available only for TYPE=STATA.
- COMPRESSED and UNCOMPRESSED are available only for TYPE=PC.
- BULKLOADING is available only for TYPE=ODBC.
This command reads the active dataset and causes execution of any pending commands. See the topic Command Order for more information.
Release History
Release 14.0
- Value STATA added to list for TYPE subcommand.
- EDITION subcommand introduced for TYPE=STATA.
- SQL subcommand introduced.
- MISSING subcommand introduced.
- Field/column names specified on the RENAME subcommand can contain characters (for example, spaces, commas, slashes, plus signs) that are not allowed in IBM® SPSS® Statistics variable names.
- Continuation lines for connection strings on the CONNECT subcommand do not need to begin with a plus sign.
Release 15.0
- ENCRYPTED subcommand introduced.
- Value CSV added to list for TYPE subcommand.
- TEXTOPTIONS subcommand introduced for TYPE=CSV and TYPE=TAB.
Release 16.0
- VERSION=12 introduced for writing data in Excel 2007 XLSX format with TYPE=XLS.
Release 17.0
- UNENCRYPTED subcommand introduced.
Release 18.0
- VERSION=9 introduced for writing SAS 9+ files with TYPE=SAS.
Release 19
- ENCODING subcommand introduced.
Release 22.0
- BOM keyword added to ENCODING subcommand.
Release 23.0
- Support for versions 9-13 of Stata added to VERSION subcommand.
- BULKLOADING subcommand added.
Example
SAVE TRANSLATE OUTFILE='/data/sales.xls'.