Concat values in the field OBX5 with breaks

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Concat values in the field OBX5 with breaks

  • Creator
    Topic
  • #55813
    Reena Gadhia
    Participant

      Hi,

      I am using Cloveleaf v 6.1.2 and am looking for some examples for the concatenating the values that are sent in the obx;5 as below:

      Incoming  message:

      OBX|1| | | |ABC | |

      OBX|2| | | |CAT | |

      OBX|3| | | |BAT| |

      OBX|4| | | | RAT| |

      OBX|5| | | |FAT | |

      OBX|6| | | |TAT | |

      Output message:

      OBX|1| | | |ABC .br CAT\.brBAT.brRAT.brFAT\.brTAT.br | | | |

    Viewing 1 reply thread
    • Author
      Replies
      • #86579
        Jim Kosloskey
        Participant

          Are you using an Xlate?

          If so, ITERATE through the OBX Group or Segment (depending on your variant).

          Prior to the ITERATE COPY @null to a temp variable (eg @obx_5)

          Inside the Xlate:

          CONCAT @obx_5 ….OBX(.).#4 –> @obx_5 (with a separator of .br <– you might need to escape the like this \.br\)

          AFTER the ITERATE COPY @obx_5 –> …OBX(.).#4

          Replace the elipses and the . after the OBX inside the () in the Address Path so that it is proper addressing for your situation.

          With each ITERATion the current positioned OBX-5 will be added to the temp variable with the .br separator. Thus the temp variable at the end of the ITERATion will have the total of all of the IB OBX-5 values each separated by .br.

          So the temp variable then needs to be COPY’d to the single OBX-5 OB.

          The above assumes there is no BULKCOPY involved nor is there a PATHCOPY for the OBX set in question which pre populates the OB OBX set.

          If the above is not true, then more work is need to clear what the BULK/PATH copies have done vis-a-vis the OBX set.

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

        • #86580
          Reena Gadhia
          Participant

            Thanks Jim. Will try it.

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