Hi,
I am currently using JRecord.jar version 0.81.4 for my project.
We have a cobol layout that has one of its field of the format
FUEL-CHARGE PIC9 PIC 9(13).9(2).
We are initialising a record(of type net.sf.JRecord.Details.Line) and setting the value using record.getFieldValue("FUEL-CHARGE PIC9 ").set("0000000337339.79")
When we invoke record.getFieldValue("FUEL-CHARGE PIC9 ").asString(),
-in normal scenario the output is 337339.79
-but under heavy load(mutliple transactions running parallely), we are getting 337339 and 337339.790000
So under heavy load the decimal point and the digits after that do not appear or the decimal point shifts with zero padding to the right instead of padding to left.
Please help to understand the root cause and possible solutions for this issue.
Thanks,
Ramesh Rajan
Anonymous
Two corrections:
FUEL-CHARGE PIC 9(13).9(2).
2.We are retrieving the value using record.getFieldValue("FUEL-CHARGE").asString() and not record.getFieldValue("FUEL-CHARGE PIC9 ").asString()
Last edit: RAMESH RAJAN 2018-02-02
I will have a look at it.
Are you updating the same record in different transactions or are you updating different record ????
Is a record being updated in multiple transactions ????
Last edit: Bruce Martin 2018-02-02
Hi Martin,
It is one record created and updated per transaction. But multiple transactions run at the same time.
Also this issue does not occur consistently. But we have noticed that whenever we got this issue, then we were running around 150 to 500 transactions parallely and out of them one record might get this issue.
Please show me you code / copybook - is there any occurs depending ???
I will send you my e-mail in case you do not want to attach to the problem
I actually am seeing a similiar problem with versions:
This is my line code:
This is my copybook definition of a few problem fields:
An excerpt from my logs:
and a different field from another location:
What can I do to straighten this out? It looks like it's shifting the decimal and removing data from the front of the line. I've also seen parsing issues on the "." I'm hoping I can just modify the values I supply to JRecord and not update just yet? We're on the heels of a rollout and I'm not sure how backwards-compatible the newest versions are with the one we're using...
Last edit: Michael Zoghby 2018-05-15
These COMP-3 decimal fields are the ONLY field types that have problems. This copybook has every field type under the sun and no other fields are having trouble being "reset" with new data.
For the fields that aren't flagged as implied decimal, there is no problem loading new values either. The only fields struggling are the implied decimal COMP-3s.
The other thing that is interesting/difficult is that not ever field fails to be set and I can't identify a pattern of behavior. Most fields set completely fine. For example:
and the log:
It's also worth mentioning that when I attempt to manually remove the decimal:
I get the following error:
Last edit: Michael Zoghby 2018-05-15
Yes the problem was in several versions. I have uploaded 2 fixed versions:
I will try and do another 0.90 Release Candidate 6. This will have:
The problem is in net.sf.JRecord.Common.Conversion method
getNumberformat, it should be:
Awesome news! Two followup questions though...
The first post in this ticket indicates that they were using 0.81.4 when they saw the problem. I'm using an older version than that so I can't say from any experience - just curious if you rolled out a new release on top of that previous version that patched it?
Second - purely from a curiosity standpoint. I only saw this issue when we ran JRecord in a multithreaded environment and only for these few COMP-3 fields for this one file. I'm publishing over 50 EBCDIC files using JRecord - all multithreading - and never saw this problem. I'm curious if the root cause might be more complex? I've never had cause to doubt JRecord - it has absolutely saved my life - I just want to make sure I understand what's going on under the hood on this issue.
Code is
The program uses the numberFormat straight after it is updated so there is not much time for another process to get in and update it.
A lot of Cobol programmers will use the same picture definition e.g. s9(7), s9(7)V99. There are going to be cases where it is happening
but you do not see it.
I can only go on what Ramesh reported:
If this is the only problem, you will see it if
I do not plan on backporting all version, to much work - to much to do already. I will probably update JRecord 0.91.5 and leave it at that.