Is it possible in an Xlate to combine multiple input records

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Is it possible in an Xlate to combine multiple input records

  • Creator
    Topic
  • #49701
    John Hamilton
    Participant

    For the first time, I think in my 13 years of working with cloverleaf.

    I have been asked to take multiple input VRL records to a single outbound X12 record.

    Has anyone done this ? I would be interested in hearing your solution.

Viewing 0 reply threads
  • Author
    Replies
    • #63182
      Rob Abbott
      Keymaster

      John

      You can hold transactions in a TPS – we do this when we need to build a batch file … this makes the process recoverable – if things go down in the middle of a batch it will pick up where it left off

      example code you would put in IB TPS

      Code:


      global mh_list batch_msg

      start { set mh_list “”; set batch_msg “” }
      run {
        # figure out if this is the last message in the batch
        if $last_msg {
          # destroy all the messages we are holding
          foreach my_mh $mh_list {
             lappend dispList “KILL $my_mh”
          }
         
          # set current mh to batch data
          append batch_msg [msgget $mh]
          msgset $mh $batch_msg    

          # clear our globals
          set mh_list “”
          set batch_msg “”
       } else {
           # not the last message, append the data to our global and hold the
           # message handle
           append batch_msg [msgget $mh]
           lappend mh_list $mh
           return “”
       }

      Rob Abbott
      Cloverleaf Emeritus

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

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,297
Replies
34,440
Topic Tags
287
Empty Topic Tags
10