SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  stubborn open files and other issues

    Posted Fri December 18, 2020 06:01 PM

    Hi,

     

    I have 3 somewhat related issues where I would like some help:

     

    1. Occasionally I run into the problem of files that remain "open", even though I am not acting on the file, and nothing is executing. I see the "IBM SPSS Statistics Processor is ready"  message on the bottom right hand side of the screen. But when I run syntax that would overwrite the file, the system tells me the file is being used, and then writes the new file as [filename]_1. I use DATASET CLOSE ALL, and also try (unsuccessfully) to manually delete the file in Windows Explorer, but it tells me the same, that the file is in use and cannot be deleted. The only way to release the file, is to close down SPSS, and start over again.  Is there a different command I could use to close up all open files?
    2. I create and run mostly macros created using define - !enddefine. Also occasionally, as with #1, after the macro starts executing, I realize there is a mistake, and I try to interrupt the processor... The system pretty much ignores Ctrl+., and accessing the File -> Stop Processor menu option is nearly impossible as it keeps getting removed from the screen, or the menu is totally unresponsive.
    3. Related to the 2 issues above, the macros include OMS and OMSEND commands. If I happen to succeed at interrupting the processor, and the interruption happens to take place in between the OMS and the OMSEND command, the system still thinks the OMS command is still open, and if I run the macro again it tells me I cannot use the OMS tag because it is already in use...

     

    Any help with these issues would be greatly appreciated.

    Thank you!

     

    E.

     

     



    This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.


    Thank you for your compliance.



    #SPSSStatistics


  • 2.  RE: stubborn open files and other issues

    Posted Sat December 19, 2020 10:33 AM
    Re point 1:
    DATASET CLOSE ALL just disconnects the dataset name from files.  However, a data file without a dataset name remains open until some other file becomes the active data file.  (This is because a data file does not have to have a dataset name.)  So you may have better luck if you active another file.  It does happen sometimes that Statistics thinks a file is in use when it should have been closed, so this might not always work/

    Re pont 2:
    ctrl + . should stop the processor as long as it is passing cases.  It's exactly the same as using the Stop Processor menu item.  However, the stop processor check only works when cases are being passed.  It should stop further commands from executing, at least if running interactively.

    If you are using the INSERT command, you can set ERROR=STOP to cause command processing to stop on error.

    Re point 3:
    OMS is designed to keep listening for selected objects until OMSEND is executed for the corresponding OMS command.  So errors do not affect its state.  You can, though, just issue an OMSEND to terminate an open OMS command.

    --





  • 3.  RE: stubborn open files and other issues

    Posted Sat December 19, 2020 11:18 AM

    Thank you John, for taking the time to respond.

     

    Re point #1:

    I forgot to mention that I also try NEW FILE and still the offending file remains "in use". But anyway, thanks for your suggestions on this issue.

     

    Re point #2:

    Unfortunately I have tried the ctrl + . persistently and the program keeps on going stubbornly, sometimes I can see the case count increasing in the millions when the data file only has a few thousand cases. Not quite sure what is it that it is counting.

    I use INCLUDE the macros, rather than INSERT them, and from what I read in the manual ERROR=STOP is how INCLUDE works, but nothing gets executed form the included file. The file I include has as a first line DEFINE !macro(...) and a last line !ENDDEFINE. After the INCLUDE command, the next line is !macro with the corresponding parameters.

     

    Re point #3

    Makes sense. Thank you. I was hoping there was a way to "kill" the OMSEND command since I am creating a very long output and when I then try OMSEND, it goes off to write the output I already know is not correct and this takes a while. Maybe I need a bit more patience, or get it right the first time...

     

    Thanks again!

     

    E.

     

     



    This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.


    Thank you for your compliance.







  • 4.  RE: stubborn open files and other issues

    Posted Sat December 19, 2020 12:38 PM
    I don't see any documentation that INCLUDE is supposed to stop on error under INCLUDE in the CSR, although under INSERT it says that INCLUDE is supposed to stop on the first error..  I would recommend switching to INSERT anyway as INCLUDE is obsolete.
    If you can provide details on any place where ctrl+. does not stop case processing, please report as a bug using Help > Report an Issue.  I think ctrl+. should be considered an error in this behavior.

    I don't think using a macro would affect ctrl+. processing, because macro syntax is fully expanded before any of it is run.  It might be that the Python spss.Submit api might work here.  Errors of severity 3 or higher are supposed to trigger a Python exception, giving you control over what to do.

    I guess for OMS, you would need an OMSKILL command or similar option on OMSEND.  I'm surprised that OMS termination would ever take enough time to matter.



    --