SPSS Statistics

 View Only
  • 1.  convert files to XLSX

    Posted Wed July 20, 2022 08:06 AM
    This script converts files to xls.  Is there a way to convert sav files to the current xlsx?  


    define !out () !quote(!concat(!unquote(!eval(!JOB_DATADIR)),
    "/",
    !unquote(!eval(!JOB_DATAFILEROOT)))) !enddefine.
    GET FILE=JOB_INPUTFILE.
    SAVE TRANSLATE OUTFILE=!out
    /TYPE=XLS /VERSION=12 /MAP /REPLACE /FIELDNAMES /CELLS=LABELS.
    execute.

    ------------------------------
    Art Jack
    ------------------------------

    #SPSSStatistics


  • 2.  RE: convert files to XLSX

    Posted Thu July 21, 2022 08:43 AM
    Hi. As I understand the command syntax reference for SAVE TRANSLATE, XLS files have three options for VERSION:

    5: Excel 95 Workbook
    8: Excel 97–2003 Workbook
    12: Excel 2007 Workbook

    When I try it through the dialogs, I get:

    SAVE TRANSLATE OUTFILE='/tmp/test1.xlsx'
     /TYPE=XLS
     /VERSION=12
     /MAP
     /FIELDNAMES VALUE=NAMES
     /CELLS=VALUES
     /REPLACE.

    So, 12 is the latest VERSION for TYPE=XLS.

    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------