Skip to main content

check unique data item

  • October 18, 2017
  • 2 replies
  • 0 views

Hi,

which compiler directive I can use for check if data item is defined only once with the same name ?

es:

01 NOME-PROG PIC X(08) VALUE "IXXR".

01 NOME-PROG PIC X(08) VALUE "IXXR".

and the compiler should give the following error:

COBCH0005S User-name FLS not unique

thank
bye

2 replies

Chris Glazier
Forum|alt.badge.img+2

Hi,

which compiler directive I can use for check if data item is defined only once with the same name ?

es:

01 NOME-PROG PIC X(08) VALUE "IXXR".

01 NOME-PROG PIC X(08) VALUE "IXXR".

and the compiler should give the following error:

COBCH0005S User-name FLS not unique

thank
bye
There is no directive of which I am aware that will flag a duplicate name as this is a perfectly legitimate construct in COBOL.

Where you will receive the error is when you try to reference a data-item that is not unique without qualifying it.
Example, if I add the statement:
display nome-prog

Then the statement will cause the COBCH0005 error that you mention above.

  • October 18, 2017

Hi,

which compiler directive I can use for check if data item is defined only once with the same name ?

es:

01 NOME-PROG PIC X(08) VALUE "IXXR".

01 NOME-PROG PIC X(08) VALUE "IXXR".

and the compiler should give the following error:

COBCH0005S User-name FLS not unique

thank
bye
thanks Chris...

bye