In message <[log in to unmask]>,
Duane Percox <[log in to unmask]> writes
>Roy, 'its the compiler' Brown, writes:
>> 03548 12 410 S SYNTAX ERROR. FOUND: END-IF;
>> EXPECTING ONE OF THE FOLLOWING: . ELSE END-IF .
>>
>> OK. You got it. So?
>
>How about listing the statement being compiled. Might help us see why
>your version of the compiler is different from my version :-)
I think if you write:
01 BLACK PIC X(8) VALUE "BLACK".
etc....
plus
IF BLACK = WHITE
IF PINK = GRAY
CONTINUE
END-IF
ELSE
CONTINUE
END-IF
END-IF.
you will see the message on the first END-IF, and so see that we do
indeed have the same compiler... :-)
>
>duane
But thanks to everyone who took this light-hearted message seriously; it
turns out there *is* a serious issue underlying this rather odd error
message.
For the record, the line said END-IF on its own, no commas, no
full-stops. And certainly no semicolons; the one you see there is placed
there by the compiler.
So, I put END-IF, and COBOL reports that it *expected* END-IF (or ELSE
or period (.) )
So: it expects END-IF, and I put END-IF, and yet it complains; what's
its beef?
As near as I can tell, its beef is that a complex sentence, with lots of
nested IFs, is unbalanced. And as I can perfectly well be short of
END-IFs, and the final period will take care of it, I guess I must have
one END-IF too many.
And the one it fastens on to report the error on, I conjecture, is the
first one that could possibly be the excess END-IF.
While, in fact, any of the subsequent 20 or 30 could be the offending
one.
So, to get this fixed by you helpful folks, I'd have to post not just
the offending line, but the whole sentence.
Personally, I've checked and rechecked the code, and I can't see an
excess END-IF for the life of me.
And when I commented out the offending one to get the damn thing to
compile on the HP3000, my colleague who ported it to another COBOL
reported that he had to uncomment the 'excess' END-IF to get the code to
work....
Go figure...
--
Roy Brown 'Have nothing in your houses that you do not know to be
Kelmscott Ltd useful, or believe to be beautiful' William Morris
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|