I have a problem that I'm facing with Record Editor and trying to convert COBOL data and Copybook files to CSV. I'm stuck at a point where "Generate Code for Cobol Copybook creates a preview that is accurate, but I'm not able to export it because the only way I can get it accurate is by using "Unknown File Format", "Fixed Length Binary" file structure with record length of "XXX" or "422". Maybe someone knows how to fix this? or how to approach this situation?
Asked
Active
Viewed 578 times
2 Answers
2
It looks like I figured out what was the problem, the copybook was not defined with an ending filler field that would be sufficient to create 422 record length.
primesc
- 43
1
There are several possible solutions
- Update the Generated java code and set the recordLength
- Add a Filler to the copybook to increase its length to 422.
Use setRecordLength option
In the generated code, you can add a setRecordLength call to force JRecord to use a length greater than in the copybook
i.e. there will be code like
ICobolIOBuilder ioBldr = JRecordInterface1.COBOL
.newIOBuilder(new ByteArrayInputStream(cobolCopybook.getBytes()), "COMPANY-RECORD")
You can add a setRecordLength method to the call
ICobolIOBuilder ioBldr = JRecordInterface1.COBOL
.newIOBuilder(new ByteArrayInputStream(cobolCopybook.getBytes()), "COMPANY-RECORD")
.setRecordLength(422)
Update copybook
you can add a filler to the copybook to increase the record to a length of 422
Bruce Martin
- 260