TypeCobol icon indicating copy to clipboard operation
TypeCobol copied to clipboard

VALUE clause cannot be specified in conjunction with REDEFINES and for an item having a parent with a VALUE clause

Open efr15 opened this issue 9 months ago • 0 comments

Describe the bug VALUE clause cannot be specified for:

  1. A REDEFINES item or an item having a parent which is a REDEFINES.
  2. An item having a parent with a VALUE clause.

To Reproduce (Type)Cobol code that cause the bug :

       01 group0.
          05 group1.
             10 var1 PIC X VALUE 'Y'.
      *      Error1: item is a REDEFINES
             10 var-redef REDEFINES var1 PIC X VALUE 'O'.
          05 group2 REDEFINES group1.
      *      Error1: item's parent is a REDEFINES
             10 var2 PIC X VALUE 'N'.
          05 group3 VALUE 'P'.
             10 group31.
      *      Error2: item has a parent with a VALUE clause
                15 var3 PIC X VALUE 'I'.

Expected behavior Message from IBM for error1: A"VALUE"clause was specified for an item that contained, or was subordinate to an item that contained, a"REDEFINES"clause. The"VALUE"clause was discarded. Message from IBM for error2: A"VALUE"clause was previously specified for a group containing this item. The"VALUE"clause was discarded for this item.

Technical Should be done in CrossChecker

How to test automatically Standard unit tests.

efr15 avatar May 10 '24 09:05 efr15