IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  EITHER Function

    Posted 05/13/05 09:31 AM

    Originally posted by: SystemAdmin


    The EITHER function does not seem to work as advertised.

    =EITHER(LOOKUP( DateA , Kind = "RTWM"), NONE) returns DateA
    =EITHER(LOOKUP( DateA , Kind = "RTWM"), DateB) returns DateB
    =EITHER(DateA, DateB) returns DateB

    I only want to use DateB if DateA does not exists.

    Note: DateB is located first in the data.

    DSTX 6.7
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  Re: EITHER Function

    Posted 05/13/05 10:53 AM

    Originally posted by: SystemAdmin


    Without seeing the data and the input tree, I would suggest IF(PRESENT(DateA,DateA)DateB) or similar syntax. The means if DateA is present, use it, else use DateB. If Either finds something, it won't continue looking.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 3.  Re: EITHER Function

    Posted 05/16/05 12:45 AM

    Originally posted by: SystemAdmin


    You can't use 2 LOOKUPs in the same rule. It is what ascential call a (i think) consumable function where once it has read the data for the first lookup it does not reset to start a second lookup from the beginning of the data. There are a number of other functins that behave the same way.
    If you do each lookup in a separate card and then check for the presence of the card in your final card it will work ok
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 4.  Re: EITHER Function

    Posted 05/16/05 06:51 AM

    Originally posted by: SystemAdmin


    Thank-you Jan, you stated my thoughts exactly.
    Since the rule for which I would like to use the EITHER function is down about 2 levels of functional maps, I'll have to use a RUN map to implement your suggestion. While I don't like to use run maps, I think that in this situation I will be forced to.
    It's unfortunate that the EITHER function does not work as it is defined in the documentation.
    EITHER (try_this { , if_none—try_this } )

    Returns

    This function returns a single-object.
    Returns try_this, if try_this does not evaluate to NONE. Returns if_none_try_this, if try_this evaluates to NONE. Returns the next if_none_try_this, if the first if_none_try_this evaluates to NONE, and so on.

    Copyright © 2002 by Mercator Software, Inc.

    It should read
    Returns whatever argument is first in the data regardless of the order of arguments defined in the function.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 5.  Re: EITHER Function

    Posted 05/16/05 06:59 AM

    Originally posted by: SystemAdmin


    It's not the EITHER that doesn't work, it's the LOOKUP (and searchup, searchdown).
    The problem has been raised by lots of people for lots of versions but Mercator/Ascential and probably IBM say its a feature not a bug.

    I think FIND works ok multiple times in a rule. Perhaps you could use this for the initial selection.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 6.  Re: EITHER Function

    Posted 05/17/05 10:54 AM

    Originally posted by: SystemAdmin


    Sometimes, I just pass two copies of the input. It makes for flatter code that is easier to maintain.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 7.  Re: EITHER Function

    Posted 05/25/05 11:57 AM

    Originally posted by: SystemAdmin


    Hey All,

    I routinely use Jim's suggestion here. Hi Jim, it's me :-)

    This behaviour has is what Mercator used to term "Binding" and it has always been billed as a feature, not a bug. The Extract function also will cause this. Actually, if you know how to use it, it can be sort of cool to use, but normally, it just rears it's ugly head and bites the unsuspecting user in the nether regions.

    Brian Nobbe
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender