How to migrate SaxBasic to Python?

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

How to migrate SaxBasic to Python?

sergio_da_silva
My client wants me to migrate some SaxBasic scripts to Python. I found out that "SPSS Programming and Data Management 3rd Edition.pdf" (version 14) by Raynald Levesque explicitly discusses this topic -which is very helpful. However, my client is on version 20 and this book for version 20 doesn't mention SaxBasic even a single time.

After a bit of research, I found that the discussion on migrating SaxBasic to Python is still present in this book for version 15 and suddenly disappeared in version 17 and onwards. I wonder why that is since I reckon the material for version 15 can't possibly be up-to-date anymore. Right?

(I'm not sure about version 16 since I couldn't find it anymore. All "direct links to the book" redirect to IBM.com.)

So now my question is: are there any more up-to-date learning resources than the version 15 edition of Raynald's book for migrating SaxBasic to Python? Again, my client is on version 20.
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate SaxBasic to Python?

Jon K Peck
As far as migration goes, the old material would still be applicable, but you should consider Unicode and locale issues with version 16 or later.   And the old IGraph and Map SaxBasic apis are gone because those features were removed from the product itself.  (IGraph syntax still works but is executed by the visualization engine, and the new mapping features are completely different from the old MapInfo-based option.)

Depending on what the SaxBasic scripts were doing, consider using the programmability apis in Python rather than the scripting apis.  The original mission for SaxBasic was primarily frontend activities such as manipulating the Viewer, and backend/syntax related activities are better done with the programmability apis.  Python programmability runs in the backend context, while Python scripting runs in the frontend context.

The point I am trying to make is that just mapping the Basic apis to the Python scripting apis, which are quite similar in structure, may not be the best approach.  Consider the expanded universe of Python programmability plus Python scripting.

And before Marso kicks in with snide comments, support for Basic is not going away.  Old Basic/SaxBasic code does not have to be replaced in fear of losing the ability to run it.

HTH,

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/09/2013 02:39 AM
Subject:        [SPSSX-L] How to migrate SaxBasic to Python?
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




My client wants me to migrate some SaxBasic scripts to Python. I found out
that "SPSS Programming and Data Management 3rd Edition.pdf" (version 14) by
Raynald Levesque explicitly discusses this topic -which is very helpful.
However, my client is on version 20 and this book for version 20 doesn't
mention SaxBasic even a single time.

After a bit of research, I found that the discussion on migrating SaxBasic
to Python is still present in this book for version 15 and suddenly
disappeared in version 17 and onwards. *I wonder why that is* since I reckon
the material for version 15 can't possibly be up-to-date anymore. Right?

(I'm not sure about version 16 since I couldn't find it anymore. All "direct
links to the book" redirect to IBM.com.)

So now my question is: are there any more up-to-date learning resources than
the version 15 edition of Raynald's book for migrating SaxBasic to Python?
Again, my client is on version 20.



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/How-to-migrate-SaxBasic-to-Python-tp5718013.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: How to migrate SaxBasic to Python?

sergio_da_silva
Thank you Jon!

"Old Basic/SaxBasic code does not have to be replaced in fear of losing the ability to run it. "
>>> Please excuse me but my experiences are a bit different. Some .SBS scripts seem to run in old versions and do not run anymore in new versions. I'll see if I can find a concrete example if you like.

"Depending on what the SaxBasic scripts were doing..."
>>> The challenge is limited to manipulating the viewer. I've already done a vast amount of data editing with Python (mostly by generating dynamic syntax via the spss.Submit method). Which, by the way, works amazingly well and is a huge relief after working with the clumsy "DEFINE" macro language for some years.

"the old material would still be applicable..."
>>> Great, I'll start working on it.
Reply | Threaded
Open this post in threaded view
|

Re: How to migrate SaxBasic to Python?

Jon K Peck
If you can send me a script that no longer works, I will take a look at it.


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/11/2013 01:44 AM
Subject:        Re: [SPSSX-L] How to migrate SaxBasic to Python?
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Thank you Jon!

"Old Basic/SaxBasic code does not have to be replaced in fear of losing the
ability to run it. "
>>> Please excuse me but my experiences are a bit different. Some .SBS
>>> scripts seem to run in old versions and do not run anymore in new
>>> versions. I'll see if I can find a concrete example if you like.

"Depending on what the SaxBasic scripts were doing..."
>>> *The challenge is limited to manipulating the viewer*. I've already done
>>> a vast amount of data editing with Python (mostly by generating dynamic
>>> syntax via the spss.Submit method). Which, by the way, works amazingly
>>> well and is a huge relief after working with the clumsy "DEFINE" macro
>>> language for some years.

"the old material would still be applicable..."
>>> Great, I'll start working on it.



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/How-to-migrate-SaxBasic-to-Python-tp5718013p5718022.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
|

Automatic reply: How to migrate SaxBasic to Python?

TheisenM@adea.org


I am currently out of the office and will return Tuesday, February 12.  I will have limited access to email and will get back to you as soon as possible. 

Thank you,
McKayla