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 (June 2008)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 26 Jun 2008 08:14:37 -0700
Reply-To:     fomcl@yahoo.com
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Albert-jan Roskam <fomcl@yahoo.com>
Subject:      Re: Passing information to Python handler in SPSS 14
Comments: To: Bryan Tec <proglists@gmail.com>
In-Reply-To:  <000001c8d793$52145e10$530011ac@yankelovich.com>
Content-Type: text/plain; charset=us-ascii

Hi,

I am pretty sure that what you're trying to do is not possible: a beginprogram-endprogram block within a define-!enddefine block (or vice versa) is not allowed.

begin program. import spss for i in range(spss.GetVariableCount()): ____print spss.GetVariableName(i) end program.

Cheers, Albert-Jan

--- On Thu, 6/26/08, Bryan Tec <proglists@gmail.com> wrote:

> From: Bryan Tec <proglists@gmail.com> > Subject: Passing information to Python handler in SPSS 14 > To: SPSSX-L@LISTSERV.UGA.EDU > Date: Thursday, June 26, 2008, 3:48 PM > Hello, > > > > I am trying to send a variable list to the python handler > from within a > macro in SPSS 14. Specifically, I am attempting to do > something like this: > > > > DEFINE simplemacro (vars = v1 v2 v3) > > > > BEGIN PROGRAM. > > import spss > > > > varlist = !vars > > > > END PROGRAM. > > > > !ENDDEFINE. > > > > Of course there will be more meat in the middle, but this > is the relevant > task. The Programming and Data Management for SPSS 16 text > suggests > defining and getting a data file attribute using the > spss.GetDataFileAttributes function but when I try this > route, I get an > error that the module is not found. The module is not > listed in the online > help installed with the plugin so I imagine that it is not > included in the > version for SPSS 14. > > > > Is there any other way to achieve this? > > > > Thanks, > > Bryan > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@LISTSERV.UGA.EDU (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

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (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


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