=========================================================================
Date: Wed, 26 Jul 2006 18:49:22 -0300
Reply-To: Hector Maletta <hmaletta@fibertel.com.ar>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Hector Maletta <hmaletta@fibertel.com.ar>
Subject: Re: SPSS Macro error
In-Reply-To: <E0428445172CB7469BF187FF4D005149036772BE@CHIEMAIL1.spss.com>
Content-Type: text/plain; charset="us-ascii"
Of course, Richard. The Olympic gods forbid that I imply any criticism of
your advice, which was perfectly valid. Anyway, especially in the case of
long commands (e.g. an AGGREGATE creating a hundred or so new variables) an
error message at the end for a mistake made at the 14th line is cryptic
enough (if the line number if not mentioned) to be of little use. In one
occasion I recall now, I had to scroll down the syntax for about a hundred
lines, looking at every line for "column 25" or whatever it was, in search
of an error which was, moreover, very obscurely described to begin with.
Cheers.
Hector
-----Mensaje original-----
De: Oliver, Richard [mailto:roliver@spss.com]
Enviado el: Wednesday, July 26, 2006 6:42 PM
Para: Hector Maletta; SPSSX-L@LISTSERV.UGA.EDU
Asunto: RE: SPSS Macro error
I didn't mean to imply that there's no room for improvement in error
messages. I meant that, IMHO, if the error messages need further
explanation, then the best place to put that further explanation is in the
text of the error messages. To put it another way: The best way to deal with
a cryptic error message is to make it less cryptic.
And while it's true that error messages won't necessarily appear on the line
immediately after the line that contains the cause of the error, they will
usually appear immediately after the command that contains the line that
caused the error. In a "long succession of commands", error messages should
still normally appear immediately after the command that caused the error.
But there are undoubtedly exceptions.
There is, of course, always room for improvement, and you have perfectly
valid criticisms. I'm just trying to offer some tips for working within the
constraints of how the system works today.
-----Original Message-----
From: Hector Maletta [mailto:hmaletta@fibertel.com.ar]
Sent: Wednesday, July 26, 2006 4:20 PM
To: Oliver, Richard; SPSSX-L@LISTSERV.UGA.EDU
Subject: RE: SPSS Macro error
I have SET PRINTBACK ON always on, too. But no, error messages may appear
not immediately after the offending line, especially when running a long
command or a long succession of commands. It is as if some additional syntax
lines get printed on the output page before the software manages to print
the error message. And no, error messages are often cryptic. A list of error
messages with their detailed explanation and possible remedies would be very
handy. Underline VERY.
Hector
-----Mensaje original-----
De: Oliver, Richard [mailto:roliver@spss.com] Enviado el: Wednesday, July
26, 2006 6:13 PM
Para: Hector Maletta; SPSSX-L@LISTSERV.UGA.EDU
Asunto: RE: SPSS Macro error
Personally, I always use SET PRINTBACK ON -- and MPRINT ON if I'm debugging
macros or Python program blocks.
When commands are echoed to the log (with PRINTBACK ON), then error messages
usually appear in the log right after the offending command. So, that often
eliminates the need to figure out which line the error occurred on.
If there's some better explanation of the error messages than the error
messages themselves, I'm not aware of it -- and if better explanations did
exist, I would think the best place to put them would be right in the error
messages.
MPRINT ON will display the syntax generated by macro expansion and by
program blocks (Begin-End Program) that build command syntax using Python.
-----Original Message-----
From: Hector Maletta [mailto:hmaletta@fibertel.com.ar]
Sent: Wednesday, July 26, 2006 4:01 PM
To: Oliver, Richard; SPSSX-L@LISTSERV.UGA.EDU
Subject: RE: SPSS Macro error
Richard,
Would that setting (SET PRINTBACK ON MPRINT ON) clarify error ordinary
messages as the one posted by Joseph, outside of debugging macros? I often
find incomprehensible error messages not referring to any line or column at
all, or mentioning the column but not the line. This is, IMHO, one the most
annoying things I ever encounter while using SPSS. If only line and column
were mentioned one may find one's way using the status bar, but otherwise
the message is Ancient Greek (or Egyptian) to me.
I also vaguely remember someone saying on this list that a list of error
numbers with the corresponding explanations existed somewhere, but I cannot
remember where. Could it not be made more accessible? Perhaps in a
context-sensitive right-click menu? I would love right-clicking on an error
message in the output window, causing a menu to drop down, then choosing
something like 'Look up error' and finding a clear explanation of the error
(plus possible suggestions for fixing it). A less ambitious option might be
a de-contextualized Utilities menu option for looking up a list of error
numbers and their explanations.
Hope never dies, but takes a beating every day...
Hector
-----Mensaje original-----
De: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] En nombre de
Oliver, Richard Enviado el: Wednesday, July 26, 2006 3:27 PM
Para: SPSSX-L@LISTSERV.UGA.EDU
Asunto: Re: SPSS Macro error
"column 25" is a position within a line. If you increase the width of the
syntax window, in the lower right portion of the status bar, you'll see both
line and column numbers displayed, indicating the current cursor location.
When debugging macros use
SET PRINTBACK ON MPRINT ON.
to display the generated code in the output window. That will often make
error messages easier to interpret.
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Joseph Hoffman
Sent: Wednesday, July 26, 2006 9:25 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: SPSS Macro error
Dear SPSS Listers:
I am trying to write my first SPSS macro with v. 13.0 for Windows. I got
the following error message:
>Error # 6839 in column 25. Text: (
>In a macro expression, a left parenthesis immediately follows an operand.
>This command not executed.
Where do I look for "column 25"? The message doesn't reference line
numbers, like usual error messages.
Thanks for any help!
Sincerely,
Joe Hoffman
======================================
Joseph H Hoffman
Data Analyst
Research Institute on Addictions
State University of New York at Buffalo
1021 Main Street
Buffalo NY 14203
phone 716-887-2219
FAX 716-887-2510
e-mail hoffman@ria.buffalo.edu