SPSS Statistics

 View Only
  • 1.  Export a single/specific table from spss output to excel using spss syntax

    Posted Tue May 23, 2023 02:39 AM

    Hi can anyone guide me how to save the specific table from spss output to excel with spss syntax. Here previously someone share the oms code. I have run it. it ran without error but it dont save anything in the destination folder. I will be really thankful to you ppl if anyone of you can help. Because it is essential to complete my project. Thanks



    ------------------------------
    haider ali
    ------------------------------


  • 2.  RE: Export a single/specific table from spss output to excel using spss syntax

    IBM Champion
    Posted Tue May 23, 2023 08:53 AM
    OMS will save selected output as specified in the DESTINATION subcommand, but if no objects of the type specified are created between OMS and OMSEND, no action is taken.

    This usually means that the proper table subtype was not specified.  You can check the table subtypes via OMS > OMS Control Panel, but you can also just create a table of the desired type and then right click on the table in the outline and copy Copy OMS subtype.

    You can also use OUTPUT EXPORT, but you are limited in what you can specify there.

    --





  • 3.  RE: Export a single/specific table from spss output to excel using spss syntax

    Posted Thu May 25, 2023 05:54 PM

    Hello @haider ali . Jon Peck is correct about using OMS or OUTPUT EXPORT to accomplish what you want. I would beg to differ though on the number and breadth of options available when using OUTPUT EXPORT. 

    Here is the (poorly formatted in this editor) command template from the Statistics Syntax Guide. See the Guide for more detail and better formatting. As can be seen there are a lot of options:
    OUTPUT EXPORT [NAME = {* }] {name} 
    [/CONTENTS [EXPORT = {ALL** }]] {VISIBLE} 
    [LAYERS = {PRINTSETTING**}] {ALL } {VISIBLE } 
    [MODELVIEWS = {PRINTSETTING**}] {ALL } {VISIBLE } 
    [/DOC DOCUMENTFILE = 'filespec'] [NOTESCAPTIONS = {YES**}] 
    {NO } [WIDETABLES = {WRAP**}] 
    {SHRINK} 
    {ASIS }
[PAGESIZE = {INCHES(width,height)}] 
    {MM(width,height) } [TOPMARGIN = {INCHES(n)}] 
    {MM(n) } [BOTTOMMARGIN = {INCHES(n)}] 
    {MM(n) } [LEFTMARGIN = {INCHES(n)}] 
    {MM(n) } [RIGHTMARGIN = {INCHES(n)}] 
    {MM(n) } [PAGEBREAKS = {YES**}] 
    {NO } 
    [/HTML DOCUMENTFILE = 'filespec'] [NOTESCAPTIONS = {YES**}] 
    {NO } [IMAGEFORMAT = {JPG**}] 
    {BMP } 
    {PNG } [STYLING = {YES** } {NO } 
    [INTERACTIVELAYERS = {NO**}] {YES } 
    [/PDF DOCUMENTFILE = 'filespec'] [EMBEDBOOKMARKS = {YES**}] 
    {NO } [EMBEDFONTS = {YES**}] 
    {NO } 
    [/PPT DOCUMENTFILE = 'filespec'] [NOTESCAPTIONS = {YES**}] 
    {NO } [SLIDETITLES = {YES**}] 
    {NO } [WIDETABLES = {WRAP**}] 
    {SHRINK} 
    {ASIS }
[SLIDESIZE = {INCHES(width,height)}] 
    {MM(width,height) } [TOPMARGIN = {INCHES(n)}] 
    {MM(n) } [BOTTOMMARGIN = {INCHES(n)}] 
    {MM(n) } [LEFTMARGIN = {INCHES(n)}] 
    {MM(n) } [RIGHTMARGIN = {INCHES(n)}] {MM(n) } 
    [/TEXT DOCUMENTFILE = 'filespec'] [ENCODING = {LOCALE**}] 
    {UTF8 } 
    {UTF16 } [NOTESCAPTIONS = {YES**}] 
    {NO } [COLUMNWIDTH = {AUTOFIT**}] 
    {width } [SEPARATOR = {SPACE**}] 
    {TAB } [ROWBORDER = {'-'** }] 
    {'character'} [COLUMNBORDER = {'|'** }] 
    {'character'} [IMAGEFORMAT = {JPG**}] 
    {BMP } {EMF } {EPS } {PNG } {TIF } {SVG } 
    [/{XLS|XLSX|XLSM} DOCUMENTFILE = 'filespec'] [OPERATION = {CREATEFILE**}] 
    {CREATESHEET } 
    {MODIFYSHEET } [SHEET = {'sheetname'}] 
    [LOCATION = {LASTCOLUMN** }] {LASTROW } 
    {STARTCELL@@('cellref')} [NOTESCAPTIONS = {YES**}] 
    {NO } 
    [/BMP IMAGEROOT = 'rootname'] [PERCENTSIZE = {100**}] 
    {n } [COMPRESS = {NO**}] 
    {YES } 
    [/EMF IMAGEROOT = 'rootname'] [PERCENTSIZE = {100**}] 
    {n } 
    [/EPS IMAGEROOT = 'rootname'] [WIDTH = {PERCENT**({100**})}] 
    {n } {CENTIMETERS(n) } {INCHES(n) } {POINTS(n) } 
    [PREVIEW = {YES**}] {NO } 
    [FONTHANDLING = {REFERENCES**}] {CURVES } 
    [/JPG IMAGEROOT = 'rootname'] [PERCENTSIZE = {100**}] 
    {n } [GRAYSCALE = {NO**}] 
    {YES } 
    [/PNG IMAGEROOT = 'rootname'] [PERCENTSIZE = {100**}] 
    {n } [DEPTH = {SCREEN** }] {BLACKWHITE} {GRAYS256 } {COLORS16 } {COLORS256 } {TRUE24BIT } {TRUE32BIT } 
    [/TIF IMAGEROOT [PERCENTSIZE = 
    [/SVG IMAGEROOT [PERCENTSIZE = 
    = 'rootname'] {100**}]
{n } 
    = 'rootname'] {100**}]
{n } 

    Here is an example from the same Statistics Syntax Guide:
    OUTPUT EXPORT NAME=Region1Results
    /XLS DOCUMENTFILE='/mydocs/ResultsByRegion.xls'
    OPERATION=CREATESHEET SHEET='Region 1'.



    ------------------------------
    Curtis Browning
    SPSS Statistics Architect
    ------------------------------



  • 4.  RE: Export a single/specific table from spss output to excel using spss syntax

    IBM Champion
    Posted Thu May 25, 2023 07:12 PM
    What you can't do in OUTPUT EXPORT is to select the particular tables you want to export.  You are limited to all or visible.  And there is no OUTPUT EXPORT syntax for "selected".

    But the SPSSINC MODIFY OUTPUT extension command includes a custom function that allows you to export tables based on their OMS table type.  The function is customoutputfunctions.excelexport.  The customoutputfunctions module is installed along with SPSSINC MODIFY OUTPUT, and that module has instructions on how to use it.



    --