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
------------------------------
Original Message:
Sent: Tue May 23, 2023 02:39 AM
From: haider ali
Subject: Export a single/specific table from spss output to excel using spss syntax
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
------------------------------