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.  Temp Card

    Posted 10/14/04 12:52 PM

    Originally posted by: SystemAdmin


    Hi,

    I have a input series of "TextDate General Element" ,

    IF(LEFT(Text Data General Element:ObjectValue General Choice:In1,3)="035" & MID(Text Data General Element:ObjectValue General Choice:In1,22,2)=X12 Elements:CodeConversionGroup Groups:In3,EDIFACT Elements:CodeConversionGroup Groups:In3)

    I am looking at the first 3 elements and if it is "035" and if the elements in the position 22and23 are equal to X12 Codes(This is a separate type tree which has a Lookup file as its input . The file contains all the valid X12 codes that we use and the corresponding EDIFACT codes .

    So now when we use the above rule it is working fine ,
    But when I use a negative logic and change the rule as shown below
    it does not work.
    IF(LEFT(Text Data General Element:ObjectValue General Choice:In1,3)="035" & MID(Text Data General Element:ObjectValue General Choice:In1,22,2)!=X12 Elements:CodeConversionGroup Groups:In3,"7101")

    -----OR-----

    IF(LEFT(Text Data General Element:ObjectValue General Choice:In1,3)="035" & MID(Text Data General Element:ObjectValue General Choice:In1,22,2)=X12 Elements:CodeConversionGroup Groups:In3,NONE,"7101")
    It just puts "7101" even if its a valid X12 code that's present in the Lookup file. All this logic is written in a Functional Map so is there any way I can store the EDIFACT code in a Temp Output Card within the functional map
    and if that Temp Card is absent then I can hard code "7101".

    All suggestions are greatly appreciated.

    Thanks,
    Sai.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  Re: Temp Card

    Posted 10/18/04 01:20 PM

    Originally posted by: SystemAdmin


    I'm not sure I understand the question well enough to tell you what to do, but I see some differences between the rule that works and the ones that don't that might be the difference you need to understand.

    In your original rule, you say

    IF(LEFT(Text Data General Element:ObjectValue General Choice:In1,3)="035" & MID(Text Data General Element:ObjectValue General Choice:In1,22,2)=X12 Elements:CodeConversionGroup Groups:In3,EDIFACT Elements:CodeConversionGroup Groups:In3)

    The characteristic of that rule that's important to me is the fact that the rule returns NONE when things don't match. For each execution of the rule, we'll look at one Text Data General Element, and one X12 Element; if the first three characters of Text Data General Element are "035", and the later two characters of it match the X12 Elements that we're looking at, the result will be the EDIFACT Elements in the same CodeConversionGroup Groups:In3; otherwise, the result of the rule will be NONE.

    When the result of the mapping rule is NONE, the rule gets executed again, with a different set of ingredients. So if the result of the first execution is NONE, the rule will be executed again with a different Text Data General Element or a different X12 Element. This will continue until the result isn't NONE, or we run out of unique sets of ingredients.

    In your second rule, the first part of the rule is the same (the "035" part), but the next part now says "if those later characters aren't equal to the X12 Element that we're looking at, output a literal". So any time the later characters don't match the X12 Element we're looking at, we'll get a non-NONE result, and we won't look at other things. Any time the later characters don't match the FIRST X12 Element, we're finished with the rule right away!

    The third rule has a similar problem: this time, if everything matches, we'll explicitly produce NONE (and run the rule again until stuff doesn't match), but if something doesn't match, we'll produce the literal.

    It isn't obvious that the rule is executed multiple times in the original rule; to prove it to yourself, make the output object of the rule a series, and make the output not be NONE:

    whatever (s) = IF(LEFT(Text Data General Element:ObjectValue General Choice:In1,3)="035" & MID(Text Data General Element:ObjectValue General Choice:In1,22,2)=X12 Elements:CodeConversionGroup Groups:In3,EDIFACT Elements:CodeConversionGroup Groups:In3, "Didn't Match")

    You'll see a bunch of "Didn't Match" before you'll get your old output.

    Because of this behavior, it's tricky to "use negative logic".
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: Temp Card

    Posted 10/19/04 10:56 AM

    Originally posted by: SystemAdmin


    Thanks for the reply BOB.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender