gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [open-cobol-list] Re: New to compiler


From: Bill Klein
Subject: RE: [open-cobol-list] Re: New to compiler
Date: Fri May 6 13:01:53 2005

Sorry for the late reply.  See below 

> -----Original Message-----
<snip> 
> I came across a program in the cobol85 tests that would not
> compile which also has a "NOT" problem. Consider -
> CALL ...
>    ON EXCEPTION
>      ......
>     ADD id1 TO id2
>       ON SIZE ERROR
>    NOT ON EXCEPTION
>     .....
> [END-CALL]
> 

That is NOT conforming '85 Standard code.  Are you certain that is what the
test have?

The ADD is a "conditional" format of the ADD statement which may NOT be
nested in the ON EXCEPTION phrase of the CALL statement.  If there were an
"END-ADD" then it would be OK.

The "normal" problem (and possibly what the original post was getting at) is
when two statements have the same conditional type phrase, e.g.

If A > B
  Add +1 to whatever
    On Size Error
        Compute This = That + 1
      Not On Size Error
         Display "Where does this go?"
     *> what goes here?
Else ...


If the next source line after the display is an "END-COMPUTE" followed (I
think) by an END-ADD, then all is "ok". However, to get the NOT ON SIZE
ERROR to "match" with the ADD rather than the COMPUTE, and END-COMPUTE
*must* be coded. 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]