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.  Using CHOOSE and EXTRACT functions in conjunction

    Posted 12/13/11 02:49 PM

    Originally posted by: JRules


    The title says it all! Is it possible to filter out (using CHOOSE function) the results of a series (from EXTRACT function)? Below is the code I am trying to get to work:

    =F_TEST(CHOOSE(EXTRACT(REF_ZZ_Mutually_Defined REF Segment:Member_Id REF Choice_Group:Member REFs Unordered_Group:In_Member,Ref#Qual'r Element IN Member REFs Unordered_Group:In_Member="ZZ"),3))

    I am attaching a picture of the output TT and hopefully it makes a little more sense.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: Using CHOOSE and EXTRACT functions in conjunction

    Posted 12/19/11 03:34 PM

    Originally posted by: repanzer1


    So if the extract returns more then 2 records, you want to choose the third one, correct? If that rule is not working and you tested it knowing there were more then 2 records returned, you may have to split it up. Meaning, you may need to do the extract on a group output field, then Choose the one after it is built, not choose a record out the extract in the same rule. This is an assumption, but you may want to test it out that way.
    There are 10 types of people in this world. Those who understand binary and those who don't.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 3.  Re: Using CHOOSE and EXTRACT functions in conjunction

    Posted 12/20/11 11:33 AM

    Originally posted by: JRules


    Repanzer - Thanks for your response.

    And yes, the Extract returns more than 2 records and I want to choose the 3rd one.

    "you may need to do the extract on a group output field, then Choose the one after it is built, not choose a record out the extract in the same rule."

    I am fairly new to WTX, so please post an example code of what you mean by your comment (quoted above). Does WTX have something like a temp variable/group?
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 4.  Re: Using CHOOSE and EXTRACT functions in conjunction

    Posted 12/21/11 09:17 AM

    Originally posted by: repanzer1


    Ok, first of all, now that I look at the picture, what you did was, you went to a group where there up to 9 allowed, R932_CHR_2_Group(0:9), you right clicked it and added an index, then you put the rule on that index. You are trying to extract multiple records into an index that can only contain 1, hence the big "1" right after the;

    R932_CHR_2_Group[1]

    You will only get one in your output, regardless of how many records are returned in the extract. Put the rule in the group with the (0:8), maybe it will work.

    What I meant above that you asked about was, what you do is you add an output card to your map and make it the first one. For your example, your type tree for this card would be a file of records(s), and each record would contain the fields of the REF segment. In that output card, you do your extract, but you do not do the CHOOSE. So now when the map runs, the first output card contains the records you want for a field later on. When you get to the field you are trying to populate with the code you have above, you just do the choose against the output in the first output card;

    =CHOOSE(Record:Outputcard1, 3).

    I’m assuming that you know how to make “copies” of the output card so you can map from it, by putting your curser over the area where it says the card number and card name, holding down the left mouse click and dragging the curser off the card.
    There are 10 types of people in this world. Those who understand binary and those who don't.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 5.  Re: Using CHOOSE and EXTRACT functions in conjunction

    Posted 12/21/11 10:55 AM
      |   view attached

    Originally posted by: NancyR


    I've added a second output card to the example I sent you previously. The executable map Map extracts all the REF segments where REF01="ZZ". The second output card chooses the third REF segment from those.

    To incorporate my map into yours, make those two output cards the first two outputs in your executable map. So your present output 1 and 2 will now be output 3 and 4. In output card #3 (Out_BlueStar_Proprietary), pass the second output card as an additional parameter for F_Transaction_Set. In F_Transaction_Set pass it as an additional parameter to F_Member and from there pass it to F_Test.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender

    Attachment(s)



  • 6.  Re: Using CHOOSE and EXTRACT functions in conjunction

    Posted 12/21/11 12:09 PM

    Originally posted by: JRules


    Nancy - Thanks for your response. I see that you have created a new type tree called "Tree.mtt". Sadly, I am not supposed to build any new type trees in my project.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 7.  Re: Using CHOOSE and EXTRACT functions in conjunction

    Posted 12/21/11 12:32 PM

    Originally posted by: NancyR


    Not sure why you are not allowed to create a type tree. You should use the Sink Adapter for the first two cards so the output will only be created in memory and disappear once your map completes. Using these scratch cards is a very common WTX technique.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 8.  Re: Using CHOOSE and EXTRACT functions in conjunction

    Posted 12/21/11 12:04 PM
      |   view attached

    Originally posted by: JRules


    Repanzer - I followed your suggestions (to the T??) and created a new output card, attached it to the type tree, set the type to be the group of REFs. And then...I got a new output card asking me to put in some rules on the elements. I think I am really confused here. I am attaching the maps and files. Could you please take a look? Thanks for the help again.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange

    Attachment(s)



  • 9.  Re: Using CHOOSE and EXTRACT functions in conjunction

    Posted 12/21/11 12:07 PM

    Originally posted by: JRules


    Oh and guys... per the project constraints that I am working on, I am NOT supposed to create/modify any existing type trees :(
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender