A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/TypeCobolTeam/TypeCobol/wiki/TypeCobolNameQualification below:

TypeCobolNameQualification · TypeCobolTeam/TypeCobol Wiki · GitHub

<GROUP> :: <ELEMENTARY ITEM>

‘A name can be made unique if it exists within a hierarchy of names, and the name can be identified by specifying one or more higher-level names in the hierarchy. The higher-level names are called qualifiers, and the process by which such names are made unique is called qualification.’ COBOL Language Reference

In COBOL syntax, this qualification is done by using one or more phrases with IN or OF followed by a qualifier.

It is only necessary to specify enough qualification to make the name unique.

Difficulties with IN or OF operators :

TypeCobol proposes an alternative method to fully qualify data items when they are used. A new operator will be added for qualification of an element in a group.

Instead of saying ‘A of B’ or ‘A in B’ we will use a new syntax based on ‘::’ operator ‘B::A’

TYPECOBOL to COBOL translation

The following sentence:

will be translated as:

01 GR1.
   02 GR11.
      05 ELT11   PIC X.

01 GR2.
   02 GR21.
      05 ELT11   PIC X.
01  GRX          PIC X(100).
MOVE GR1::GR11::ELT11   TO GRX
MOVE GR2::GR21::ELT11   TO GRX

In COBOL providing the complete hierarchical path is not mandatory. It is only needed to give minimal group names to avoid any ambiguity on elementary items. TypeCobol respect the same logic.

In Cobol language for a multi-dimensional table, all subscripts are specified after the elementary item. Operator :: use the same logic.

Examples

01 A.
    02 B OCCURS 10.
      03 C.
        04 D1 PIC X(10).
        04 D2 PIC X(10) OCCURS 10.

To address a D2 item we could use one of the following syntax:

D2 OF C OF B OF A (x y)
A::B::C::D2(x y)
01 GR1.
   02 GR11.
      05 ELT11   PIC X.
   02 GR12.
      05 ELT11   PIC X.
   02 GR13.
      05 ELT12   PIC X.
01 GR2.
   02 GR21.
      05 ELT11   PIC X.
   02 GR22.
      05 ELT21   PIC X.
01  GRX          PIC X(100).

(1)

COBOL Z/os Error message:

IGYPS0037-S "ELT11" was not a uniquely defined name. The definition to be used could not be determined from the context. The reference to the name was discarded.

(2)

MOVE ELT11 OF GR11          TO GRX

(3)

COBOL Z/os Error message:

IGYPS0037-S "ELT11 OF GR1" was not a uniquely defined name. The definition to be used could not be determined from the context. The reference to the name was discarded.

(4)

MOVE ELT11 OF GR11 OF GR1   TO GRX

(5)

(6)

MOVE ELT11 OF GR21          TO GRX

(7)

MOVE ELT21 OF GR22 OF GR2   TO GRX

(8)

MOVE ELT21 OF GR22          TO GRX

(9)

(10)

(1): ELT11 is an elementary item of groups GR11, GR12 and GR21. Then indicate ELT11 doesn’t allow to distinguish which ELT11 is to be moved.

(2): With the detail GR11 we have identified ELT11 among all the descriptions.

(3): With the detail of the group GR1 we still have two possibilities : GR11 and GR12.

(4): In this form we specify all hierarchy details; it is not mandatory (as we see in (2)) but valid.

(5), (6): With indication of sub-group or group, our item ELT11 is uniquely defined.

(7), (8), (9), (10): As ELT21 is only declared once, we can use it with all the hierarchy, part of it, or only the elementary item.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4