aminosoftware / lysine

documentation and releases for the Lysine data conversion tool by aminoSoftware
0 stars 0 forks source link

Redefines should provide a name for the RedefinitionSet #2

Open paltman opened 7 years ago

paltman commented 7 years ago

When seeing copybooks like:

02  ENTRY_REF_NUMBER.                                            
    03  ENTRY_TYPE                PIC X(1).                      
    03  ENTRY_SYS_6.                                             
        04  ENTRY_SYS_4           PIC X(4).                      
        04  ENTRY_SYS_2           PIC X(2).                      
    03  ENTRY_DATE                PIC X(2).                      
    03  ENTRY_BOX_BATCH.                                         
            05  ENTRY_2           PIC X(2).                      
            05  ENTRY_LAST_6      PIC X(6).                      
02  FILLER  REDEFINES  ENTRY_REF_NUMBER.                         
    03  TYPE                      PIC X(1).                      
    03  PREFIX_BIN.                                              
        04  FIRST_DIG             PIC 9(1).                      
        04  LAST_DIGS             PIC 9(5).                      
    03  RETRIEVAL_NUMBER.                                        
        04  DATE                  PIC X(2).                      
        04  FILM_LOCATOR.                                        
            05  FILLER                PIC X(3).                      
            05  ENTRY_LAST_5      PIC X(5).     

We are seeing parsings of:

<?xml version="1.0" ?>
<Definition>
  <AminoSoftware.Ebcdic.Definition>
    <Columns>
      <AminoSoftware.Ebcdic.CopyBook.RedefineColumn ColumnID="ccef4cb1-0a3f-4a9a-8ca3-833b334bfaad" Name="ENTRY_REF_NUMBER">
        <IndicatorColumns/>
        <Definitions>
          <AminoSoftware.Ebcdic.CopyBook.RedefineDefinitionSet Name="">
            <Columns>
              <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="5cb68c7d-14f1-42a3-919c-fc0eaeb18c4c" Length="1" Name="ENTRY_TYPE" NumberOfDecimalPlaces="0"/>
              <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="f3693440-f5e2-4b3e-9ae9-a7c21a34862e" Length="4" Name="ENTRY_SYS_4" NumberOfDecimalPlaces="0"/>
              <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="ead943e4-4d3e-4dcc-b7c3-3d61a7f1c052" Length="2" Name="ENTRY_SYS_2" NumberOfDecimalPlaces="0"/>
              <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="410d0eff-7ce0-48db-b999-131fecd8f381" Length="2" Name="ENTRY_DATE" NumberOfDecimalPlaces="0"/>
              <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="681aee61-58e9-4048-bc1d-04064bc7d1f9" Length="2" Name="ENTRY_2" NumberOfDecimalPlaces="0"/>
              <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="9b6e1aa5-23d5-4bc7-842f-a6afbbab24d8" Length="6" Name="ENTRY_LAST_6" NumberOfDecimalPlaces="0"/>
            </Columns>
            <Values/>
          </AminoSoftware.Ebcdic.CopyBook.RedefineDefinitionSet>
          <AminoSoftware.Ebcdic.CopyBook.RedefineDefinitionSet Name="">
            <Columns>
              <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="36a5aa7e-412a-4c6e-904f-c77700a2820a" Length="1" Name="TYPE" NumberOfDecimalPlaces="0"/>
              <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="1ceec1a8-749c-42ab-87d1-db219455966d" Length="1" Name="FIRST_DIG" NumberOfDecimalPlaces="0"/>
              <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="a3778167-95c2-41fe-90bb-171c698891d2" Length="5" Name="LAST_DIGS" NumberOfDecimalPlaces="0"/>
              <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="1b927e1d-d9e5-41d9-9a9f-6d7268bd8e46" Length="2" Name="DATE" NumberOfDecimalPlaces="0"/>
              <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="6bde33f9-4ac7-4efd-85ab-45f3c8dc2b64" Length="3" Name="FILLER" NumberOfDecimalPlaces="0"/>
              <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="6532003a-bf10-4c41-a2a4-8b09b49c10c1" Length="5" Name="ENTRY_LAST_5" NumberOfDecimalPlaces="0"/>
            </Columns>
            <Values/>
          </AminoSoftware.Ebcdic.CopyBook.RedefineDefinitionSet>
        </Definitions>
      </AminoSoftware.Ebcdic.CopyBook.RedefineColumn>
      <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="8c1eb38d-9b13-4334-ae85-a5ce7fc58d4e" Length="4" Name="ENTRY_SYS_4" NumberOfDecimalPlaces="0"/>
      <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="9cec97e4-f372-4b90-a25e-60d819ef8386" Length="2" Name="ENTRY_SYS_2" NumberOfDecimalPlaces="0"/>
      <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="e31639cc-0152-4bdc-b984-fd03f18e0e84" Length="2" Name="ENTRY_DATE" NumberOfDecimalPlaces="0"/>
      <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="bdfc8d6e-4561-4d58-a9a3-e3ba47248a82" Length="2" Name="ENTRY_2" NumberOfDecimalPlaces="0"/>
      <AminoSoftware.Ebcdic.CopyBook.RegularColumn ColumnID="116d993c-6bc4-4329-a323-e381ea3ba3a5" Length="6" Name="ENTRY_LAST_6" NumberOfDecimalPlaces="0"/>
    </Columns>
  </AminoSoftware.Ebcdic.Definition>
</Definition>

What we should see in that are values for the Name attribute of RedefinitionSet elements.

I'm pretty sure we are also no respecting the grouping appropriately given that some of the fields are defined twice.