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

Using Command Syntax to Save Output Files

618 views
Skip to first unread message

Roni

unread,
Oct 3, 2006, 4:31:42 PM10/3/06
to
Is there are way, and if so how, to use the syntax file and create a
command that will save the output file?

Bruce Weaver

unread,
Oct 3, 2006, 5:00:47 PM10/3/06
to
Roni wrote:
> Is there are way, and if so how, to use the syntax file and create a
> command that will save the output file?
>

I think you'll need a script to do that. You might find something
useful here:

http://www.spsstools.net/SampleScripts.htm#OutputDoc


--
Bruce Weaver
bwe...@lakeheadu.ca
www.angelfire.com/wv/bwhomedir

Ulli_W

unread,
Oct 4, 2006, 8:51:36 AM10/4/06
to
Roni schrieb:

> Is there are way, and if so how, to use the syntax file and create a
> command that will save the output file?

As far as I know there's no command to do that. Bruce's solution (it is
script 13 or 14 in the OutputDocument paragraph) will surely help you
to save the output in an SPO format.

If you want to continue your work using the results in a datafile you
have to use the OMS...OMSEND command. It converts outputs into SPSS
data file format. It will be a little bit difficult when you use the
command for the first time, but with the help of the command syntax
reference guide you will make your way through.


Regards

Ulli

Ulli_W

unread,
Oct 4, 2006, 8:53:03 AM10/4/06
to
Roni schrieb:

> Is there are way, and if so how, to use the syntax file and create a
> command that will save the output file?

As far as I know there's no command to do that. Bruce's solution (it is

Ulli_W

unread,
Oct 4, 2006, 8:55:05 AM10/4/06
to
Roni schrieb:

> Is there are way, and if so how, to use the syntax file and create a
> command that will save the output file?

As far as I know there's no command to do that. Bruce's solution (it is

King

unread,
Oct 4, 2006, 12:24:06 PM10/4/06
to
It's very easy to use and reliable and I use it all the time. Here's
the whole text that I append to the end of a process. The first line
is the path to the script, the second, in parentheses, is the path and
file name.

SCRIPT file="P:\SPSS\CSS\ROLLUP\SaveClose.sbs"
/("P:\SPSS\CSS\ROLLUP\2006\1Q\RMDS\RMDS.spo") .

After the script runs, a new output window is opened and the named
output file is closed.

You can find SaveClose.sps on Raynald Levesque's site
http://www.spsstools.net/ or I will send it to you off-Group.

I'm learning Python, but haven't discovered or explored a way to do
this with Python, but it ain't broke, so I'm not tryin' to fix it.

Cheers,

King Douglas
Americna Airlines Customer Research

JKPeck

unread,
Oct 5, 2006, 7:56:53 AM10/5/06
to
SPSS 15 has introduced regular syntax for saving and closing output
(spo) files.
>From the syntax help:

OUTPUT NEW, OUTPUT NAME, OUTPUT ACTIVATE, OUTPUT OPEN, OUTPUT SAVE,
OUTPUT CLOSE) provide the ability to programmatically manage one or
many output documents. These functions allow you to:

Save an output document through syntax.
Programmatically partition output into separate output documents (for
example, results for males in one output document and results for
females in a separate one).
Work with multiple open output documents in a given session,
selectively appending new results to the appropriate document.

If you have SPSS 14 with programmability installed, you can manage your
spo files with functions in the viewer module.

Be aware that the solution King Douglas posted works with the important
caveat


"I append to the end of a process."

Because the script command causes the script to run asynchronously, you
cannot reliably use this method to save output at intermediate points
in the execution of the job. It is reliable at the end of your job,
however.

The new syntax and the viewer module approaches do not have that
problem.

HTH,
Jon Peck
SPSS

King

unread,
Oct 5, 2006, 12:13:04 PM10/5/06
to

JKPeck wrote:

>
> Be aware that the solution King Douglas posted works with the important
> caveat
> "I append to the end of a process."
>
> Because the script command causes the script to run asynchronously, you
> cannot reliably use this method to save output at intermediate points
> in the execution of the job. It is reliable at the end of your job,
> however.

However #2. However, I've had no problem running this script to
perform intermediate saves so long as the next SPSS data process take
longer than it takes the script to save the output file, which is not
long at all.

Just be careful.

Too long SPSS versions 13 and older don't have one or more of the old
BASIC commands that could cause the SPSS backend processor to idle
while a script is running, but Python and SPSS 14 and later are, IMHO,
GREAT!

King Douglas

neila...@msn.com

unread,
Nov 21, 2006, 7:39:48 PM11/21/06
to
If the asynchronous/synchronous crap causes you premature balding, then
run the whole mess
from VBA (Excel/Word...etc). IIRC Saving output occurs synchronously
while things like
EXECUTECOMMANDS must be asynchronous because you cannot invoke a script
from syntax
if the script invokes EXECUTECOMMANDS synchronously... It's like the
left hand doesn't know what
the right hand is doing...SPSS designers should have figured out a way
to handle this one years
ago. It seems like the 'new' programability toys are just scripting
designed by someone who had
a clue about what users were wanting to do for yars. I don't see much
which I haven't been able to
do from VB since 1997!
Crying in your beer, Neila
0 new messages