Dates
in the Julian calendar are called Julian dates which are not supported in
Informatica. We need to convert the date to Gregorian calendar for further Informatica
processing.
We
can use TO_DATE function to convert the Julian date to
Gregorian in an expression and then load to target. The TO_DATE function
converts a string with the format you specify to a date-time value. TO_DATE is
generally used to convert strings from flat files to date-time values.
TO_DATE
(DATE_JULIAN, ‘YYYYDDD’)
Let’s
see an example, I have a flat file with employee joining date in Julian. I want
to load this date as Gregorian to my target table.
Julian
Date: 2015001 (YYYYDDD)
Converted Date : 01-JAN-15
Converted Date : 01-JAN-15
We
can use the below expression in an output port using Expression transformation.
This will check whether the input Julian date is in ‘YYYYDDD’ format, if YES
TO_DATE will convert the date to Gregorian and if NO To_DATE will use a default
date of 01-01-0001 (01-JAN-01).
IIF(IS_DATE(Date_Join_Julian,’YYYYDDD’)=TRUE,
TO_DATE(Date_Join_Julian,’YYYYDDD’),TO_DATE(‘01010001′,’MMDDYYYY’))
TO_DATE(Date_Join_Julian,’YYYYDDD’),TO_DATE(‘01010001′,’MMDDYYYY’))
Input Flat File – Joining Date is in
Julian Format (YYYYDDD)
Mapping to Convert Julian to Gregorian Date Using Expression Transformation
Mapping to Convert Julian to Gregorian Date Using Expression Transformation
Target Table – Dates are now converted
to Gregorian date format. Since the input dates are not valid for the last two
records, it’s been converted to hard coded default values (01-JAN-01).
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.
ReplyDeleteSoftware Testing Services
Functional Testing Services
Test Automation Services
QA Automation Testing Services
Regression Testing Services
API Testing Services
Compatibility Testing Services
Performance Testing Services
Security Testing Services
Software Testing Company
Software Testing Services in USA
Software Testing Companies in USA
So far out of all the blogs,I personally feel this blog is just awesome.There are soo many information provided here in this blog. Therefore It is totally amazing...
ReplyDeleteSoftware Testing Services
Software Testing Services in India
Software Testing Companies in India
Software Testing Services in USA
Software Testing Companies in USA
Software Testing Companies
Software Testing Services Company
QA Testing Services