OMS syntax for saving all logs as single .txt file

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

OMS syntax for saving all logs as single .txt file

Ruben Geert van den Berg
Dear all,
 
I'm working on a syntax file that includes some other syntax files. The result is that hundreds of lines of syntax are run in one go. However, since the number of syntax lines is so huge, I have to doubleclick and scroll down the log in the viewer in order to detect error messages. I was wondering whether it could be more efficient if my (single) master syntax would start with an OMS command that asks all log messages to be written as a .txt file in my working directory and ending the master (after all INCLUDE and INSERT FILE commands) syntax with OMSEND. Then all errors and warnings will be saved in a file external to the viewer in which I can use CTRL + F in order to find any error messages or warnings. Also, even after a year I'll be still able to verify that the syntax ran well.
 
Does anyone know what the required OMS command should look like? I tried 'Utilities -> OMS control panel' but the 'paste' button stayed grey :-(
 
Is this a good idea or am I overlooking anything?
 
Lots of thx in advance and a nice, sunny weekend to everyone!
 
Ruben van den Berg


Express yourself instantly with MSN Messenger! MSN Messenger
Reply | Threaded
Open this post in threaded view
|

Re: OMS syntax for saving all logs as single .txt file

Peck, Jon

There are several ways to go about tracking all your syntax and detecting errors.

 

To have OMS capture and save all the logs, start with

oms select logs, e.g.,

/DESTINATION OUTFILE ="c:/temp/mylog.txt" format=text.

and include an OMSEND command at the end.

 

If you have other OMS commands within the syntax, you will need to use the /TAG subcommand to name those requests and use OMSEND TAG=… in order that the outer OMS command continues to be active.

 

If you have journaling on, you already have a file containing the cumulative or job-specific syntax with error messages.

 

If you want to interrupt a job if an error occurs (severity 3 or higher), turn the job into a trivial Python program, which will then raise an exception and stop on error.

It is easy to turn any block of syntax into a program.

 

begin program.

import spss

spss.Submit(r"""

<all your syntax>

""")

end program.

 

And, with v17, you will get the error pane in the syntax editor if any error messages are generated.

 

HTH,

Jon Peck

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Ruben van den Berg
Sent: Friday, May 22, 2009 12:33 AM
To: [hidden email]
Subject: [SPSSX-L] OMS syntax for saving all logs as single .txt file

 

Dear all,
 
I'm working on a syntax file that includes some other syntax files. The result is that hundreds of lines of syntax are run in one go. However, since the number of syntax lines is so huge, I have to doubleclick and scroll down the log in the viewer in order to detect error messages. I was wondering whether it could be more efficient if my (single) master syntax would start with an OMS command that asks all log messages to be written as a .txt file in my working directory and ending the master (after all INCLUDE and INSERT FILE commands) syntax with OMSEND. Then all errors and warnings will be saved in a file external to the viewer in which I can use CTRL + F in order to find any error messages or warnings. Also, even after a year I'll be still able to verify that the syntax ran well.
 
Does anyone know what the required OMS command should look like? I tried 'Utilities -> OMS control panel' but the 'paste' button stayed grey :-(
 
Is this a good idea or am I overlooking anything?
 
Lots of thx in advance and a nice, sunny weekend to everyone!
 
Ruben van den Berg


Express yourself instantly with MSN Messenger! MSN Messenger

Reply | Threaded
Open this post in threaded view
|

Re: OMS syntax for saving all logs as single .txt file

Oliver, Richard
In reply to this post by Ruben Geert van den Berg

oms select logs warnings

  /destination format=text outfile='c:\temp\logswarnings.txt'.

[your insert/include syntax]

omsend.

 

You want logs and warnings because some errors show up in the log and some show up in warnings objects.

 

As Jon Peck notes in his response, the error pane (introduced in version 17) in the syntax editor provides a very useful listing of errors.

 

 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Ruben van den Berg
Sent: Friday, May 22, 2009 1:33 AM
To: [hidden email]
Subject: OMS syntax for saving all logs as single .txt file

 

Dear all,
 
I'm working on a syntax file that includes some other syntax files. The result is that hundreds of lines of syntax are run in one go. However, since the number of syntax lines is so huge, I have to doubleclick and scroll down the log in the viewer in order to detect error messages. I was wondering whether it could be more efficient if my (single) master syntax would start with an OMS command that asks all log messages to be written as a .txt file in my working directory and ending the master (after all INCLUDE and INSERT FILE commands) syntax with OMSEND. Then all errors and warnings will be saved in a file external to the viewer in which I can use CTRL + F in order to find any error messages or warnings. Also, even after a year I'll be still able to verify that the syntax ran well.
 
Does anyone know what the required OMS command should look like? I tried 'Utilities -> OMS control panel' but the 'paste' button stayed grey :-(
 
Is this a good idea or am I overlooking anything?
 
Lots of thx in advance and a nice, sunny weekend to everyone!
 
Ruben van den Berg


Express yourself instantly with MSN Messenger! MSN Messenger

Reply | Threaded
Open this post in threaded view
|

Re: OMS syntax for saving all logs as single .txt file

Marta Garcia-Granero
In reply to this post by Ruben Geert van den Berg
Ruben van den Berg wrote:

> I'm working on a syntax file that includes some other syntax files.
> The result is that hundreds of lines of syntax are run in one go.
> However, since the number of syntax lines is so huge, I have to
> doubleclick and scroll down the log in the viewer in order to detect
> error messages. I was wondering whether it could be more efficient if
> my (single) master syntax would start with an OMS command that asks
> all log messages to be written as a .txt file in my working directory
> and ending the master (after all INCLUDE and INSERT FILE commands)
> syntax with OMSEND. Then all errors and warnings will be saved in a
> file external to the viewer in which I can use CTRL + F in order to
> find any error messages or warnings. Also, even after a year I'll be
> still able to verify that the syntax ran well.
>
> Does anyone know what the required OMS command should look like? I
> tried 'Utilities -> OMS control panel' but the 'paste' button stayed
> grey :-(
Hi Ruben

(Was it to you that I said a few days ago that UTILITIES -> OMS CONTROL
PANEL should always be used? It looks that it is not always necessarily
so...)

The command to capture LOGS has to be built from scratch (I just typed
OMS in the syntax window, clicked on "syntax help", and I got all the
info I needed). For spss dot com people: perhaps future versions should
include this in the OMS Control Panel, I could not find a reference to
LOGS in it.

See if you can modify this simple example to fit:

PRESERVE.
SET PRINTBACK=ON.
OMS
 /SELECT LOGS
 /DESTINATION FORMAT=TEXT
             OUTFILE='C:\TEMP\SYNTAXLOG.TXT'.
FREQUENCIES
  VARIABLES=wright1 wright2 mini1 mini2
  /FORMAT=NOTABLE
  /PERCENTILES= 25 75
  /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN MEDIAN
  /ORDER=  ANALYSIS .
OMSEND.
RESTORE.

The OMSEND is also captured and written to SYNTAXLOG.TXT, but since you
don't want to run the file, but just check that there were no errors or
warnings, I suppose it is OK.

(I bet that there is also a Python way of doing that too...)


> Lots of thx in advance and a nice, sunny weekend to everyone!

Stormy, I'm afraid that's the  weather forecast for my city this weekend :(

HTH,
Marta




--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: OMS syntax for saving all logs as single .txt file

Peck, Jon
See below.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Marta GarcĂ­a-Granero
Sent: Friday, May 22, 2009 7:24 AM
To: [hidden email]
Subject: Re: [SPSSX-L] OMS syntax for saving all logs as single .txt file

Ruben van den Berg wrote:
[>>>Peck, Jon] [snip]
>
> Does anyone know what the required OMS command should look like? I
> tried 'Utilities -> OMS control panel' but the 'paste' button stayed
> grey :-(
Hi Ruben

(Was it to you that I said a few days ago that UTILITIES -> OMS CONTROL
PANEL should always be used? It looks that it is not always necessarily
so...)
[>>>Peck, Jon] The Control Panel shouldn't require a procedure to be selected if you have just selected LOGS in the Types field, but all you have to do is hit ctrl-a to select all the commands in the Command Identifiers table, and fill in the File field, and Add will be enabled.
Regards,
Jon

The command to capture LOGS has to be built from scratch (I just typed
OMS in the syntax window, clicked on "syntax help", and I got all the
info I needed). For spss dot com people: perhaps future versions should
include this in the OMS Control Panel, I could not find a reference to
LOGS in it.

See if you can modify this simple example to fit:

PRESERVE.
SET PRINTBACK=ON.
OMS
 /SELECT LOGS
 /DESTINATION FORMAT=TEXT
             OUTFILE='C:\TEMP\SYNTAXLOG.TXT'.
FREQUENCIES
  VARIABLES=wright1 wright2 mini1 mini2
  /FORMAT=NOTABLE
  /PERCENTILES= 25 75
  /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN MEDIAN
  /ORDER=  ANALYSIS .
OMSEND.
RESTORE.

The OMSEND is also captured and written to SYNTAXLOG.TXT, but since you
don't want to run the file, but just check that there were no errors or
warnings, I suppose it is OK.

(I bet that there is also a Python way of doing that too...)


> Lots of thx in advance and a nice, sunny weekend to everyone!

Stormy, I'm afraid that's the  weather forecast for my city this weekend :(

HTH,
Marta




--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD