Hello,
Let me preface this with the fact that I have almost zero COBOL knowledge. I was tasked with converting an old COBOL app into java.
My current issue is I have the whole program working, with the data matching, except for one field.
The cobol app reads in records from a file and manipulates data, then prints it to an output file.
So here is the record in definition:
01 TYPE-K-REC.
05 TK-FILLER-1 PIC X(40).
05 TK-DATA.
10 TK-FILLER-2 PIC X(32).
10 TK-YTD-HRS PIC 9(8)V99.
10 TK-FILLER-4 PIC X(816).
Here is an example record not including quotations:
"123456789101112K *** ABCD12EF34567891011121314000000070650+ "
So here is my understanding:
TK-FILLER-1 = "123456789101112K "
TK-FILLER-2 = "*** ABCD12EF34567891011121314000"
TK-YTD-HRS = "000070650+"
TK-FILLER-4 = All the extra whitespace
Essentially what I want is TK-YTD-HRS. My questions:
TK-YTD-HRS is defined as PIC 9(8)V99. From my limited understanding, and assuming I have mapped out the fields correctly, wouldn't having a "+" at the end of the input cause an error? The thing is apparently it does not because the output file from the cobol app is generated anyway. So does having the + sign in one of the decimal places mean anything?
Basically what is the value of YTD-HRS?
Is it 706.50 and the + sign is just there?
Or is it 7065.0+? If this is the case can someone explain what happens when it goes to add another number that is similar i.e. "7065.0+" + "1234.5+"
Like I said, my knowledge is very limited, so I may have explained this horribly. Let me know if I can provide anymore info.
Thanks
Mike
xMikeH