Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exit SPSS through syntax

314 views
Skip to first unread message

Theo Chakkapark

unread,
Mar 22, 2007, 10:23:22 PM3/22/07
to
Is there a command that I can insert into an SPS file that will allow
me to exit the program completely?

Haris

unread,
Mar 23, 2007, 1:04:15 PM3/23/07
to
I am not aware of such a command, but I think SPSS Production Facility
is intended for this purpose--you write your syntax files and then
submit them for execution via the Production Facility, which opens and
closes SPSS.

Theo Chakkapark

unread,
Mar 23, 2007, 5:51:35 PM3/23/07
to

Thanks. It seems after much research, this is the only way to really
do it. Using runsyntax in batch will just open multiple instances of
SPSS, eventually resulting in lack of computer resources to continue
operation.

I really wish though that we could specify parameters in the SPS files
so we can just have one 'template' SPS and use production facility to
replace variables with common data; instead, the same SPS file needs
to be created for each sample.

Oh well, can't expect a perfect world. :)

JKPeck

unread,
Mar 24, 2007, 10:10:16 AM3/24/07
to

The Production Facility allows you to define a macro that can be used
in the syntax to parameterize it. When you use this, you get prompted
for the macro value when you start the job.

HTH,
Jon Peck

ViAnn Beadle

unread,
Mar 24, 2007, 10:59:12 AM3/24/07
to
On 23 Mar 2007 14:51:35 -0700, "Theo Chakkapark" <ranm...@gmail.com>
wrote:

You can, using production mode, specify a substitution parameter which
is specified at run time. The UI calls this a user prompt. Not perfect
but closer to perfect.

Neila

unread,
Apr 3, 2007, 1:05:59 AM4/3/07
to
>Oh well, can't expect a perfect world. :)
Why not? What are you really trying to do?
Why not use a small sps which is part of production job which in
turn runs a set of macro invocations. If this makes sense then
do it, if not my hourly rates are reasonable!
Neila

Mike P

unread,
Apr 3, 2007, 6:15:01 AM4/3/07
to
Could you not use the programmability add on now, to call SPSS without
'opening it up' so to speak and then export tables / logs etc from
whatever interface your using? bit of a long winded way to do it, but
potentially an alternative

Mike

JKPeck

unread,
Apr 3, 2007, 1:33:03 PM4/3/07
to

To expand on what Mike said a bit, starting with SPSS 14.0.1, you have
the ability to invoke SPSS with no user interface and feed it commands
and data if you have either the Python plug-in (and Python) installed
or the .NET plugin. In this mode, you do not get SPO file output,
but you use OMS to produce output as html, plain text, xml, ... With
html output, you can get graphic images as well.

If you just want to run the same syntax job you would use in the
normal mode but using this externally driven mode, it is very simple
to wrap the entire block of syntax into your programmability setup
without change, or you can use an INSERT command.

So with this mode, you can then create a bat file or equivalent and
even schedule it with the Windows scheduler.

HTH,
Jon Peck

Theo Chakkapark

unread,
Apr 3, 2007, 9:08:13 PM4/3/07
to

I resolved this issue my own way. We have over 500 samples that need
to be processed from the same syntax.

1. I created a 'template' syntax file where non-static variables were
marked with an identifier such as %id or %group.

2. Then, I used the SPSS ODBC driver to access our SPSS .sav via PHP
and SQL.

3. In my PHP script, I have a while loop that access each row of
the .sav file, and replaces the values in the template syntax (ie %id
is now the value of 'id' in the database depending on the row values);
this syntax is saved as a file, id_group#.sps

4. SPSS Production Facility has an 'issue' where you have to manually
add one syntax file at a time. Adding 500 syntax files would be a
pain; however, I found a way around this. Since the facility file
(.spp) is a plain text file, opening it up reveals a portion that goes
like this:

INSERT FILE='<path to syntax>' SYNTAX=BATCH ERROR=CONTINUE.

At the end of my PHP script, I generated the "INSERT FILE..." lines
into a separate file and pasted the resulting 500 lines into my
production file and saved it.

5. Ran SPSS Production Facility and opened the production file without
a hitch!

I guess my method is the "quick and dirty way".

Neila

unread,
Apr 4, 2007, 2:08:37 PM4/4/07
to
Congratulations, You have just reinvented MACROS.
Rube Goldberg award forthcoming.
Just need your address and bank information... ;-)
Neila

> I guess my method is the "quick and dirty way".- Hide quoted text -
>
> - Show quoted text -


0 new messages