IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
Expand all | Collapse all

WORD function without delimiter

  • 1.  WORD function without delimiter

    Posted 09/11/15 11:28 PM

    Originally posted by: Mendax


    Hi Everyone ,

    I have a question regarding the WORD function.

    For Example,  WORD( "AAAAA|BBB" , "|", 1) 

    The above would return "AAAAA"

    But WORD( "AAAAABBB", "|" ,1 )

    The above is returning AAAAABBB but actually, this should return nothing correct. ( Because there is no delimiter )

    Why the entire Text string is returned when there is no delimiter. Please explain.

    Thank You.

     


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


  • 2.  Re: WORD function without delimiter

    Posted 09/14/15 05:57 AM

    Originally posted by: Ejay


    Hi ,

     

    The documentation show an example :

    http://www-01.ibm.com/support/knowledgecenter/SSVSD8_8.4.0/com.ibm.websphere.dtx.funcexp.doc/references/r_funcs_express_WORD.htm

    for your case if your data are  :

    Line2:You may have already won 1 million dollars!;

     

    From this if you try :

    WORD ( Line2:Letter , "!" , 1 )

    there is only one separator, located at the end of the text object. As a result, the function sees everything before "!" as the first word. I would expect the same behavior if doesn't find the delimiter. the function sees the data as the first word.

     

    I would tend to say the rule is . If their is no separator or the separator is at end of data  , then there is only one word .

     

    Hope that help .

     

    Emmanuel

    • WORD ( Line2:Letter , "!" , 3 )

      Returns "none"

      Both nth and nth-1 separators are missing. In this example, there is only one separator, located at the end of the text object. As a result, there is no third word because the function sees everything before "!" as the first word.


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