Where can I find the SPSS Object Model?

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

Where can I find the SPSS Object Model?

sergio_da_silva
I read that SPSS has an underlying Object Model (pretty much like the DOM by which JavaScript alters an html document). I'd like to know its structure but unfortunately, I haven't been able to find any useful information on this.

One of the (very) few sources for the SPSS Object Model seems to be an old paper book called "Programming Using SPSS Scripts" (referred to by Raynald on his site). But I think this refers to the SPSS Object Model in version 13 (give or take a version) and even this book doesn't seem available in any way.

The reason for this question is that a client wants some highly customized pivot tables and I'm worried that the available Python modules for modifying pivot tables may not be flexible enough in order to create exactly what their customers want.

I'm even considering SaxBasic scripts but they are supposed to be deprecated since Python was introduced. Thus far, however, I feel like modifying Raynald's scripts is the easiest way to get the job done but I'm worried about the sustainability of SaxBasic in future SPSS versions.

Any advice on this appreciated!
Reply | Threaded
Open this post in threaded view
|

Re: Where can I find the SPSS Object Model?

Jon K Peck
You are referring, I think, to the object model for output objects - pivot tables in particular.  You can find this in the Basic help accessed from the help menu when you open a Basic script, or, for Python, via the xml schemas installed with the product.

I'm not clear whether you are interested in creating new pivot tables from scratch or modifying existing tables via scripting apis or extension commands.  If the former, you can look at the pivot table apis in the Python programmability help.  If the latter, you can look at the scripting apis in the Python scripting help.

There are several extension commands that can be used to modify output already created without writing Python code directly:
SPSSINC MODIFY TABLES modifies existing tables - primarily formatting but other things are possible
SPSSINC MODIFY OUTPUT for output objects in general - outline entries, titles, visibility, etc
STATS TABLE CALC for calculating with pivot tables either replacing existing rows or columns or, with V21, adding new ones.

The first two are included in the Python Essentials.  The third one can be downloaded from the SPSS Community website at www.ibm.com/developerworks/spssdevcentral


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




From:        sergio_da_silva <[hidden email]>
To:        [hidden email],
Date:        02/08/2013 08:46 AM
Subject:        [SPSSX-L] Where can I find the SPSS Object Model?
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




I read that SPSS has an underlying Object Model (pretty much like the DOM by
which JavaScript alters an html document). I'd like to know its structure
but unfortunately, I haven't been able to find any useful information on
this.

