6 Replies Latest reply: May 15, 2014 9:53 AM by Grant Perkins RSS

    Capturing variable info in one pass

    lanman00 _

      I have been unable to figure out how to capture the data I need in the following formatted file.

       

      The data follows this simple pattern...

      16 in positions 1-2 denotes a new detail record...

      88 in positions 1-2 denotes a continuation line for the current record...

      the # of "88" lines is variable...

       

      I can write traps for each individually and make several passes over the data, but how do I incorporate the logical IF statements into one template and ensure that I haven't missed a transaction? 

       

      Can anyone point me in the right direction? 

       

      I need to trap the following from the sample further below...

       

      from "16,108" record I need the following:

      108

      0000001450938

      from its "88" line(s):

      0481004207

      0000004207

       

      from "16,353" record I need the following:

      353

      0000000036000

      nothing from its "88" line(s)

       

      from "16,408" record I need the following:

      nothing (skip entirely, if possible)

       

      from "16,495" record I need the following:

      495

      0000026000000

      nothing from its "88" line(s)

       

       

      Sample Data extract is following below:

       

      16,108,0000001450938,S,00000000494305,/

      88,0481004207,0000004207,/          16,353,0000000036000,S,00000000014099,/    

      88,,0000003123/       

      88,CASH VAULT CR ADJUSTMENT

      16,408,0000000000000,S,00000000000000,0000000000/

      88,,0000003124/

      88,CHARGEBACK FLOAT                   

      16,495,0000026000000,,,/

      88,WIRE TRAN* 000578DRAWDOWN OUT

      88,BENEFICIARY= CO. NETWORK FUNDING        

      88,BENEFICIARY'S BANK= BK OF NYC

      88,REFERENCE=W123456789  

       

       

      Thanks for any help...

        • Capturing variable info in one pass
          Grant Perkins

          Is there always at least one 88 line with each 16 line?

           

          For reference, in case of relevance, which version of Monarch are you using?

           

          Grant

          • Capturing variable info in one pass
            lanman00 _

            Yes... there is always at least 1 "88" line

            • Capturing variable info in one pass
              lanman00 _

              currently Pro V6.01, but I have Pro V8 upgrade still in shrink wrap...

              George

              • Capturing variable info in one pass
                Grant Perkins

                There may be more to it than this in the ful file but here are some ideas.

                 

                Make your template a 2 line sample. Trap on line one using "16" and 'paint' the fields you require from line one.

                 

                In the sample it seems that the fields you need are consistent in size. If that is not always the case define those fields at the beginning of the line that are consistent and grab any others as a single field.

                 

                On the second line do the same. If there are positional inconsistencies - take the whole line as a single field. If ever you need any data that is in line 3 or 4 or whatever you need to make the field a multi line field.

                 

                If you do take entire lines as a single large field you should be able to break it up again using the RSPLIT function and splitting on the "," then picking the part of the split you want to take. You may need the IF() function to specify when and how to make the change to select the appropriate part of the line from each record.

                 

                It looks like you only need the second line detail if the first line has a code of "108".

                 

                So you can use that as a "formula" for whether or not any data is required from line 2.

                 

                You can also make a filter skip any records you don't require - the "16,408," lines for example. I don't see any point in trying to use the trap to filter the 408 lines - just take them into the table and then use a filter to ignore them.

                 

                I hope this helps you to progress. If you want some worked examples let me know and I will try to provide something later.

                 

                 

                Grant

                 

                [size="1"][ April 25, 2005, 05:04 PM: Message edited by: Grant Perkins ][/size]

                • Capturing variable info in one pass
                  lanman00 _

                  Thanks for the tips... now I have a starting point... wish me luck...

                  • Capturing variable info in one pass
                    Grant Perkins

                    Originally posted by lanman00:

                    Thanks for the tips... now I have a starting point... wish me luck... /b[/quote]Err, Good Luck!     

                     

                    Let us know if you get stuck. The sample looks fairly consistent but the full report may not be so kind.

                     

                     

                    Grant