Menu

#7 multiple 01 level records is misunderstood

Release 4.3.3
closed
None
2014-05-08
2014-04-30
RHarris
No

The presence of multiple 01 level records with top-level REDEFINES indicates that the datafile contains multiple record types, each with a unique schema and record-length.

When this happens, there is generally some sort of "record type" field early in the record.
To properly handle this situation, a new RECFM class is probably required, and the user needs to specify which field is the appropriate "record type" field. One option for handling record schema would be to define a "record header" schema which would contain the bytes from the start of the record to the end of the "record type" field. Other record-body schemas would be defined based on the 01 level records in the file and removing the "record-header" from those individual record schemas.

The user writing the parsing code would be required to read the "record header" evaluate the "record type" and then choose the appropriate "record body" schema to parse the record. A future enhancement could be to provide a tuple-based configuration (similar to 'replacing') to provide the necessary information to stingray so that it could automatically choose the correct record body schema, however in the real world this information is often difficult/impossible to automatically derive from the copybook and must be referenced from external documentation and supplied by the end user.

This condition is similar to handling of ODO records with fewer potential possibilities. It is possible to have both ODO and multiple 01-level records in the same copybook which would further complicate the parsing.

Discussion

  • Steven F. Lott

    Steven F. Lott - 2014-05-05
    • Milestone: Release 4.3.1 --> Release 4.3.3
     
  • Steven F. Lott

    Steven F. Lott - 2014-05-05

    This is a clever idea for an expanded "Builder Function". It belongs in the developer section of the documentation as a smart way to handle the REDEFINES. It applies universally, throughout the record hierarchy, not just 01 level redefines.

     
  • Steven F. Lott

    Steven F. Lott - 2014-05-05
    • status: open --> accepted
    • assigned_to: Steven F. Lott
     
  • Steven F. Lott

    Steven F. Lott - 2014-05-06
    • status: accepted --> pending
     
  • Steven F. Lott

    Steven F. Lott - 2014-05-06

    This involves a huge (necessary, very important) rewrite to the Developer section of the documentation.

     
  • Steven F. Lott

    Steven F. Lott - 2014-05-08
    • status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB