IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
 View Only
Expand all | Collapse all

Date Time Conversion issue

  • 1.  Date Time Conversion issue

    Posted Fri August 04, 2017 06:02 PM

    Originally posted by: Shane.kelly55


    Hey Guys,

    I got an easy one for you.  I have an X12 output card with an item with a subclass of Date & Time with a format of {HH24MM[SS[1-2]}.  My Trade Partner only wants HH:MM:SS but not matter what function/rule i apply i always get the extra 2 characters in HH:MM:SS:SS.  I assume that last 2 is mili seconds or fractions of a second.

    I have used every combo of FROMDATETIME, TIMETOTEXT etc trying to find ways of only writing the 6 characters i need rather than the 8.

     

    What am i doing wrong here?  I feel dumb!!

    Thanks,

    Shane


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


  • 2.  Re: Date Time Conversion issue

    Posted Mon August 07, 2017 05:50 AM

    Originally posted by: pcp


    Hi Shane,

    I have faced this issue many times as well.

    There are a couple of solutions:

    1) Update the type tree to {HH24MM[SS]}, this way you will definitely get the 6 characters as supposed to the 8. (But make sure this "time" field is not used in other parts of the type tree)

    2) Change the field to a text field and use the FROMDATETIME function to convert the time to the desired format.

    Thanks,

    Phil


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


  • 3.  Re: Date Time Conversion issue

    Posted Mon August 07, 2017 11:41 AM

    Originally posted by: Shane.kelly55


    Hey Phil,

     

    THanks for responding.  I cant change the Type Tree so am i correct in assuming even if i instruct WTX to put HHMMSS in that field, WTX will assign the last two characters?

     

    EDIT: I got it working with =TEXTTOTIME(LEFT(TIMETOTEXT(Time), 6))


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


  • 4.  Re: Date Time Conversion issue

    Posted Tue August 08, 2017 06:55 AM

    Originally posted by: pcp


    Hi Shane,

    That's great you were able to come up with a solution using mapping functions.

    Yes that is correct, for some reason that was what happened. I was stumped as well.

    Since we had the option of updating the type tree, I used the first option I had provided.

    Phil

     


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