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.  Date conversion

    Posted 05/24/11 04:34 AM

    Originally posted by: Jaango


    Hi All,

    How can i use the functions in extender studio, to convert Julian date to calendar date. I am transforming a copybook data to xml, UTF8. However the date field is in Julian format.

    Example - 2010256 to be converted to 2012-2-25
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 2.  Re: Date conversion

    Posted 05/24/11 06:48 AM

    Originally posted by: vijji_WTX


    Hi ,
    To support Julien dates , we have CCYYDDD format available in Date&time formats. You can select this and can read the data . You can use Fromdatetime() to achieve this. for example

    FROMDATETIME (Julien date Field,″{CCYY-MM-DD}″)

    Hope this helps

    reg,
    Vijji
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: Date conversion

    Posted 05/24/11 06:59 AM

    Originally posted by: TarunB


    You can use the usual date conversion routines - FROMDATETIME or TODATETIME.

    Another option is to format your input and output fields as dates, and drag and drop.

    Julian date format is simply CCYYDDD for the value you have.

    As an example, assuming you are using Text based input and output fields :-

    =FROMDATETIME (TODATETIME ("2010256", "{CCYYDDD}") , "{CCYY-MM-DD}")
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Date conversion

    Posted 05/25/11 01:40 AM

    Originally posted by: Jaango


    Hi,

    Thanks for the responses. However when I tried with =FROMDATETIME (_LSRR__ACCOUNT_BLOCKDATE_2 Field:_LSRR__ACCOUNT_INFO_GROUP Group:InputCopy,"{CCYY-MM-DD}"), I got argument#1 was invalid.

    Then when I tried with =FROMDATETIME (TODATETIME (_LSRR__ACCOUNT_BLOCKDATE_2 Field:_LSRR__ACCOUNT_INFO_GROUP Group:InputCopy, "{CCYYDDD}") , "{CCYY-MM-DD}"), I was getting no error. But the date was coming as '2010-09' for 2010256. Any thoughts?
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Date conversion

    Posted 05/25/11 01:46 AM

    Originally posted by: Jaango


    I am sorry. For the second one, I got, 2010-09-13. However I am supposed to get 2012-02-25 rite?
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 6.  Re: Date conversion

    Posted 05/25/11 02:29 AM

    Originally posted by: Jaango


    Please ignore my previous post. I checked in excel using the formula, =DATE(LEFT(A2,4),1,RIGHT(A2,3)). The result is matching with the value, 2010-09-13.

    Thanks for your help. We were thinking to do this logic outside wtx. This helped us a lot.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 7.  Re: Date conversion

    Posted 05/25/11 02:51 AM

    Originally posted by: karthikpc


    Jaango,

    2010256 is equal to 2010-09-13. ( 256th day of 2010). If you want, 2012-02-25, then you will have to give 2012056 as an input.

    FROMDATTIME, TODATETIME are to convert date from one format to another format only. if you want to add days, then you will have to use ADDDAYS etx functions.

    Cheers,
    Karthik
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 8.  Re: Date conversion

    Posted 05/25/11 06:53 AM