Menu

#15 Issue in parsing Zoned Decimal

v1.0_(example)
open
None
1
2019-05-31
2019-05-31
Anonymous
No

Hi ,

I am trying to read mainframe fixed length file using copybook in java. Facing issue in parsing "PIC S9(10)V9(5)"

Code snippet is as below.
jar version used Jrecord-0.90

~~~java
try {
AbstractLineReader reader = ioProvider.getLineReader(
Constants.IO_BIN_TEXT, Convert.FMT_MAINFRAME,
CopybookLoader.SPLIT_NONE, copybookName, vendorFile
);

        while ((line = reader.read()) != null) {
            lineNumber += 1;
            brokerage_acct_pstn data = new brokerage_acct_pstn();
            data.setSUBACCTTYPCDE(line.getFieldValue("ACCT-TYPE").toString().trim());
            line.getFieldValue("QUANTITY").asBigDecimal();

~~~

Issue faced

net.sf.JRecord.Common.RecordException: QUANTITY: Invalid Zoned Decimal: •#

Sample data for this field is below
500000{

Is there anything which I am doing wrong as in format , filetype etc

Thanks

Discussion

  • Bruce Martin

    Bruce Martin - 2019-05-31
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,7 +5,8 @@
     Code snippet is as below. 
     jar version used  Jrecord-0.90 
    
    -   try {
    +  ~~~java
    + try {
                 AbstractLineReader reader = ioProvider.getLineReader(
                         Constants.IO_BIN_TEXT, Convert.FMT_MAINFRAME,
                         CopybookLoader.SPLIT_NONE, copybookName, vendorFile
    @@ -16,6 +17,7 @@
                     brokerage_acct_pstn data = new brokerage_acct_pstn();
                     data.setSUBACCTTYPCDE(line.getFieldValue("ACCT-TYPE").toString().trim());
                     line.getFieldValue("QUANTITY").asBigDecimal();
    +~~~
    
     Issue faced
    
    • assigned_to: Bruce Martin
     
  • Bruce Martin

    Bruce Martin - 2019-05-31

    Can you provide file / copybook ???

    For PIC S9(10)V9(5) I would expect 15 byte field. 500000{ is to short does it have zero padding ???

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.