Need help splitting one message into multiple messages

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Need help splitting one message into multiple messages

  • Creator
    Topic
  • #49471
    Steve Williamson
    Participant

      I found an example here in the forum that I modified, but I’m only getting one outbound file created.

      My inbound file might have multiple accounts but I only want to process acct2 & acct4. An example of the inbound data would be:

      acct1 some data…

      acct2 some data…

      acct2 some data…

      acct3 some data…

      acct4 some data…

      acct4 some data…

      run {
      [code]run {

    Viewing 4 reply threads
    • Author
      Replies
      • #62096
        Scott Lee
        Participant

          Check the smat files to see if two messages were actually sent out from the outbound thread.  Is the second message overwriting the first message?

        • #62097
          LeeAnne Kardas
          Participant

            I am taking a A03 and copying it to create a A27 and sending both A03 and A27.  I hope this helps.

            if {[cequal $msgtype A03] && [cequal $pattype E]} {

                        set a03_msg $msg

                        set a27_msg [msgcopy $mh]

                        lappend dispList “CONTINUE $a27_msg”

                        msgset $mh $a27_msg

                        set msg [setField “A27” “$msg” “MSH.8.1”]

                        set msg [setField “A27” “$msg” “EVN.1”]

                        msgset $mh $msg

                        lappend dispList “CONTINUE $mh”

                   } else {

                        msgset $mh $msg

                        lappend dispList “CONTINUE $mh”

                   }

          • #62098
            Jeannette Wistrom
            Participant

              I am not sure you are even getting into your if loops.  You have the acct variable set for the string range of 0 5 and I think you need it to be 0 4.  Put an echo right after you set your acct variable and see if you are getting what you expect.

            • #62099
              Steve Williamson
              Participant

                Thanks everyone!

                Scott, I am getting 2 messages, I’m using an outbound TPS to add a timestamp to the generated file name and updating the FILESET OBFILE key in DRIVERCTL metadata.

                This was in fact generating the same file name for both files so I put a 5 second sleep in the proc to insure a unique file name.

                There’s still something going on with the file names actually being created in the folder. One of them will have the name generated by the outbound TPS, and the other will have a filename of what was in the DRIVERCTL/FILESET/OBFILE key from the previous run of the input file through the engine.

                Once I do some more testing/echos to determine exactly what is happening I may have to ask(beg) for more help.

                Thanks again everyone.

                Steve

              • #62100
                Steve Williamson
                Participant

                  It’s all working now.

                  In addition to adding the sleep command to the outbound TPS to give me a unique file name, I had to be patient enough to leave the process running long enough for it to complete it’s output chores. 😳

                  Thanks everyone for your help.

                  Steve

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