bug-gnucobol
[Top][All Lists]
Advanced

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

Re: error: invalid expression on USAGE POINTER item


From: Michael Potter
Subject: Re: error: invalid expression on USAGE POINTER item
Date: Sat, 20 May 2023 23:43:21 -0400

I found another similar case:

                IF  ADDRESS OF  FACE-A  NOT  =
                                MY-PNTR

Is there any timeline when this would be addressed?

I just need to plan how aggressive my work around will be.  Right now
I have a python script modifying the code but it can't find the one
above.

Seems to be constrained to just if statements as usage of this field
in other places compiles fine.  I have not tried to run the code yet.


On Mon, May 15, 2023 at 5:40 PM Michael Potter <pottmi@gmail.com> wrote:
>
> "Um... where is the second compile?"
>
> Look for one above the line of equal signs and the second one below
> the line of equal signs.
>
> These are two different machines.
>
> One has errors on the definition of the variable and the other only
> errors on the IF statement.
>
> "And what version of COBOL are you emulating?"
>
> Whatever the default is for cobc.  I got it down to the simplest example.
>
> Ultimately we are only interested in the IBM mainframe compatibility.
>
>
>
> On Mon, May 15, 2023 at 12:52 PM Simon Sobisch <simonsobisch@web.de> wrote:
> >
> >
> > Am 15.05.2023 um 13:01 schrieb James K. Lowden:
> > > On Mon, 15 May 2023 08:29:13 -0400
> > > Ron Norman <rjn@inglenet.com> wrote:
> > >
> > >> Microfocus Cobol does accept this and works as if C-W is a POINTER.
> > >
> > > Interesting.  ISO doesn't allow it.
> >
> > It explicit does.
> >
> > > What is the MF rule?  That the USAGE of any name, if missing, can be
> > > inferred from the one before it, if at the same level?
> >
> > No, it is inferred from the group (the parent).
> >
> >  From 13.18.60.3 USAGE clause syntax rule 2:
> >
> > -----------------------------------------------------------------------
> > If the USAGE clause is written in the data description entry for a group
> > item, it may also be written in the data description entry for any
> > subordinate elementary item or group item, but the same usage shall be
> > specified in both entries.
> > -----------------------------------------------------------------------
> >
> > and from 13.18.60.4 USAGE clause, general rule 1
> >
> > -----------------------------------------------------------------------
> > If the USAGE clause is specified or implied at a group level, it applies
> > only to each elementary item in the group. Unless the GROUP-USAGE clause
> > is also specified or implied, the USAGE clause applies only to each
> > elementary item in the group and not to the group itself.
> > -----------------------------------------------------------------------
> >
> > Therefore the example:
> >
> >         01  A-W         USAGE POINTER.
> >             03  B-W     USAGE POINTER.
> >             03  C-W.
> >
> > defines an alphanumeric group (is the case for every group which has no
> > explicit GROUP-USAGE NATIONAL/BIT - something that GnuCOBOL doesn't
> > support so far) which contains two variables of USAGE POINTER.
> >
> > > If so, does that hold for the PICTURE, too?
> >
> > No, as only elementary items may contain a PICTURE clause.
> >
> > > --jkl
> >
> > Simon
> >



reply via email to

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