Menu

#15 display-length for group differs from sum of group parts

v1.0 (example)
open
None
5
2019-03-04
2019-02-15
No

Environment:
OS = Windows 7 Enterprise
cb2xml = version 1.01
Java = version 8 update 144

Steps to reproduce:
..\bin\cb2xml.bat test_01.cbl > test_01.xml

Expected result in XML:
GROUP display-length = 15, sum of display-length 10 and display-length 5

Actual result in XML:
GROUP display-length = 11, possibly sum of storage-length 6 and storage-length 5
See attached input and output files

Comment:
The element name "position" is ambiguous, because the storage-position and the display-position can be different.
Changing the name to "storage-position" would remove the ambiguity.
Also adding an element "display-position" would be a feature.

Discussion

  • Pether Camitz

    Pether Camitz - 2019-02-15

    Input:
    06 GROUP.
    08 PACKED-NUMBER PIC 9(10) USAGE IS COMPUTATIONAL-3.
    08 FILLER PIC X(5).

    Output:

    <copybook filename="test_01.cbl" dialect="Mainframe">
    <item level="06" name="GROUP" position="1" storage-length="11" display-length="11">
    <item level="08" name="PACKED-NUMBER" picture="9(10)" usage="computational-3" position="1" storage-length="6" display-length="10" numeric="true">
    <item level="08" name="FILLER" picture="X(5)" position="7" storage-length="5" display-length="5">
    </item>
    </item></item></copybook>

     
  • Bruce Martin

    Bruce Martin - 2019-02-16
    • assigned_to: Bruce Martin
     
  • Bruce Martin

    Bruce Martin - 2019-02-16

    The element name "position" is ambiguous, because the storage-position and the display-position can be different.

    • Answer: While storage-position is a better name, position is very important and changing it now would break existing code.
          05 Group-1.
             10 Field-1      Pic s9(07)PPP.
             10 Field-2      Pic VPPP999.
    

    For storage-length there is 2 ways of looking at it

    • In Cobol Group-1 is in effect a Pic X field (x(10) for the above). For Group-Display-length = storage-length

    • Alternatively there is no point for storage-length=display-length.

    I will look at

    • Changing Display-Length to the sum of the child display length
    • adding Display-Position.

    I there any reason why you want a Display position and Group-Display-Length

     
  • Pether Camitz

    Pether Camitz - 2019-02-18

    I don't need a separate element group-display-length, using display-length is OK if it sums correctly.
    I suspected the position element was too set in stone to be changed.
    The copybook I worked with when I saw the sum difference has about 500 fields in 8 levels, packed and signed fields to a storage-length > 1200.
    Having group lengths summed and being able to see start positions also for display is helpful as we are moving to a different receiver architecture.

     
  • Bruce Martin

    Bruce Martin - 2019-03-04

    There is a new version

    that changes Display-length / position.

    The change in Group-Display-Length is for all generated Xml files.
    The Display-Position tag is only displayed for the new (2017) format
    i.e. something like the following

    java -jar ../../lib/cb2xml.jar -cobol cbl2xml_Test110.cbl -xml cbl2xml_Test110.cbl.x1.xml -indentXml
    

    There will be a cb2xml-format="2017" on the copybook tag.

    The Display Position is also available in the Java interface.

     

Log in to post a comment.

MongoDB Logo MongoDB