I am attempting to identify the cause of an issue I am encountering when creating a single OBX-5 field, for a single OBX segment, from the product of appending the contents of multiple OBX-5 fields from repeating OBX segments, using a foreach statement and append.
The TCL Pre Proc code fragment I’ve added to my xlate accomplished what I needed it to; however, it appears the variable created does not clear itself from memory between messages, which causes for the content from the previous message to be appended to the content of each following message. It’s as if the xlate is unwilling to let go of the string created from the previous message. This occurs despite attempting to clear the variable with a @null copy over. I am currently using the following TCL in my xlate for OBX-5:
set obx5 $xlateInVals
foreach $xlateInVals $obx5 {
set xOut [string map {{ “” } “”} [concat $obx5\.br\]]
break
}
append obx5out $xOut
set xlateOutVals [list $obx5out]
The OBX segment is set up as an iterating group at 1(0).1(0).3(%g1).
I’ve tried writing to a temp variable as well so I can clear it before iterating; however, this did not resolve the issue either. If anyone else has encountered a similar issue and if you were able to identify the root cause and solution, if you could please provide that information it would be greatly appreciated.
Thank you.
Respectfully,
Mohammed