Iterate to add an extra OBX

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Iterate to add an extra OBX

  • Creator
    Topic
  • #48250
    Robin Starkes
    Participant

      I need to add an extra OBX segment at the end of iterate. This is what I have. I’m using an existing iterate to get a count on the number of OBX segments, but this is putting “HELLO” into the first repeating OBX and I need it to be in the last OBX. The value for $%g2 I’m getting is 22 so I would need “HELLO” in OBX.00573 the 22nd repeat.

      Can someone assist me.

      ITERATE

      TABLE 1(0).1(0).1(0).OBX.00571 -> 1(0).1(0).1(%g1).OBX.00571.[0]

      TABLE 1(0).1(0).1(0).OBX.00571 -> 1(0).1(0).1(%g1).OBX.00571.[1]

      TABLE 1(0).1(0).1(0).OBX.00571 -> 1(0).1(0).1(%g1).OBX.00571.[2]

      MATH:ADD =1 $%g1 -> $%g2

      COPY =HELLO -> 1(0).1(0).1($%g2).OBX.00573

      Thanks

    Viewing 4 reply threads
    • Author
      Replies
      • #58147
        Bill Bertera
        Participant

          Robin Starkes wrote:

          I need to add an extra OBX segment at the end of iterate. This is what I have. I’m using an existing iterate to get a count on the number of OBX segments, but this is putting “HELLO” into the first repeating OBX and I need it to be in the last OBX. The value for $%g2 I’m getting is 22 so I would need “HELLO” in OBX.00573 the 22nd repeat.

          Can someone assist me.

          ITERATE

          TABLE 1(0).1(0).1(0).OBX.00571 -> 1(0).1(0).1(%g1).OBX.00571.[0]

          TABLE 1(0).1(0).1(0).OBX.00571 -> 1(0).1(0).1(%g1).OBX.00571.[1]

          TABLE 1(0).1(0).1(0).OBX.00571 -> 1(0).1(0).1(%g1).OBX.00571.[2]

          MATH:ADD =1 $%g1 -> $%g2

          COPY =HELLO -> 1(0).1(0).1($%g2).OBX.00573

          Thanks

          I think take the $ out of you last copy:

          COPY =HELLO -> 1(0).1(0).1(%g2).OBX.00573

        • #58148
          Robin Starkes
          Participant

            I tried that and it copies HELLO to all OBX.00573 fields including 22.

          • #58149
            Jim Kosloskey
            Participant

              Robin,

              I think you need to put the copy of hello after and outside of your iterate tree. So when the iteration is all done, then copy hello. As it is now, the copy is happening on every iteration and I don’t think you want that.

              Bill is correct about the $ in the address path.

              Jim Kosloskey

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

            • #58150
              Jim Kosloskey
              Participant

                Robin,

                I think you need to put the copy of hello after and outside of your iterate tree. So when the iteration is all done, then copy hello. As it is now, the copy is happening on every iteration and I don’t think you want that.

                Bill is correct about the $ in the address path.

                Jim Kosloskey

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

              • #58151
                Robin Starkes
                Participant

                  That’s the piece I was missing. I need it outside the iterate without the $.

                  Thanks you guys a wonderful.

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