Help with xlate, please!

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Help with xlate, please!

  • Creator
    Topic
  • #51258
    Tom Arrowsmith
    Participant

    I am trying to write an xlate where if the PV1-3 is NOT equal to one of three different values – AND the PV1-2 is equal to E, then change the Message from an A08 to an A04.

    I have experienced success if stipulating only one of the three values with this code:

    0(0).PV1.00133.[0]   ne=ERL &&  0(0).PV1.00132  eq=E

    then copy….(blah, blah)

    that works….

    …. It’s when I try to say (ne=ERL || ne ERP || ne=ERC) && eq=E that I run into trouble.

    I want the A08 message to be translated to an A04 if the PV1-3 is equal to ERL or ERP or ERC – And the PV1-2 is equal to E

    Help, anyone?

    Thanks!

    Tom Arrowsmith

    (703) 779-5474

Viewing 2 reply threads
  • Author
    Replies
    • #69411

      Tom, try using a nested IF statement instead.

      Code:

      IF blah || blah || blah
       IF blah
         do it

      -- Max Drown (Infor)

    • #69412
      Robert Milfajt
      Participant

      It’s logic 101, if you have (ne ERL) OR (ne ERP), there is a conflict in that ERP does not equal ERL so the first part is true even though the second is false, so it will execute because of the OR.

      You need to use AND:

      if (ne ERL) and (ne ERP) and (ne ERC) will be true if PV1-3 is not equal to ERL, ERP and ERC, i.e., any other value.  Otherwise, if it is equal to one of the three values, one of the arguments evaluates to false and thus the whole expression is false.

      Hope this helps,

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #69413
      Tom Arrowsmith
      Participant

      I got it to work with the nested if by using the following:

      IF ! (0(0).PV1.00133.[0]  eq=ERC ||  0(0).PV1.00133.[0]  eq=ERP || 0(0).PV1.00133.[0]  eq=ERL)

      (nested) IF  0(0).PV1.00132 eq=E

                  then do it……

      Thank you both for your help!

      Tom

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

Forum Statistics

Registered Users
5,125
Forums
28
Topics
9,294
Replies
34,439
Topic Tags
287
Empty Topic Tags
10