Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2873

zoned EBCDIC signed negative numbers not parsed correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.6.0
    • 3.7.0
    • Back End
    • None

    Description

      For zoned decimal numbers, if the encoding is ascii-based then the proeprty dfdl:textZonedSignStyle is used to determine how the signs are overpunched.

       

      But if the encoding is ebcdic based, then this property is supposed to be ignored. 

      This appears to not be happening. 

       

      In the COBOL1 example (on DFDLSchemas github), a number has this type:

       

      <simpleType
        name="displayMoney7Digits"
        dfdl:representation="text"
        dfdl:textNumberRep="zoned"
        dfdl:encoding="ebcdic-cp-us"
        dfdl:decimalSigned="yes"
        dfdl:textNumberPattern="+0000000V00"
        dfdl:length="9">
        <restriction base="xs:decimal" >
          <maxInclusive value="9999999.99"/>
          <minInclusive value="-9999999.99"/>
        </restriction>
      </simpleType> 

      The data is:

      R99999999 

      But the R is not accepted as a -9 digit with negative overpunched. This is EBCDIC character D9 which is the D minus indicator overpunched on the zone of the 9 digit. 

      The error message is:

      org.apache.daffodil.tdml.TDMLExceptionImpl: (Implementation: daffodil) ParseError: Parse Error: Unable to parse zoned xs:decimal from text: R99999999. Invalid zoned digit: R
      Schema context: TOTAL-CHARGES Location line 84 column 8 in .../Cobol/target/classes/cobol1.dfdl.xsd
      Data location was preceding byte 90 

      Attachments

        Activity

          People

            mbeckerle Mike Beckerle
            mbeckerle Mike Beckerle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 50m
                1h 50m