Syntax too quick for SPSS

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

Syntax too quick for SPSS

Alex Rasker
Dear List, SPSS

Recently I've encountered a problem in my SPSS-syntax (I was trying to make
it quicker by getting rid of some useless open and save commands). The
resulting syntax basically looks like:

ADD FILES /FILE='C:\MyDocuments\MyTemplate.sav'
 /FILE='C:\MyDocuments\Mydata.sav'.
EXECUTE.

SELECT IF (myvar=1).
EXECUTE.

***1***.

TEMPORARY.
NUMERIC v1.
LEAVE v1.
"Some tables commands"

(I only inserted the EXECUTE's after getting into trouble in the first
place, they do not help)

The problem is that SPSS does not seem to be ready to produce tables by the
time the command is read (despite the EXECUTE after the SELECT command).

An error occurs stating that the table contains no rows/columns/data or
anything.

When I insert an extra SAVE command at ***1*** it solves the problem but
this creates an extra (useless) data-file and it slows the entire process.

My template and data are not exceptionally large files but since I have to
do this many times it is important to make/keep it quick. Does anybody know
why this occurs? Does not EXECUTE mean 'finish outstanding commands-proceed
when READY'? Anybody know of a simple solution?

Thanks, -Alex
Reply | Threaded
Open this post in threaded view
|

Re: Syntax too quick for SPSS

Richard Ristow
At 05:09 PM 8/11/2006, Alex Rasker wrote:

>My syntax basically looks like:
>
>ADD FILES /FILE='C:\MyDocuments\MyTemplate.sav'
>  /FILE='C:\MyDocuments\Mydata.sav'.
>EXECUTE.
>
>SELECT IF (myvar=1).
>EXECUTE.
>
>***1***.
>
>TEMPORARY.
>NUMERIC v1.
>LEAVE v1.
>"Some tables commands"
>
>(I only inserted the EXECUTE's after getting into trouble in the first
>place, they do not help)
>
>When I insert an extra SAVE command at ***1*** it solves the problem
>but this creates an extra (useless) data-file and it slows the entire
>process.

I very much doubt that this has anything to do with timing. As far as I
know, SPSS's synchronizing of data manipulation with procedures is very
robust, and I've never heard of a demonstrated problem.

However, I don't see what it is, either. Can you post sample data, and
the first (only) of your "tables" commands? I say only the first,
because later ones will 'see' the same data.