[Top][All Lists]

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

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

From: Roger While
Subject: RE: [open-cobol-list] Re: New to compiler
Date: Sat May 7 06:36:11 2005

Hi Bill,
This is from Cobol85 test IC222A.CBL :

056200     CALL   "IC222A-1" USING DN1, DN2, DN3, DN4
056300             ON EXCEPTION
056400                  MOVE "F" TO EXCEPTION-PATH-FLAG
056500                  ADD 2 TO CALL-FLAG
056600             NOT ON EXCEPTION
056700                  MOVE "P" TO EXCEPTION-PATH-FLAG
056800                  ADD 2 TO CALL-FLAG
056900     END-CALL


At 14:59 06.05.2005 -0500, you wrote:
Sorry for the late reply.  See below

> -----Original Message-----
> I came across a program in the cobol85 tests that would not
> compile which also has a "NOT" problem. Consider -
> CALL ...
>      ......
>     ADD id1 TO id2
>     .....

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]