3 Replies Latest reply: May 15, 2014 10:15 AM by Olly Bond RSS

    Trapping a varying length field

    Janet Grimsley

      I am having difficulty trapping the acct nbr that appears after "[B]/[/B]". The verbiage [B]Acct[/B][/I] [B]Information = XXX/[/B][/I] is always in the same position. The acct nbr which follows varys in length.

       

      Acct Information = SDA/[B]123456[/B] Acct ShortName = FCU Acct Status = A Service Code = BPP

      Service Code = E

       

      Acct Information = SDA/[B]124567891273[/B] Acct ShortName = income account Acct Status = A Service Code = BPP

      Service Code = E

       

      Acct Information = DDA/[B]123456307[/B] Acct ShortName = Acct Status = A Service Code = BPPBLD

      Service Code = I

        • Trapping a varying length field
          Olly Bond

          Hello rediron,

           

          You can use the floating trap option for this. Trap characters should include the / and ßAcct (blank, followed by Acct).

           

          Set the field data length to fit the sample line, and once the template is defined then double click the field, and edit the data length to be 50 or whatever exceeds the maximum you will expect to find.

           

          Hope this helps,

           

          Olly

            • Trapping a varying length field
              Janet Grimsley

              The trap you suggested is what I had.  But I did make changes to the Display Width of 20 and Template width of 12.  The result is below.

              The problem results in the field not ending soon enough, and captures part of the text that follows the account number.  I have played with the Advanced Tab on the field in question, but cannot find the correct combination.  Below is the

               

              123456 Acct 

              124567891273

               

              I just captured more than I needed and used LSplit to get the account number.  I am happy with this. Thanks for the help!

               

              Janet

                • Trapping a varying length field
                  Olly Bond

                  Hello rediron,

                   

                  Are you sure you have ticked the box for a floating trap? If you have, with the ßAcct characters in the trap line, then the "123456 Acct" data shouldn't appear, just "123456".

                   

                  Feel free to email me the report and model if you'd like me to take a look.

                   

                  Best wishes,

                   

                  Olly