7 Replies Latest reply: Feb 17, 2015 5:29 AM by offpiste.reese _ RSS

    Ending or stopping a trap

    offpiste.reese _

      I'm not sure this explanation will be understandable.  I am extracting data from a PDF that is a a bunch of mainframe reports put together into 1 PDF.  My Page Header trap matches data from the page header of a report (the targeted report) and looks for some data inside each section of the report. It works fine until the last instance of my trap.  The report that follows the targeted report has the same format for the detail data as the targeted report, but the page header does not match the targeted report trap.  The last detail section of the targeted report does not contain any data that matches my filter, but the first detail section of the next report does.  So I am getting data from the next report on my last match. 


      Is there a way to stop or end a trap?  I couldn't find anything in the help.  Each section of my targeted report has distinct ending text.  I tried a Group Footer, but that did not seem to work.



        • Ending or stopping a trap
          Olly Bond

          Hello Dan,


          if you set a template on the footer, and then set the Page Header to be an Append, and set it to be cleared by the Footer, you should be able to distinguish between "good" and "bad" detail records that appear on the sa me page but separated by the footer.


          If you can post a sample here between CODE tags, I'm sure that there'll be a few of us able to help in more detail.


          Best wishes,



            • Ending or stopping a trap
              offpiste.reese _



              Thanks.  I set the Header to be cleared by my detail record and that does the trick.  I still get the data from the next report, but it doesn't get attached to the header data of the last Header in the targeted report.  I can now filter it out. 



            • Re: Ending or stopping a trap
              offpiste.reese _

              I never ended up using this code, and evidently I got rid of the models.  Now I need to do this exact thing again, stop getting data based on the detail or a footer.  And I forget how I did it and can't figure it out.  So basically I have a trap on the DPR# line and Detail on the TRAN CODE REASON CODE lines.  After the detail, I want to stop trapping data until it finds another Header line.  I can't get the following to format HTML wise, but if you cut and paste it comes out like it is in the report.


              DPR# BC460-13    ASSN 45 CORP  XXXXXX INST                  BANKCARD DAILY ACTIVITY JOURNAL BY BIN                        AS OF    01/11/15        PAGE  2574

              BIN 123456        XXXXXXXX XXXXXXXXX XXX                                                                                    RUN DATE 01/11/15           


                                            TOTAL OUTSTANDING BALANCES - BEGINNING                              $1,926,022.02                                         

                                            RECOVERY OUTSTANDING BALANCES - BEGINNING                                    $0.00                                         


                    NON-SYSTEM GENERATED TRANSACTIONS - POSTED                                                                                                         

                                            TRAN CODE      REASON CODE    DESCRIPTION          COUNT            $ AMOUNT                                             

                                                05              00    SALES DRAFT                  155              $9,064.58                                         

                                                06              00    CREDIT VOUCHER                10                $314.52-                                       

                                                07              20    CASH ADVANCE                  1                $300.00                                         

                                                07              23    LETTERCHECK                    1                $70.00                                         

                                                65              01    PAYMENT - THANK YOU            1                $150.00-                                       

                                                65              35    ON-LINE PAYMENT-THANK YO      2              $1,003.15-                                       

                                                65              44    ELECTRONIC PMT--THANK YO      1                $45.00-                                       


                                              TOTAL NON-SYSTEM GENERATED TRANSACTIONS - POSTED      171              $7,921.91                                         


                                              TOTAL NON-SYSTEM GENERATED TRANSACTIONS                171              $7,921.91                                         


                                                          BIN TOTAL TRANSACTIONS - POSTED          171              $7,921.91                                         

                                                          BIN TOTAL TRANSACTIONS - UNPOSTED          0                  $0.00                                         

                                                          BIN TOTAL TRANSACTIONS - RECOVERY          0                  $0.00                                         

                                                          BIN TOTAL TRANSACTIONS                    171              $7,921.91