I'm working on a Java program. I have to write a file out to the mainframe computer. A Cobol prorgram also reads and writes records to the same table so the format has to stay the same. One column in the record consist of Pic X(10), Pic 9(7), Pic S9(4) Comp and Pic S9(05)V99 Comp-3 data. How do I convert an Integer or Double to a Pic S9(05)V99 Comp-3 before I write it out to the table ?
Thanks for any help.
While it might be trivial (in code) the understand is quite involved. In COBOL, we define the format as well as the internal storage type. In Java we do not. Please take some time to fully understand how COMP and COMP-3 are handled in COBOL, then you may find that your answer is simple and straight forward. If not (after your research, please post again).