Splitting 1 ORM into multiples based on value in an OBX:5

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Splitting 1 ORM into multiples based on value in an OBX:5

  • Creator
    Topic
  • #54414
    Jaye Costello
    Participant

      Here’s the scenario:

      I need to ITERATE thru the OBX segment looking for a specific value in OBX:3.  If I see that value, I need to look at the value in the corresponding OBX:5.  That value is how many times I need to repeat the message.

      Example:

      I have 5 OBX segments.  I ITERATE thru and find one that contains “CODPROMPT-2” in OBX:3. I then look in the OBX:5 and see a value of 4.  I need to make 4 copies of the same message.  (Minor tweak done in OBR:2 on the copied messages.)

      The issue I am having is I have nothing to iterate thru to create my copies.  I’ve looked all thru Clovertech, got my SUPPRESS and CONTINUE in place, but nothing to loop with.  I’ve tried everything I can think of and am stuck.  🙁

    Viewing 3 reply threads
    • Author
      Replies
      • #81370
        James Cobane
        Participant

          Jaye,

          You might be able to accomplish this by using a ‘list’ iteration with the value from OBX 5  used to create the BASIS for the list, (i.e. if the value is 4, you create a list with 4 elements) or something like that.  Not sure if you can somehow substitute a variable for the BASIS, but there might be some work around to trick it with the iteration variable (i.e. $%l1 ).  I don’t have any solid/proven suggestion for this scenario, just brainstorming…. 🙂

          Jim Cobane

          Henry Ford Health

        • #81371
          Jaye Costello
          Participant

            Terrific thought.  I hardcoded in values of 1 2 3 in the Basis for the List, and was able to get it to work.  But that was hardcoding.  🙂

            Anyone know how to take a number (i.e. 4) and have it output 1 2 3 4; then place that in the basis for my interation?

          • #81372
            Yves Guerin
            Participant

              Hello,

              I did some screenshots

              Regards,

              Yves

            • #81373
              Yves Guerin
              Participant

                Hello,

                Use the CONTINUE keyword for each new message and KILL for the last one or do it with a tcl proc before entering the xlate.

                I did it for transforming a A17 to two A02 in xlate.

                Regards,

                Yves

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