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.  Extract Decimal Part in Unit _WTX

    Posted 03/08/17 01:09 PM

    Originally posted by: NICK_R


    Team,

    As part of my mapping I have a requirement to select the integer part and fractional part from the same input value. For the INT part I got the function, I could not find how to address the fractional part issue.

     

    Input - Unit field : 123.05

    Output - Unit-I : 123

                   Unit-F : 05

     

    Unit -I is taken care of with the INT () function. Just need to handle the fractional part. Please drop your ideas.

    Regards,

    Nick


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


  • 2.  Re: Extract Decimal Part in Unit _WTX

    Posted 03/08/17 02:12 PM

    Originally posted by: DeM0n


    convert it to text and use WORD....

     

    Alternatively, you can play with IF, MID, LEFT, RIGHT, similar functions to get the desired result.....


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


  • 3.  Re: Extract Decimal Part in Unit _WTX

    Posted 03/21/17 10:11 AM
      |   view attached

    Originally posted by: PaulBrettIBM


    Surely (Input-INT(Input)) * 100 will get you what you need?

    Thank you.

    Paul

    Follow me on Twitter


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

    Attachment(s)

    zip
    SplitNumber.zip   2 KB 1 version


  • 4.  Re: Extract Decimal Part in Unit _WTX

    Posted 03/29/17 10:12 PM

    Originally posted by: NICK_R


    Paul. Thank you for your reply

     

    But this could achieve with only 2 digits after decimal point.

    For example,

    My input value to extract the fractional part could be 23.4, or 100.25 or 935.255 or 1000.2578 or 135.58904

     

    Integer part logic is handled and I got stuck with only this fractional logic

    The maximum digits after decimal points will be ''5'' for me. If I get only 2 digits after decimal point, your logic is 100% right.

    I am looking out to get one formula that applies for all the above 5 scenarios


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


  • 5.  Re: Extract Decimal Part in Unit _WTX

    Posted 03/30/17 04:36 AM

    Originally posted by: PaulBrettIBM


    Change the example :

     

    1.  Rule change to =(In1-INT(In1))*100000

    2.  Property change for NumberItem2 from Mni/Max 2/2 to 5/5.

     

    Results:

    23
    40000

    100
    25000

    935
    25500

    1000
    25780

    135
    58904

     

    Thank you.

    Paul

    Follow me on Twitter


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


  • 6.  Re: Extract Decimal Part in Unit _WTX

    Posted 03/30/17 09:12 AM

    Originally posted by: NICK_R


    Hey Paul. Thank you. I think I am missing something here. Your new example might support my logic.

    But your point 2.  Property change for NumberItem2 from Mni/Max 2/2 to 5/5.  is to change the Predefined cobol copybook's Output Item Min/Max ?

    I think I cannot change the predefined property but will try using the function Mini/Max to set to minimum of 1/1 as there could be 23.04 and max to 5/5 for this.

     

    So if I understand correctly, first change the required fractional part to max number required (*10000) and then use the Min/Max function?

     

    Please let me know if I understood correctly. I will trey few other things before that.

     


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