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.  How can delete non-numeric data from my input data

    Posted 12/14/12 10:59 AM

    Originally posted by: SystemAdmin


    Hello everyone.

    How i can delete non-numeric data from my decimal field ? For example i got the following number ( 383.7064628) and my desired result is (3837064628) i used the LEAVENUM function , configured my field item subclass in number and the pad value to <sp> without success.

    Any ideas?
    Regards from Colombia
    Cristian.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  Re: How can delete non-numeric data from my input data

    Posted 12/14/12 11:27 AM

    Originally posted by: mikedb


    The type for your input/output and actual rule you're using would be helpful. That being said, remember this function works on a text item and returns a text item. If your input is a number and your output is text:

    =LEAVENUM(NUMBERTOTEXT(SomeNumber:In1))

    If your input is a number and your output is a number:

    =TEXTTONUMBER(LEAVENUM(NUMBERTOTEXT(SomeNumber:In1)))
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: How can delete non-numeric data from my input data

    Posted 12/14/12 11:48 AM

    Originally posted by: SystemAdmin


    Hello and thanks for your answer.

    I'm just test your suggest solution and based in my input (xsd:decimal) and my output (decimal) i took the second option of your answer. However it show the error " one or more inputs was invalid" and in the results of the map trace appear my number with the spaces and the dot (.) And the errors "failed item presentation test for TYPE" and "INVALID data for type".

    It's some type of special protocol with the decimal data? Why the decimal presentation is interpreted as character?
    Thanks ans regards from Colombia
    Cristian

    PS: sorry for the double post, an error with my mobile network causes what i send two post of the same question.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: How can delete non-numeric data from my input data

    Posted 12/14/12 12:14 PM

    Originally posted by: SystemAdmin


    The error in your trace file has nothing to do with your map rule. Your map never got to trying to output data. Validation is only performed as your input data is read. So your input type tree doesn't match your input data.

    If your input element is formatted like the following type tree export, you should be able to read it in:

    <ITEM SimpleTypeName="DIVISA_TASA" CategoryOrItemParent="Field CopyBook" Description="DIVISA-TASA" partition="NO" OrderSubtypes="ASCENDING">
    <CharNumber>
    <Decimal>
    <TotalDigits Min="0" Max="13"/>
    <PadNumber Justify="RIGHT" ApplyPad="ANYCONTEXT"><PadValue><SP></PadValue>
    <PaddedToFixedSize Length="13" SizedAs="BYTES"/>
    </PadNumber>
    <DecimalFormatString>{####http://&apos;.&apos;##}</DecimalFormatString>
    </Decimal>
    <Western CharSet="NATIVE"/>
    <ValueRestrictions IgnoreCase="NO" Rule="INCLUDE"></ValueRestrictions>
    </CharNumber>
    </ITEM>
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 5.  Re: How can delete non-numeric data from my input data

    Posted 12/14/12 02:27 PM

    Originally posted by: SystemAdmin


    Hello and thanks for your answer;

    So, if the problem does nothing to do with the map, it seems that the input is the principal item to check the text input for the map, if this is true, where i can tailor this line?

    <DecimalFormatString>{####http://'.'##}</DecimalFormatString>

    Checking all the project, i dont see any syntax error, for each try to "map" correctly with functions and so on, i can never got to eliminate this dot "." in my text input, i test this deleting manually the char in the text input and the map goes to "Input valid but unknown data" validation, i only need to eliminate the spaces and the character "." of my text input. I test the functions given by another cooperator in this thread (thanks for this code lines :D ) but every test i gon by result an error. its my first time working with decimal data, and i can t believe that it was to troublesome to tailor.

    If i can delete this character (.) i can successfully deploy the development. Exist another method to delete non-numeric chars in a text input?

    Regards from Colombia;
    Cristian.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 6.  Re: How can delete non-numeric data from my input data

    Posted 12/14/12 03:37 PM

    Originally posted by: SystemAdmin


    When you're building a map, you first do nothing but define your input card. Then turn on the trace for input. Until you can read your data without generating an .MTR trace file, there is no reason to continue.

    What I provided was the export of the type tree for the stated field, DIVISA_TASA. The decimal is formatted under Item Subclass=Number, Presentation=Decimal, Size=Min:0,Max:13, Separators=Yes:Format=####http://.##,Pad=Yes,Value=<SP>,Padded to=Fixed Size, Length=13, Sized as=Bytes, Justify=Right The forum app messed up the my previous post. The format I used was 4 pound signs, left bracket, decimal point, 2 pound signs, right bracket. There are other formats available via a drop down list and I believe you can define your own.

    When I run your map using your map rule, "=TEXTTONUMBER(FILLLEFT(LEAVENUM(NUMBERTOTEXT(DIVISA_TASA Field:entradafuncional)),"0",200))", I get:

    <tns:divisa>
    <tns:codigoDivisa>ARS</tns:codigoDivisa>
    <tns:codigoPais>ARN</tns:codigoPais>
    <tns:nombre>NUEVO PESO ARGENTINO</tns:nombre>
    <tns:tasa>3837064628</tns:tasa>
    <tns:fechaCambio>2012-10-29</tns:fechaCambio>
    </tns:divisa>

    The following also works. TEXTTONUMBER strips off the zeroes you add by the FILLLEFT.

    =TEXTTONUMBER(LEAVENUM(NUMBERTOTEXT(DIVISA_TASA Field:entradafuncional)))
    /* =TEXTTONUMBER(FILLLEFT(LEAVENUM(NUMBERTOTEXT(DIVISA_TASA Field:entradafuncional)),"0",200))
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 7.  Re: How can delete non-numeric data from my input data

    Posted 12/14/12 04:31 PM

    Originally posted by: SystemAdmin


    Hello;

    I can´t believe that the separators and the decimal format was the cause of the problem, really i don't know about this option in the mapping properties, thanks again for your help and your patience, now i can continue with the rest of the development of my project.

    One more question, where i can find training for WTX and Datapower? like videos or recorded webinars? i got a good number of PDF's but a got a little experience with both software.

    Thanks and Regards from Colombia
    Happy Holidays;

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


  • 8.  Re: How can delete non-numeric data from my input data

    Posted 12/14/12 06:46 PM

    Originally posted by: SystemAdmin


    See https://www.ibm.com/developerworks/forums/thread.jspa?messageID=13990903&#13990903

    Also my earlier posting today entitled "Free online training WTX sandbox for beginners".
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender