LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2007)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 11 May 2007 08:05:46 -0500
Reply-To:     "Peck, Jon" <peck@spss.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Peck, Jon" <peck@spss.com>
Subject:      Re: Include of Syntax file in Python program
Comments: To: Georg.Maubach@dpwnbc.net
In-Reply-To:  A<4131915968A0FE4CB324EB6D883F5F129A072A@exbn01.DPEB.DE>
Content-Type: text/plain; charset="UTF-8"

Presumably the dataset has already been opened in the Python code. Then you can just submit an INSERT command to apply your syntax. (INCLUDE is obsolete but would probably work here, too.)

That is, you would do spss.Submit("INSERT 'filespec'")

or, you could read the syntax file into your Python program and submit it that way.

cmds = file("c:/temp/somesyntax.sps").readlines()

spss.Submit(cmds)

If you were going to make substitutions in the syntax stream differently for different datasets, the second approach would make more sense.

HTH, Jon Peck

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Georg Maubach Sent: Friday, May 11, 2007 5:47 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: [SPSSX-L] Include of Syntax file in Python program

Hi All,

We have written a syntax program that need to be run on a hole bunch of datasets. Which datasets to use shall be determined with Python (script is already done) from the datasets that can be found in a given directory. Then the complete syntax program shall be run on these datasets successively. Is there a function like INCLUDE in Python that makes it possible to run a syntax on a given set of datasets or do we need to include the hole syntax program in a command like

Spss.submit( """ Complete syntax program """) ?

Best regards

Georg Maubach Market Analyst Deutsche Post World Net Business Consulting GmbH Market Research Service Center


Back to: Top of message | Previous page | Main SPSSX-L page