One of the (very) few sources for the SPSS Object Model seems to be an old
paper book called "Programming Using SPSS Scripts" (referred to by Raynald
on his  site <
http://www.spsstools.net/LearningScripts.htm>  ). But I think
this refers to the SPSS Object Model in version 13 (give or take a version)
and even this book doesn't seem available in any way.

The reason for this question is that a client wants some highly customized
pivot tables and I'm worried that the available Python modules for modifying
pivot tables may not be flexible enough in order to create exactly what
their customers want.

I'm even considering SaxBasic scripts but they are supposed to be deprecated
since Python was introduced. Thus far, however, I feel like modifying
Raynald's scripts is the easiest way to get the job done but I'm worried
about the sustainability of SaxBasic in future SPSS versions.

Any advice on this appreciated!



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Where-can-I-find-the-SPSS-Object-Model-tp5717993.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: Where can I find the SPSS Object Model?

sergio_da_silva
Thanks Jon!

With the (SaxBasic) script editor open, under <help>, there is <SPSS Statistics Object Help> (F2 shortkey doesn't seem to work). That's exactly what I was looking for!

It didn't come to mind to open the SaxBasic editor since it's said that SaxBasic is entirely deprecated since Python was introduced.

But just like SaxBasic can edit object properties, so can Python. Right?

Last question (hopefully) for now: in the SPSS installation folder, I found no less than 414 .xml files. Which ones did you mean by "via the xml schemas installed with the product." ?
Reply | Threaded
Open this post in threaded view
|

Re: Where can I find the SPSS Object Model?

David Marso
Administrator
"But just like SaxBasic can edit object properties, so can Python. Right?"
And C# and VB.Net and Excel and ....
---
sergio_da_silva wrote
Thanks Jon!

With the (SaxBasic) script editor open, under <help>, there is <SPSS Statistics Object Help> (F2 shortkey doesn't seem to work). That's exactly what I was looking for!

It didn't come to mind to open the SaxBasic editor since it's said that SaxBasic is entirely deprecated since Python was introduced.

But just like SaxBasic can edit object properties, so can Python. Right?

Last question (hopefully) for now: in the SPSS installation folder, I found no less than 414 .xml files. Which ones did you mean by "via the xml schemas installed with the product." ?
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Where can I find the SPSS Object Model?

sergio_da_silva
Yes, of course ;-) LOL! But I was referring to the objects (especially pivot tables) in the SPSS output viewer...
Reply | Threaded
Open this post in threaded view
|

Re: Where can I find the SPSS Object Model?

Jon K Peck
In reply to this post by sergio_da_silva


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




From:        sergio_da_silva <[hidden email]>
To:        [hidden email],
Date:        02/08/2013 10:38 AM
Subject:        Re: [SPSSX-L] Where can I find the SPSS Object Model?
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Thanks Jon!

With the (SaxBasic) script editor open, under <help>, there is <SPSS
Statistics Object Help> (F2 shortkey doesn't seem to work). That's exactly
what I was looking for!

It didn't come to mind to open the SaxBasic editor since it's said that
SaxBasic is entirely deprecated since Python was introduced.

>>>Basic is still supported.

But just like SaxBasic can edit object properties, so can Python. Right?

>>>Python can do everything that Basic can do and much more.

Last question (hopefully) for now: in the SPSS installation folder, I found
no less than 414 .xml files. Which ones did you mean by "via the *xml
*schemas installed with the product." ?

>>>Schemas have the extension xsd.  The output schema is
spss-output-1.8.xsd
for version 21.

If you are used to reading xml schemas, you can take a look at this, but it is quite complicated.  For most purposes you are better off looking at the scripting api documentation once you understand the pivot table constructs.

Note also that there are functions in the spss and spssaux.py module installed with the Python Essentials that relieve you of the need to work directly with the xml in many cases.  In particular, spss.EvaluateXPath and, easier, the spssaux.createXmlOuput and spssaux.GetValuesFromXmlWorkspace are useful in working with OMS output written to the xmlworkspace.  

The Python (or Basic) scripting apis allow you to get at the Viewer objects directly rather than with the xml interfaces.  And, of course, the extension commands I mentioned move to a still higher level.

HTH,

Jon

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Where-can-I-find-the-SPSS-Object-Model-tp5717993p5718001.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: Where can I find the SPSS Object Model?

David Marso
Administrator
In reply to this post by sergio_da_silva
They are simply objects which expose properties and methods!
What language you use to diddle them is of no real consequence.
--
sergio_da_silva wrote
Yes, of course ;-) LOL! But I was referring to the objects (especially pivot tables) in the SPSS output viewer...
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Where can I find the SPSS Object Model?

David Marso
Administrator
In reply to this post by Jon K Peck
">>>Python can do everything that Basic can do and much more."
(much more) What and why?


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




From:   sergio_da_silva <[hidden email]>
To:     [hidden email],
Date:   02/08/2013 10:38 AM
Subject:        Re: [SPSSX-L] Where can I find the SPSS Object Model?
Sent by:        "SPSSX(r) Discussion" <[hidden email]>



Thanks Jon!

With the (SaxBasic) script editor open, under <help>, there is <SPSS
Statistics Object Help> (F2 shortkey doesn't seem to work). That's exactly
what I was looking for!

It didn't come to mind to open the SaxBasic editor since it's said that
SaxBasic is entirely deprecated since Python was introduced.
>>>Basic is still supported.

But just like SaxBasic can edit object properties, so can Python. Right?
>>>Python can do everything that Basic can do and much more.

Last question (hopefully) for now: in the SPSS installation folder, I
found
no less than 414 .xml files. Which ones did you mean by "via the *xml
*schemas installed with the product." ?
>>>Schemas have the extension xsd.  The output schema is
spss-output-1.8.xsd
for version 21.

If you are used to reading xml schemas, you can take a look at this, but
it is quite complicated.  For most purposes you are better off looking at
the scripting api documentation once you understand the pivot table
constructs.

Note also that there are functions in the spss and spssaux.py module
installed with the Python Essentials that relieve you of the need to work
directly with the xml in many cases.  In particular, spss.EvaluateXPath
and, easier, the spssaux.createXmlOuput and
spssaux.GetValuesFromXmlWorkspace are useful in working with OMS output
written to the xmlworkspace.

The Python (or Basic) scripting apis allow you to get at the Viewer
objects directly rather than with the xml interfaces.  And, of course, the
extension commands I mentioned move to a still higher level.

HTH,
Jon

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Where-can-I-find-the-SPSS-Object-Model-tp5717993p5718001.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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"