I’ve got a situation where I am trying to “clean up” some incoming data when I send it out. Specifically, I have TXA-23 coming in with (possibly) multiple repeating values, eg:
|ABC~XYZ|
This is fine as far as it goes, but sometimes what comes in (sending system’s fault) is something like:
|~ABC|
In this scenario I would like to “clean up” that field and send it out as:
|ABC|
for the benefit of the receiving system, which creates false errors if the first occurrence is empty. However, if there are multiples, like the first example, I’d like that to go out as is.
What I tried to do was set up a counting mechanism, and evaluate the value of the occurences via the ITERATE command, and map them out if valued but not if unvalued, like so:
COPY =0 —> @TXA23CNT
ITERATE
(Type: field, Basis: 0.(0).TXA.#23, Variable %f1)
[code]
COPY =0 —> @TXA23CNT
ITERATE
(Type: field, Basis: 0.(0).TXA.#23, Variable %f1)