spring batch and jrecord to generate ebcedic

381 views Asked by At

I am reading a table in an object and I need to generate a passthrough ebcidic file from it. This is a spring batch step. There was some suggestions to use jrecord to write an aggregator and a FlatFileItemWriter.

Any clues ?

1

There are 1 answers

0
Bruce Martin On

JRecord is possible solution, I can not say whether there is a better solution for you or not as I do not know anything about Spring-Batch. This is perhaps more of an extended Comment than a pure answer

JRecord reads / writes files using a File-Schema (or File Description). Normally this file-schema is a Cobol-Copybook although it also can be a Xml~Schema. The file schema can also be defined in the Program if need be. Given you want to write Ebcdic files, I would think a Cobol-Copybook will be needed at some stage.

JRecord also support for mainframe/Cobol sequential File structures (FB - Fixed-Width files) which is what you want

JRecord allows access to fields either by Field-Name or Field-Index (or field id). Note Record_Type_index is to handle files with multiple record types (e.g. header-record, detail-record, footer-record files).

 outLine.getFieldValue(record_Type_Index, field_Index).set(...)

or

 outLine.getFieldValue("Field-Name").set(...)

Bruce Martin (author of JRecord)


Discussions continued at JRecord forum