cobrix
cobrix copied to clipboard
Support for record type
Hi, Does the library support option to read EBCDIC data based on record type instead of copy book option?
I'm not sure I understand the question. Could you elaborate on it please?
Sure. Here i mean is ability to record mainframe file without cobol copybook but based on record type. Means my ebcdic file has multiple record layouts but need to read specific fields based on record layout. For example. IF RECTYPE = '01' THEN DO; INPUT @ 349 D $1. @ 121 X $1. @ 7 V $1. @ 8 EE PD4.
Cobrix doesn't support this, but you can workaround maybe by creating a synthetic copybook:
01 RECORD.
02 RECTYPE PIC X(2).
02 D PIC 9(4)V9.
02 X PIC X(5) REDEFINES D.
and use RECTYPE
as a segment and redefine_segment_id_map
to map values depending on the value in the first field.
Hope this is of some help. I've never encountered a use case like this so not sure if the workaround it even close to the solution that you need.