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.  CHOOSE Function

    Posted 12/10/04 10:03 AM

    Originally posted by: SystemAdmin


    I am a bit ashamed to admit that I cannot get my map rule utilizing this function to work properly. I am running a functional map that has an Index passed as one of the inputs. I need to use that index in conjunction with either a LOOKUP or EXTRACT if possible to output particular instances of a repeatable element.

    My rule is:

    =CHOOSE(TRIMRIGHT(EXTRACT(description D05 Fields:D05 Segments:InboundPO, TRIMRIGHT(tag D05 Fields:D05 Segments:InboundPO) = "CI")), (SeqNum * 3) - 2) + "<NL>" +

    CHOOSE(TRIMRIGHT(EXTRACT(description D05 Fields:D05 Segments:InboundPO, TRIMRIGHT(tag D05 Fields:D05 Segments:InboundPO) = "CI")), (SeqNum * 3) - 1) + "<NL>" +

    CHOOSE(TRIMRIGHT(EXTRACT(description D05 Fields:D05 Segments:InboundPO, TRIMRIGHT(tag D05 Fields:D05 Segments:InboundPO) = "CI")), SeqNum * 3) + "<NL>"

    This whole process is working with the CLONE function to capture every 3 instances of a repeatable segment.

    Any suggestions are greatly appreciated.

    Thanks,
    Jennifer
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: CHOOSE Function

    Posted 12/10/04 10:29 AM

    Originally posted by: SystemAdmin


    Hi Jennifer
    make sure your repeatable object is bound meaning, fixed length
    padded or otherwise that is probably your issue i ran into this just
    this week
    in help lookup section on index and choose and it discusses the bound
    issue and how to insure the oject is bound
    thanks
    Gary
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: CHOOSE Function

    Posted 12/10/04 12:15 PM

    Originally posted by: SystemAdmin


    All of the elements listed are fixed and padded to length with white space. I tried the CHOOSE without the final logic and it still failed. Here was my test:

    =CHOOSE(TRIMRIGHT(EXTRACT(description D05 Fields:D05 Segments:InboundPO, TRIMRIGHT(tag D05 Fields:D05 Segments:InboundPO) = "CI")), 2)

    This also produced no results.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 4.  Re: CHOOSE Function

    Posted 12/12/04 11:49 PM

    Originally posted by: SystemAdmin


    Have you checked that the extract works ok?
    Also when using multiple CHOOSEs in 1 rule, is it one of the functions that can only be executed once in a rule such as LOOKUP (I think they are called consumable functions). Try each chose individually and if they work you will ned to do each CHOOSE in an individual rule and then concatenate the result.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: CHOOSE Function

    Posted 12/13/04 05:05 AM

    Originally posted by: SystemAdmin


    I tried the first instance of the CHOOSE stand-alone without success, as well as the first EXTRACT stand-alone. The rule does work with just the EXTRACT function, but when I add the CHOOSE, it no longer returns a result.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 6.  Re: CHOOSE Function

    Posted 12/13/04 05:17 AM

    Originally posted by: SystemAdmin


    Just so I understand this correctly, the extract is selecting multiple descriptions and you want to choose the 2nd.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 7.  Re: CHOOSE Function

    Posted 12/13/04 05:29 AM

    Originally posted by: SystemAdmin


    Here is a sample of my input. There are 4 segments that are all being passed to the functional map:

    D05GT000019IN VARIOUS STYLES CI 001 310605882117 V6SSG
    D05GT000019 SANTA CI 001 310605882117 V6SSG
    D05GT000019 SNOWMAN CI 001 310605882117 V6SSG
    D05GT000019 GINGERBREAD MAN CI 001 310605882117 V6SSG
    The "CI" is a qualifier of sorts and the "D05" is a segment initiator. There are hundreds more of these "D05" segments with all different qualifiers. The first time the functional map runs I need to concatenate the 1st, 2nd and 3rd instances of the "CI" occurrences together using the EXTRACT and CHOOSE functions. The next time it runs, I need the 4th, 5th and 6th and so forth. I am using an INDEX for the functional map and then multiplication within the CHOOSE to ensure Ii grab the correct instances; however, the choose isn't working. Does that make more sense?
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 8.  Re: CHOOSE Function

    Posted 12/13/04 06:43 AM

    Originally posted by: SystemAdmin


    Have you looked at modifying your type tree.? If you add a D05_Group grouping level above the D05 segment that contains D05 segments having a range of 1:3, you will be able to use the D05_Group in your functional map call to pass 3 segments at a time.

    You partition the D05_Group to contain CI segments and non-CI segments. Your functional map would then become something like:

    FMap(EXTRACT(D05_Group, PARTITION(Qualifier:D05_Segment:D05_Group, "CI") ) )

    This should pass 3 of the desired CI D05 segments at a time.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange