SAVE TRANSLATE /OUTFILE={'file_name',file_handle} /TYPE=CSV [/REPLACE] [/MISSING={IGNORE,RECODE}] [/DROP=var_list] [/KEEP=var_list] [/RENAME=(src_names=target_names)...] [/UNSELECTED={RETAIN,DELETE}] [/FIELDNAMES] [/CELLS={VALUES,LABELS}] [/TEXTOPTIONS DELIMITER='delimiter'] [/TEXTOPTIONS QUALIFIER='qualifier'] [/TEXTOPTIONS DECIMAL={DOT,COMMA}] [/TEXTOPTIONS FORMAT={PLAIN,VARIABLE}]
The SAVE TRANSLATE command with TYPE=CSV or TYPE=TAB writes data in a comma- or tab-separated value format similar to that described by RFC 4180. Each variable becomes one output column, and each case becomes one line of output. If FIELDNAMES is specified, an additional line at the top of the output file lists variable names.
The CELLS and TEXTOPTIONS FORMAT settings determine how values are written to the output file:
Numeric values use, by default, the decimal point character set with
SET DECIMAL (see SET DECIMAL). Use DECIMAL=DOT or DECIMAL=COMMA
to force a particular decimal point character.
Regardless of CELLS and TEXTOPTIONS FORMAT, numeric system-missing values are output as a single space.
For TYPE=TAB, tab characters delimit values. For TYPE=CSV, the TEXTOPTIONS DELIMITER and DECIMAL settings determine the character that separate values within a line. If DELIMITER is specified, then the specified string separate values. If DELIMITER is not specified, then the default is a comma with DECIMAL=DOT or a semicolon with DECIMAL=COMMA. If DECIMAL is not given either, it is implied by the decimal point character set with SET DECIMAL (see SET DECIMAL).
The TEXTOPTIONS QUALIFIER setting specifies a character that is output before and after a value that contains the delimiter character or the qualifier character. The default is a double quote (‘@’). A qualifier character that appears within a value is doubled.