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
Anonymous
Diff:
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 ???