Mike Beckerle created DAFFODIL-2873:
---------------------------------------
Summary: zoned EBCDIC signed negative numbers not parsed correctly
Key: DAFFODIL-2873
URL: https://issues.apache.org/jira/browse/DAFFODIL-2873
Project: Daffodil
Issue Type: Bug
Components: Back End
Affects Versions: 3.6.0
Reporter: Mike Beckerle
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:
{code:java}
<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> {code}
The data is:
{code:java}
R99999999 {code}
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:
{code:java}
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 {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)