cobrix icon indicating copy to clipboard operation
cobrix copied to clipboard

Support for record type

Open mevivs opened this issue 1 year ago • 3 comments

Hi, Does the library support option to read EBCDIC data based on record type instead of copy book option?

mevivs avatar Apr 19 '23 12:04 mevivs

I'm not sure I understand the question. Could you elaborate on it please?

yruslan avatar Apr 20 '23 06:04 yruslan

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.

mevivs avatar Apr 28 '23 01:04 mevivs

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.

yruslan avatar May 04 '23 13:05 yruslan