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: Sat May 7 10:35:33 2005

Than one is just fine.  However, the original example (that I replied to)
had an "NOT On Size Error" without an END-ADD.  Having a "NOT" following the
ADD" may cause a problem for the parser, but as far as COBOL syntax goes,
there is a WORLD of difference between  

> 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

and 

 > CALL ...
 >    ON EXCEPTION
 >      ......
 >     ADD id1 TO id2
 >       ON SIZE ERROR
 >    NOT ON EXCEPTION

  ***

All of this does relate to the fact that (for COBOL) you do need to "read
ahead" multiple "tokens".

  NOT ON SIZE 
      versus
  NOT ON EXCEPTION

cannot be "matched" with the same statement.



> -----Original Message-----
> From: Roger While [mailto:address@hidden 
> Sent: Saturday, May 07, 2005 8:35 AM
> To: Bill Klein
> Cc: address@hidden
> Subject: RE: [open-cobol-list] Re: New to compiler
> 
> 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
> 
> Roger
> 
> At 14:59 06.05.2005 -0500, you wrote:
> >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]