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

Reformat date issue

  • 1.  Reformat date issue

    Posted 11/20/07 11:45 AM

    Originally posted by: SystemAdmin


    I am trying to reformat a date in WTX but my map rule is not working. I've tried several different rules and nothing seems to work. Please see details below:

    INPUT
    DepartureDateTime>2007-12-17T09:30:47.0Z</DepartureDateTime>

    Output should be: YYMMDDHHMM

    I searched the forum to see how to do this and used the rule below; however, I’m not able to reformat the date correctly. Can someone tell me what I’m doing wrong? Thanks

    FROMDATETIME(TODATETIME(DepartureDateTime, “CCYY-MM-DDTHH24:MM:SS”), “{YYMMDDHH24MM}”)
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Reformat date issue

    Posted 11/20/07 02:01 PM

    Originally posted by: SystemAdmin


    When going from a field defined as date in the type tree to a field defined as date in the output type tree, no extra reformatting is needed; it'll do it during the mapping.

    When you have a date on the input and a text field on the output, you use "FROMDATETIME()" or DATETOTEXT(), and when you have text on the input and a date on the output, you use "TODATETIME()".

    I've had problems using the "FROMDATETIME(TODATETIME())" scenario.

    You could always grab the info out of the input string using the MID() function a few times if the output is text.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: Reformat date issue

    Posted 11/20/07 03:50 PM

    Originally posted by: SystemAdmin


    thanks for the info. I will try the MIN function.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Reformat date issue

    Posted 11/20/07 02:01 PM

    Originally posted by: NancyR


    When I defined a Date & Time item in a type tree, the separator between the date and time was not inside the curly brackets: {CCYYMMDD}T{HH24MMSS}.

    Try changing your rule to:
    FROMDATETIME(TODATETIME(DepartureDateTime, “CCYY-MM-DD}T{HH24:MM:SS”), “{YYMMDDHH24MM}”)
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Reformat date issue

    Posted 11/20/07 02:57 PM

    Originally posted by: jvanboga


    I don't use the "T" in CCYY-MM-DDTHH24:MM:SS
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 6.  Re: Reformat date issue

    Posted 11/20/07 03:12 PM

    Originally posted by: NancyR


    If the "T" is in the input data we don't have a choice about using it unless you first edit the "T" out in the text string which would add processing overhead. Or am I missing something here?
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 7.  Re: Reformat date issue

    Posted 11/20/07 03:42 PM

    Originally posted by: jvanboga


    Obviously if it's in the input you have to account for it. Also, the purpose of the tool is to standardize data so if the system you are loading to requires it, t has to be there. If not the overhead is required to get rid of it.

    I just said I don't use it. If someone came to me and said they wanted to use it here I would ask what value it provided before allowing it. So, it’s an observation. Didn't intend to ruffle feathers. I apologize if I offended anyone.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 8.  Re: Reformat date issue

    Posted 11/20/07 04:13 PM

    Originally posted by: NancyR


    My feathers weren't ruffled. I just wanted to make sure I hadn't misinterpreted something.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 9.  Re: Reformat date issue

    Posted 11/20/07 03:45 PM

    Originally posted by: SystemAdmin


    The T is the separator between the date & time which is not in the input file, but its one of the requirements based on the TP. The format is set up in the type tree. I changed the rule to: =FROMDATETIME(TODATETIME( DepartureDateTime Comp FlightItinerary:FlightSegment, "CCYY-MM-DDTHH24:MM:SS"), "YYMMDDHH24MM") because it wasn't working with the {} for some reason, but still evaluating to none. I have a few more things to try, so I will keep you posted. Thanks.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 10.  Re: Reformat date issue

    Posted 11/21/07 10:37 AM

    Originally posted by: jvanboga


    This might work:

    change to text...

    FROMDATETIME(TODATETIME(DepartureDateTime Comp FlightItinerary:FlightSegment, "CCYY-MM-DDHH24:MM:SS"), "YYMMDDHH24MM")

    or

    retain time format...

    TODATETIME(FROMDATETIME(DepartureDateTime Comp FlightItinerary:FlightSegment, "CCYY-MM-DDHH24:MM:SS"), "YYMMDDHH24MM")
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 11.  Re: Reformat date issue

    Posted 11/26/07 09:49 AM

    Originally posted by: SystemAdmin


    Thanks Nancy- I changed the rule to: =FROMDATETIME(TODATETIME(DepartureDateTime ,"{CCYY-MM-DD}T{HH24:MM:SS}"), "{YYMMDDHH24MM}") and it works!! Thanks alot.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 12.  Re: Reformat date issue

    Posted 11/20/07 02:03 PM

    Originally posted by: SystemAdmin


    You have DepartureDateTime, “CCYY-MM-DDTHH24:MM:SS”),

    but looking at the departure date, it has the "0Z" on the end. Maybe that's the problem. (?)
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 13.  Re: Reformat date issue

    Posted 11/20/07 03:40 PM

    Originally posted by: SystemAdmin


    thanks for pointing that out, I removed the time zone, but still same results.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender