Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export spss custom tables

Tags:

spss

I want to export several spss custom tables to excel. I want to export just the tables and exclude the syntax. I tried to select all and exclude if, but I am still getting all of the output.

like image 796
oana Avatar asked Dec 25 '22 19:12

oana


2 Answers

You can export the output with the OMS command. Within this command you can specify which output elements you want to export.

If you want to export just the custom tables, you can run the following command.

OMS /SELECT TABLES 
    /IF SUBTYPES = 'Custom Table'
    /DESTINATION FORMAT = XLSX 
     OUTFILE = '/mydir/myfile.xlsx'. 

... Some CTABLES Commands ...

OMSEND.

Every custom table (generated from CTABLES commands) between OMS and OMSEND will be exported to a single .xlsx file specified by the outfile option.

See the SPSS Command Syntax Reference for more information on the OMS command.

like image 55
mirirai Avatar answered Feb 08 '23 16:02

mirirai


Here is an complete example of Output Management System (OMS) in xlsx with Ctable using SPSS Syntax. Here I have run custom table between Month and A1A variables. I have used VIEWER=NO is OMS Syntax which does not display CTables in SPSS output window but create xlsx output with desired tables.

   OMS
      /SELECT TABLES
      /IF COMMANDS=['CTables'] SUBTYPES=['Custom Table']
      /DESTINATION  FORMAT=XLSX
       OUTFILE ='...\Custom Tables.xlsx'
     VIEWER=NO.


 CTABLES 
    /VLABELS VARIABLES=A1A MONTH DISPLAY=LABEL 
    /TABLE A1A [C] BY MONTH [C][COLPCT.COUNT PCT40.1] 
    /CATEGORIES VARIABLES=A1A MONTH ORDER=A KEY=VALUE EMPTY=INCLUDE
    /SLABELS VISIBLE=NO 
    /TITLES
     TITLE='[UnAided Brand Awareness] A1A TOM.'
     CAPTION= ')DATE)TIME'.

 OMSEND.
like image 24
Md. Sahidul Islam Avatar answered Feb 08 '23 15:02

Md. Sahidul Islam