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 [VALUE={NAMES }]
                     {LABELS}

 [/CELLS={VALUES}]
         {LABELS}

 [/TEXTOPTIONS [DELIMITER='char'] [QUALIFIER='char']  
               [DECIMAL={DOT  }]
                        {COMMA}
               [FORMAT={PLAIN   }]]
                       {VARIABLE}

 [/EXCELOPTIONS SHEET='name']

 [/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}

[/ODBCOPTIONS VALLABELS={NONE   }]
                        {varlist}

 [{/APPEND }]
  {/REPLACE}

 [/RENAME=(old varlist=new varlist)[(...)]

 [/KEEP={ALL    }]
        {varlist}

 [/DROP=varlist] 

 [/UNSELECTED=[{RETAIN}]
               {DELETE}

 [/MISSING={IGNORE}]
           {RECODE}

 [{/COMPRESSED  }]
  {/UNCOMPRESSED}
 
 [/MAP]

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.

Release 24.0

  • VALUE keyword added to FIELDNAMES subcommand.
  • ODBCOPTIONS subcommand added.
  • EXCELOPTIONS subcommand added.

Example

SAVE TRANSLATE OUTFILE='/data/sales.xlsx'
  /TYPE=XLS /VERSION=12.