splitting a text report

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf splitting a text report

  • Creator
    Topic
  • #53146
    Kevin Crist
    Participant

      How would it be possible to split a report text? Our dication system sends out a report and then when they do an addendum it sends out the report plus the addendum cause the recieving system to error.

      For example:

      OBX||||||blah blah blah blah blah

      OBX||||||testing testing testing

      OBX||||||blah blah blah blah blah

      OBX||||||ADDENDUM:|

      OBX||||||more report text

      OBX||||||more report text

      OBX||||||i need a vacation

      So if there is an ADDENDUM i need to remove all OBX segments prior to it and keep only the ADDENDUM and below.

      OBX||||||ADDENDUM:|

      OBX||||||more report text

      OBX||||||more report text

      OBX||||||i need a vacation

      Any help or ideas are appreciated.

      Thanks.

    Viewing 7 reply threads
    • Author
      Replies
      • #76709
        Gary Atkinson
        Participant

          Loop through all the OBX:5 for the string “ADDENDUM” and use OBX:5 as your iterate variable for the OBXgrp.  If you find “ADDENDUM” then do your copy of the OBX.  As long as all of the “stuff” you don’t want is not in the obxs below “ADDENDUM” I believe this will work.  8)

        • #76710
          Jim Kosloskey
          Participant

            Kevin,

            IF you are using BULKCOPY, you will need to get rid of the already existing OBX segments above the ADDENDUM as well.

            With the solution you will need to use your own managed iteration counter for the outbound.

            email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

          • #76711
            Kevin Crist
            Participant

              i will use pathcopy. i try to stay away from bulkcopy. but i havent started an xlate or tcl with this yet as it was just brought to my attention this am so i am pondering my point of attack.

            • #76712
              Gary Atkinson
              Participant

                don’t use pathcopy, copy only over when you need to.  As Jim pointed out and which i forgot to mention is that need to declare your own counter.  BTW…Hi Jim long time…I am headed back to the cloverleaf world.  Yea Me!  ðŸ˜† I could not take using the new engine they forced me to use so I packed my bags  ðŸ˜‰

              • #76713
                Kevin Crist
                Participant

                  I am not very familiar with how to use and setup a counter so i tried another method which i thought would work but isnt. Is there any reason you see why it wont work or is this just a bad way to do it?

                  The OBX’s have the segment ID in the OBX.1 so i searched for the ADDENDUM: , set to variable and tried to null the segments that are lower than that number.

                • #76714
                  Gary Atkinson
                  Participant

                    I believe this *should* work but I didn’t test it.  You could add in the Else in the IF to copy OBX based just %g1 if addendum was not found.  I am little rusty on my xlates but I thought I would give it a try  ðŸ˜›

                  • #76715
                    Eric Fortenberry
                    Participant

                      I threw a TPS proc together for this problem.  Let me know if it helps.

                      http://gist.github.com/2933489

                      Thanks,

                      Eric

                    • #76716
                      Jim Kosloskey
                      Participant

                        No neerd for Tcl you just need to use your own counter.

                        The counter you set up in the iteration is pointing to the current inbound occurrence and you need to point to a different occurrence using a pointer.

                        Once you learn this technique your capabilities will grow significantly.

                        email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

                    Viewing 7 reply threads
                    • The forum ‘Cloverleaf’ is closed to new topics and replies.