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.  Calculate index

    Posted 03/02/11 07:53 PM

    Originally posted by: Geetha Nagarajan


    Hi,

    Am sorry am posting this again, my previous questions seems to have disappeared!

    Here is my input 1.
    HI*BF:41071*BF:570*BF:5849*BF:V667*BF:5070*BF:72888*BF:27801~

    Here is my input 2.
    5849

    How do I find out that 5849 was the 3rd occurrence of the BF series?

    Not sure how to do this... any help is greatly appreciated!

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


  • 2.  Re: Calculate index

    Posted 03/03/11 04:42 AM

    Originally posted by: vijji_WTX


    Hi Geetha,

    Use Word function as
    IF (PRESENT(WORD( recordgroup,"BF",3)) , "YES" , "NO")

    Hope this helps you out.

    reg,
    Vijji
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 3.  Re: Calculate index

    Posted 03/03/11 07:57 AM
      |   view attached

    Originally posted by: TarunB


    I would assume that you don't want a hard coded solution to search only for the 3rd occurrence. A technically superior option is to create a map which can give you the resulting index for any lookup value that you choose. You can do this as follows:

    1) Read in the data row and your lookup value (5849) as 2 inputs
    2) Have a single output with a functional map call which EXTRACTs your chosen value from the main data row, as well as selecting the INDEX of that occurrence. This makes use of the binding between the extracted data and the source data, so allowing you to pull out the relevant index value.

    Your main input data structure would consist of:
    Initiator = HI
    Terminator = ~
    Record type = explicit infix delimited with asterisk
    Record format = consists of a sub-group containing BF and number delimited by colon

    It's probably easier for you to just look at the map I knocked up (see attached). This is of course a simplified sample that you are free to build upon.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange

    Attachment(s)



  • 4.  Re: Calculate index

    Posted 03/03/11 06:12 PM

    Originally posted by: Geetha Nagarajan


    Thank you so much for taking the time to put together an example!

    I have customized it to meet my needs and it works, the mistake was in the way I was computing the index.

    YOU MADE MY DAY TARUN!

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


  • 5.  Re: Calculate index

    Posted 03/03/11 06:13 PM

    Originally posted by: Geetha Nagarajan


    Thank you for taking the time to respond Vijji!
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 6.  Re: Calculate index

    Posted 03/28/11 08:57 AM

    Originally posted by: Ninjasword


    Hi Geetha,

    My suggestion for your question is ..

    IF (WORD( recordgroup,"BF",3)=5849) , "YES" , "NO")

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