Dear friends of list
Do you know a syntax that saves a OUTPUT file (*.spo)? Thanks for all responses.... Carlos Renato Statistician Recife - PE - Brazil |
Hi Carlos,
You can only save output in syntax in V15. However Chris Gratham did write this script if it any help "You can use a script to do this. Make a new script file in SPSS and paste in the following: Sub Main Dim Name As String Dim objOutput As ISpssOutputDoc Name = objSpssApp.ScriptParameter(0) Set objOutput = objSpssApp.GetDesignatedOutputDoc objOutput.SaveAs(Name) End Sub Save this and you can call it from syntax. If, for example, you save the file to your C:\ drive root as 'saveoutput.sbs' it can be run in syntax with the line: SCRIPT file="C:\saveoutput.sbs" ("C:\name_of_output_file.spo") . I hope this helps. There are many more examples of how to do this in slightly different ways (for example, saving and closing the active output window then opening a new one) available on te internet and in the archives of this list. Chris" HtH Mike -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Carlos Renato Sent: 16 November 2006 12:27 To: [hidden email] Subject: SAVING OUTPUT (*.spo) Dear friends of list Do you know a syntax that saves a OUTPUT file (*.spo)? Thanks for all responses.... Carlos Renato Statistician Recife - PE - Brazil ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ |
In reply to this post by Carlos Renato-2
SPSS 15 has new commands for manipulating the output window: OUTPUT ACTIVATE, OUTPUT CLOSE, OUTPUT OPEN, and OUTPUT SAVE.
In earlier versions, the only way to do this explicitly is via scripting automation. With SPSS 14 and the Python programmability plug-in, you can do this very simply with the viewer module. Otherwise you would need Saxbasic, but there are some tricky synchronization issues with that approach. Production mode also lets you save the output file, but, of course, this is for the whole job. HTH, Jon Peck SPSS -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Carlos Renato Sent: Thursday, November 16, 2006 6:27 AM To: [hidden email] Subject: [SPSSX-L] SAVING OUTPUT (*.spo) Dear friends of list Do you know a syntax that saves a OUTPUT file (*.spo)? Thanks for all responses.... Carlos Renato Statistician Recife - PE - Brazil |
In reply to this post by Mike P-5
Here's the problem with this method: if there is syntax following the SCRIPT command, the contents of the saved document will not generally correspond to the output that was present at the time the SCRIPT command occurred. The script runs asynchronously at the convenience of the SPSS front end, and it is likely that output generated after the SCRIPT command will be in the file you save.
This may not be a problem, but the viewer module approach I mentioned in an earlier message synchronizes the save in a way that this script cannot. HTH, Jon Peck -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Michael Pearmain Sent: Thursday, November 16, 2006 6:37 AM To: [hidden email] Subject: Re: [SPSSX-L] SAVING OUTPUT (*.spo) Hi Carlos, You can only save output in syntax in V15. However Chris Gratham did write this script if it any help "You can use a script to do this. Make a new script file in SPSS and paste in the following: Sub Main Dim Name As String Dim objOutput As ISpssOutputDoc Name = objSpssApp.ScriptParameter(0) Set objOutput = objSpssApp.GetDesignatedOutputDoc objOutput.SaveAs(Name) End Sub Save this and you can call it from syntax. If, for example, you save the file to your C:\ drive root as 'saveoutput.sbs' it can be run in syntax with the line: SCRIPT file="C:\saveoutput.sbs" ("C:\name_of_output_file.spo") . I hope this helps. There are many more examples of how to do this in slightly different ways (for example, saving and closing the active output window then opening a new one) available on te internet and in the archives of this list. Chris" HtH Mike -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Carlos Renato Sent: 16 November 2006 12:27 To: [hidden email] Subject: SAVING OUTPUT (*.spo) Dear friends of list Do you know a syntax that saves a OUTPUT file (*.spo)? Thanks for all responses.... Carlos Renato Statistician Recife - PE - Brazil ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ |
In reply to this post by Carlos Renato-2
Hi all,
Just reading the discussion about opening & saving Output Windows while trying to do something similar with a Syntax window. Are there syntax commands to open, activate, close & save syntax windows? A brief run through Help didn't turn up anything. Is Python the answer? Victor Kogler |
Hello Victor,
You will want to use the SPSS OLE Automation Objects found by launching the scripts window and Help ... Objects. The are indeed also available through Python, but not raw syntax. For instance, the two methods that follow are in the Help you will find there. "Use the NewSyntaxDoc or OpenSyntaxDoc method on the SPSS Application object to open a syntax document." That should get you started. Good luck! Best, Keith www.keithmccormick.com On 11/16/06, Victor Kogler <[hidden email]> wrote: > Hi all, > > Just reading the discussion about opening & saving Output Windows while > trying to do something similar with a Syntax window. > > Are there syntax commands to open, activate, close & save syntax > windows? A brief run through Help didn't turn up anything. Is Python > the answer? > > Victor Kogler > |
Free forum by Nabble | Edit this page |