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.  Problem with SEARCHUP Function

    Posted 02/08/10 09:43 AM

    Originally posted by: pje77


    I have two files in input:

    File1
    Group(s)
    Line(s)
    KeyField
    File2
    Group(s)
    Line(s)
    KeyField

    I have a functional map which is called as below:
    F_MAP(Group:File1, SEARCHUP(Group:File2, KeyField:Line:Group:File2, KeyField:Line:Group:File1))

    I expect the F_MAP to run only one time by Group:File1, but it runs for each Group:File1 as many times as there are Lines in the corresponding Group:File2.

    Any idea of the reason of this behaviour?

    Regards
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 2.  Re: Problem with SEARCHUP Function

    Posted 02/08/10 10:09 AM

    Originally posted by: repanzer


    A functional map will run once for any object you pass to it that repeats.

    If your input is

    File
    ....Records(s)
    ......group(s)
    ........field1
    ........field2

    and it's

    f_map(file, records)

    it will run once for each record.

    If you did;

    f_map(file, records, group)

    It would run once for each record and once for each group).

    Anything that repeats or their could be multiple of, like the return for a seachup, will yield more then one result if present. There are more then one Group(s) you are searching.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 3.  Re: Problem with SEARCHUP Function

    Posted 02/08/10 10:22 AM

    Originally posted by: repanzer


    Yeah, the searchup returns only one value, but your asking it against a repeating group. It seems like what's happening is;

    It grabs the 1st group:input1, then does a searchup to group:input2, goes into the F_map, maps the first output record. It then goes up a level, and the map says to itself, should I grab the next group:file1, or, do I still need to worry about the second object I have passed to the F_map, which is a searchup on a repeating group where the second field in the repeating group equals the second field in the input. Have I search every group:file2 for a record where the second field equals the second field in the input? No, so let me go do that.

    So you said, go searchup on a repeating group, so I'm going search every "group:input2" where KeyField:Line:Group:File2=KeyField:Line:Group:File1.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 4.  Re: Problem with SEARCHUP Function

    Posted 02/08/10 10:52 AM

    Originally posted by: pje77


    Yes, but I have only one Group:File2 where KeyField:Line:Group:File2=KeyField:Line:Group:File1
    And if I replace SEARCHUP by LOOKUP I get the expected result.
    That is why I am a bit confused with the behaviour
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Problem with SEARCHUP Function

    Posted 02/08/10 12:10 PM

    Originally posted by: repanzer


    So the question isn't why does searchup return X, it's why does searchup return X when I get the expected result from lookup X? Though I already answered the first one.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender