OMS & CTables

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

OMS & CTables

DKUKEC
Greetings SPSSers,

After reviewing the archives (including Google and TFM), I have had some
success with the following example and syntax using OMS - getting CROSSTABS
into SAV file format.  However, when I attempt the following for CUSTOM
TABLES the SAV file only contains three variables (e.g., Command_ , Subtype_
, Label_ ).  Any suggestions - what I am missing or where my syntax needs to
be revised to include the DISPOSITION3, OUTCOME1, and OUTCOME2 variables for
the CUSTOM TABLES - would be greatly appreciated.

Thank you
Damir


*******************************************************************

* OMS

DATA LIST FREE / DISPOSITION3 (F2) OUTCOME1 (F2) OUTCOME2 (F2).
BEGIN DATA.
1  0 0
1  1 0
2  1 1
3  0 0
4  1 1
END DATA.
DATASET NAME ARRESTS.
SORT CASES BY DISPOSITION3  .

VARIABLE LABELS
DISPOSITION3 "DISPOSITION"
OUTCOME1 "ARRESTED"
OUTCOME2 "CONVICTED" .

VALUE LABELS DISPOSITION3
1"No File"
2"Probation"
3"Prison"
4"Jail".

LIST DISPOSITION3 OUTCOME1 OUTCOME2 .
EXECUTE.

DATASET ACTIVATE ARRESTS .
OMS SELECT TABLES
 /DESTINATION FORMAT = SAVE OUTFILE  = "C:\Users\dkukec\Desktop\DESKTOP\SPSS
Test\CON1.SAV"
 /IF COMMANDS = ['crosstabs'] subtypes = ['Crosstabulation'].
CROSSTABS TABLES = DISPOSITION3 BY OUTCOME1  .
OMSEND .

GET FILE "C:\CON1.SAV" .
DATASET NAME CON1 .


*******************************************************************************************

DATASET ACTIVATE ARRESTS .
OMS SELECT TABLES
 /DESTINATION FORMAT = SAVE OUTFILE  = "C:\Users\dkukec\Desktop\DESKTOP\SPSS
Test\CON2.SAV"
 /IF COMMANDS = ['CUSTOM TABLES'] SUBTYPES = ['CUSTOM TABLES'] .
CTABLES
  /VLABELS VARIABLES=DISPOSITION3 OUTCOME1 OUTCOME2 DISPLAY=LABEL
  /TABLE DISPOSITION3 [C][COUNT F40.0] BY OUTCOME1 [C] + OUTCOME2 [C]
  /CATEGORIES VARIABLES=DISPOSITION3 OUTCOME1 ORDER=A KEY=VALUE
EMPTY=INCLUDE
  /CATEGORIES VARIABLES=OUTCOME2 [1] EMPTY=INCLUDE.
OMSEND .

GET FILE "C:\CON2.SAV" .
DATASET NAME CON2 .





--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/OMS-CTables-tp5721614.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: OMS & CTables?

Rick Oliver-3
You get an empty dataset because the command and subtype specification are incorrect. Try:

 /IF COMMANDS = ['CTABLES'] SUBTYPES = ['CUSTOM TABLE'] .


Rick Oliver
Senior Information Developer
IBM Business Analytics (SPSS)
E-mail: [hidden email]




From:        DKUKEC <[hidden email]>
To:        [hidden email],
Date:        08/16/2013 01:13 PM
Subject:        OMS & CTables?
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Greetings,

After reviewing the archives (including Google and TFM), I have had some
success with the following example and syntax using OMS - getting CROSSTABS
into SAV file format.  However, when I attempt the following for CUSTOM
TABLES the SAV file only contains three variables (e.g., Command_ , Subtype_
, Label_ ).  Any suggestions - what I am missing or where my syntax needs to
be revised to include the DISPOSITION3, OUTCOME1, and OUTCOME2 variables for
the CUSTOM TABLES - would be greatly appreciated.

Thank you
Damir


*******************************************************************

* OMS

DATA LIST FREE / DISPOSITION3 (F2) OUTCOME1 (F2) OUTCOME2 (F2).
BEGIN DATA.
1  0 0
1  1 0
2  1 1
3  0 0
4  1 1
END DATA.
DATASET NAME ARRESTS.
SORT CASES BY DISPOSITION3  .

VARIABLE LABELS
DISPOSITION3 "DISPOSITION"
OUTCOME1 "ARRESTED"
OUTCOME2 "CONVICTED" .

VALUE LABELS DISPOSITION3
1"No File"
2"Probation"
3"Prison"
4"Jail".

LIST DISPOSITION3 OUTCOME1 OUTCOME2 .
EXECUTE.

DATASET ACTIVATE ARRESTS .
OMS SELECT TABLES
/DESTINATION FORMAT = SAVE OUTFILE  = "C:\CON1.SAV"
/IF COMMANDS = ['crosstabs'] subtypes = ['Crosstabulation'].
CROSSTABS TABLES = DISPOSITION3 BY OUTCOME1  .
OMSEND .

GET FILE "C:\CON1.SAV" .
DATASET NAME CON1 .


*******************************************************************************************

DATASET ACTIVATE ARRESTS .
OMS SELECT TABLES
/DESTINATION FORMAT = SAVE OUTFILE  = "C:\CON2.SAV"
/IF COMMANDS = ['CUSTOM TABLES'] SUBTYPES = ['CUSTOM TABLES'] .
CTABLES
 /VLABELS VARIABLES=DISPOSITION3 OUTCOME1 OUTCOME2 DISPLAY=LABEL
 /TABLE DISPOSITION3 [C][COUNT F40.0] BY OUTCOME1 [C] + OUTCOME2 [C]
 /CATEGORIES VARIABLES=DISPOSITION3 OUTCOME1 ORDER=A KEY=VALUE
EMPTY=INCLUDE
 /CATEGORIES VARIABLES=OUTCOME2 [1] EMPTY=INCLUDE.
OMSEND .

GET FILE "C:\CON2.SAV" .
DATASET NAME CON2 .





--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/OMS-CTables-tp5721620.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD


Reply | Threaded
Open this post in threaded view
|

Re: OMS & CTables

Jon K Peck
In reply to this post by DKUKEC
As I noted off list, the command identifier in the OMS syntax should be "ctables".


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        DKUKEC <[hidden email]>
To:        [hidden email],
Date:        08/16/2013 12:13 PM
Subject:        [SPSSX-L] OMS & CTables
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Greetings SPSSers,

After reviewing the archives (including Google and TFM), I have had some
success with the following example and syntax using OMS - getting CROSSTABS
into SAV file format.  However, when I attempt the following for CUSTOM
TABLES the SAV file only contains three variables (e.g., Command_ , Subtype_
, Label_ ).  Any suggestions - what I am missing or where my syntax needs to
be revised to include the DISPOSITION3, OUTCOME1, and OUTCOME2 variables for
the CUSTOM TABLES - would be greatly appreciated.

Thank you
Damir


*******************************************************************

* OMS

DATA LIST FREE / DISPOSITION3 (F2) OUTCOME1 (F2) OUTCOME2 (F2).
BEGIN DATA.
1  0 0
1  1 0
2  1 1
3  0 0
4  1 1
END DATA.
DATASET NAME ARRESTS.
SORT CASES BY DISPOSITION3  .

VARIABLE LABELS
DISPOSITION3 "DISPOSITION"
OUTCOME1 "ARRESTED"
OUTCOME2 "CONVICTED" .

VALUE LABELS DISPOSITION3
1"No File"
2"Probation"
3"Prison"
4"Jail".

LIST DISPOSITION3 OUTCOME1 OUTCOME2 .
EXECUTE.

DATASET ACTIVATE ARRESTS .
OMS SELECT TABLES
/DESTINATION FORMAT = SAVE OUTFILE  = "C:\Users\dkukec\Desktop\DESKTOP\SPSS
Test\CON1.SAV"
/IF COMMANDS = ['crosstabs'] subtypes = ['Crosstabulation'].
CROSSTABS TABLES = DISPOSITION3 BY OUTCOME1  .
OMSEND .

GET FILE "C:\CON1.SAV" .
DATASET NAME CON1 .


*******************************************************************************************

DATASET ACTIVATE ARRESTS .
OMS SELECT TABLES
/DESTINATION FORMAT = SAVE OUTFILE  = "C:\Users\dkukec\Desktop\DESKTOP\SPSS
Test\CON2.SAV"
/IF COMMANDS = ['CUSTOM TABLES'] SUBTYPES = ['CUSTOM TABLES'] .
CTABLES
 /VLABELS VARIABLES=DISPOSITION3 OUTCOME1 OUTCOME2 DISPLAY=LABEL
 /TABLE DISPOSITION3 [C][COUNT F40.0] BY OUTCOME1 [C] + OUTCOME2 [C]
 /CATEGORIES VARIABLES=DISPOSITION3 OUTCOME1 ORDER=A KEY=VALUE
EMPTY=INCLUDE
 /CATEGORIES VARIABLES=OUTCOME2 [1] EMPTY=INCLUDE.
OMSEND .

GET FILE "C:\CON2.SAV" .
DATASET NAME CON2 .





--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/OMS-CTables-tp5721614.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD


Reply | Threaded
Open this post in threaded view
|

Re: OMS & CTables

PRogman
In reply to this post by DKUKEC
Damir,
If you want to save a few syntax lines and you don't really want to clutter your harddisk with temporary files you can direct the OMS output to a declared data set:

...
DATASET ACTIVATE ARRESTS .

* create the dataset *.
DATASET DECLARE CON1 .  

OMS SELECT TABLES
 /DESTINATION
  FORMAT = SAVE
  OUTFILE  = CON1
 /IF COMMANDS = ['Crosstabs'] subtypes = ['Crosstabulation'].

CROSSTABS TABLES = DISPOSITION3 BY OUTCOME1  .

OMSEND .
* and the Dataset Con1 is available with OMS data *.

Best regards
PR