Skip to content

Treating Variable ODO clauses in Padded Fixed Size Records #839

@Jake130

Description

@Jake130

Background

Hello, I'm trying to parse a file with "OCCURS DEPENDING ON ..." clauses in a fixed size record format, but am struggling to parse any data that follows these fields. It seems the issue that I'm running into is that Cobrix is assuming that the physical size of these fields is determined by the maximum array length. This makes sense as it would keep the file fixed size.

In my situation, I'm receiving files that have ODO clauses, with their physical field size being determined by the number of elements in the array. (Variable physical storage for variable length arrays). The rest of the file is padded to make the record fixed length.

This is causing an issue as the Cobrix parser fails to correctly interpret any data that follows the first array item, if the array is not completely full.

I'm not sure why these files were made to have a fixed size, but they are being received from a third party source hence we cannot easily convert these to being variable size.

Example

Here's an example of a situation in which an issue is encountered...

  • Previous Data precedes Array_1 and is correctly parsed
  • Array_1 has 0->1 elements with each element being 200 bytes
  • The parser assumes that Array_1 stores 200 bytes regardless of size
  • When Array_1 is empty, all following data is incorrectly parsed as the parser's reading position has been incremented by 200 bytes

Question

I've tried configuring the parser with .option("variable_size_occurs", "true") however I run into an array indexing error. Is there a set of configurations I could use to handle this scenario, or would this not be supported? There are no RDW headers.

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