7 Replies Latest reply: May 15, 2014 10:10 AM by kolz _ RSS

    Stumping myself help with multiple line file

    kolz _

      ok..

       

      I have a file basically formatted like this

       

      z01   data

      z02   data

      z03   required

      x01   data associate with the z record

      x02

      x01   data associated with the z record.

      x02

      end01

       

       

      I have  z01, z02, z03  all as appenidices   x01 x02  as data single two line trap  and the end01 also as an appendix.

       

      my problem is that z03 is not always there.  when i trap the record that doesn't have z03 is pulling in data from the last z03 record.

       

      how should i structure this.    i want the data in z03 when its there but right now i have to delete it from the model otherwise it corrupts the table for the record.

       

      thanks.

        • Stumping myself help with multiple line file
          kolz _

          oops  z03 should be labeled as OPTIONAL above not required.  only z01 z02 required along with all the other lines

            • Stumping myself help with multiple line file
              Olly Bond

              Hello Kolz

               

              The trick is to get the detail template right, the rest will usually follow. To do this, write out what you want your table to look like.

               

              Do you want this?

               

              z01 - x01 1st line - x01 2nd line

              z02 - x02 1st line - x02 second line

              z03[/CODE]

               

              Then you've got the "missing detail" problem - there's an append (z03) for which there's no corresponding detail. Instead of the usual:

               

              z01

              x01 1st line

              x01 2nd line

              z02

              x02 1st line

              x02 second line

              z03[/CODE]

               

              report layout, the appends are all together near the top, which suggest to me that you'll need to use two passes and an external lookup.

               

              Before getting into that, could you confirm what you're looking for? Am I on the right lines?

               

              Best wishes,

               

              Olly

                • Stumping myself help with multiple line file
                  kolz _

                  Need to extract data from a file/report that has multiple lines per record.

                   

                  it has headers  z01,z02,z03 (only some of them)

                  it has multiple data records   x01, x02  meaning file may have another two rows of x01,x02, up to 99

                   

                  then it has a trailer record end01

                   

                  i made the lines  z01,z02,z03  as appendices adn extract multple data elements from each of these.

                   

                  i made x01,x02 my data fields (two line trap) and it works pulling multiple occurrences of these fields back to the z01,z02,z03

                   

                  then i have a trailer record which i also made an appendix and it populates on data lines fine.

                   

                  the problem is z03 isn't on every "record".  sometimes a record only has z01,z02.   when it hits an occurrence of this, z03 of the previous record populates on the next record which it should just be blank as there was no z03 line in that record.

                   

                  now..  each data record looks like this:

                   

                  z01  with data elements  (APPENDIX 1)

                  z02  with data elements  (appendix 2)

                  z03  (only sometimes) with data elements (appendix 3)

                  x01 and x02  (always in record)  (DETAIL)

                  x01 and x02  (different data but linked to same z01,z02, z03 record) (DETAIL)

                  and so on (Detail)

                  End01  with data elements.  (Appendix 3)