Skip to content

Error while processing multi-segment file - Following segment redefines not found, Please check fields exist #269

@eapframework

Description

@eapframework

I am trying to process a multi-segment file. Please find the copybook attached.

copybook-flap.txt

Code below:

val df = spark.read.format("cobol").option("copybook", "copybook-flap.txt").option("pedantic", "false").option("segment_field", "FLAP-MTHD-OVER-RIDE-NR")
.option("redefine_segment_id_map:0", "FLAP_RECORD.FLAP-ITEM.FLAP-MTHD-OVER-RIDE.FLAP-MTHDS.REDEFINE-STR1 => 1")
.option("redefine-segment-id-map:1", "FLAP_RECORD.FLAP-ITEM.FLAP-MTHD-OVER-RIDE.FLAP-MTHDS.REDEFINE-STR2 => 2")
.option("redefine-segment-id-map:2","FLAP_RECORD.FLAP-ITEM.FLAP-MTHD-OVER-RIDE.FLAP-MTHDS.REDEFINE-STR3 => 3")
.option("redefine-segment-id-map:3","FLAP_RECORD.FLAP-ITEM.FLAP-MTHD-OVER-RIDE.FLAP-MTHDS.REDEFINE-STR4 => 4")
.load("mcy_flap1_Dec19.dat")

I gave the full path for Redefines fields - FLAP_RECORD.FLAP-ITEM.FLAP-MTHD-OVER-RIDE.FLAP-MTHDS.REDEFINE-STR1

But still getting error -

Following segment redefines not found, Please check fields exist and are redefines/redefined by.

Please help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions