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: Simon Sobisch
Subject: Re: error: invalid expression on USAGE POINTER item
Date: Mon, 15 May 2023 18:51:36 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1


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]