• 1 reply
  • Latest Post - ‏2012-11-06T15:02:23Z by SystemAdmin
1 Post

Pinned topic Slowing down SPSS syntax

‏2012-11-06T14:30:16Z |
Hi there. I'm running into a bit of an issue in that the SPSS software (data file, output, and syntax windows) crashes when I run a piece of code. When I run the syntax slower (i.e. using the red breakpoints), then it appears to run ok.

I'm wondering if there is a command to slow down the syntax run; or at least a pause command. Between outputs, is there a piece of code that can be written to "pause the processor" for 2 or 3 seconds before running the next command?

Thanks for your help.
  • SystemAdmin
    1106 Posts

    Re: Slowing down SPSS syntax

    It shouldn't be necessary to slow down the syntax, but it is true that in older versions of Statistics, sometimes the Viewer process would fall behind the backend process. The backend is supposed to wait when the frontend work queue is full, but because some things happen asynchronously, there were situations when this did not work right, mainly when using scripting apis and producing large tables.

    If you want to stall the backend and you have installed the Python Essentials, you could insert this code.

    begin program. 
    import time time.sleep(2) end program.

    This waits for 2 seconds. On Windows you could also do the equivalent with Basic scripting.