01 TEST-COMP3-GROUP COMP-3. 05 ELEMENT1 PIC S9(6)V999. 05 ELEMENT2 PIC S9(6)V999. 05 ELEMENT3 PIC S9(6)V999. 05 ELEMENT4 PIC S9(6)V999.
should parse equivalent to:
01 TEST-COMP3-GROUP. 05 ELEMENT1 PIC S9(6)V999 COMP-3. 05 ELEMENT2 PIC S9(6)V999 COMP-3. 05 ELEMENT3 PIC S9(6)V999 COMP-3. 05 ELEMENT4 PIC S9(6)V999 COMP-3.
However, first block parses as:
Attribute( name='TEST-COMP3-GROUP', position=0, offset=0, size=40, dimensionality=() )
Attribute( name='ELEMENT1', position=1, offset=0, size=9, dimensionality=() )
Attribute( name='ELEMENT2', position=2, offset=9, size=9, dimensionality=() )
Attribute( name='ELEMENT3', position=3, offset=18, size=9, dimensionality=() )
Attribute( name='ELEMENT4', position=4, offset=27, size=9, dimensionality=() )
vs
Attribute( name='TEST-COMP3-GROUP', position=0, offset=0, size=20, dimensionality=() )
Attribute( name='ELEMENT1', position=1, offset=0, size=5, dimensionality=() )
Attribute( name='ELEMENT2', position=2, offset=5, size=5, dimensionality=() )
Attribute( name='ELEMENT3', position=3, offset=10, size=5, dimensionality=() )
Attribute( name='ELEMENT4', position=4, offset=15, size=5, dimensionality=() )
Interesting. https://www.ibm.com/support/knowledgecenter/en/SS6SG3_4.2.0/com.ibm.entcobol.doc_4.2/PGandLR/ref/rldadgrp.htm
"When specified at the group level, the USAGE clause applies to each elementary item in the group. The usage of elementary items must not contradict the usage of a group to which the elementary items belongs."
Last edit: Steven F. Lott 2018-10-18