Page 1 of 1

Unusual date conversion

Posted: Wed Mar 20, 2013 1:12 am
by chandra.shekhar@tcs.com
Hi,
My source is a File and contains a varchar field which actually stores date in the basic format YYYY-MM-DD.
In the transformer I didn't use any conversion methods for date conversion since the date is in default datastage format. Well this worked perfectly until I validated the data.
For spaces, some random date e.g 2009-07-28, 2010-05-04 etc is getting generated. What could be the reason for this ?

Posted: Wed Mar 20, 2013 1:37 am
by ray.wurlod
The only explanation is that the design specifies generation of a random date. Does the extended column metadata include a random Generator property?

Posted: Wed Mar 20, 2013 1:54 am
by chandra.shekhar@tcs.com
The extended column metadata doesn't have anything enabled..

Posted: Wed Mar 20, 2013 2:58 am
by ray.wurlod
Then you'd better show us exactly what you are doing.

Posted: Wed Mar 20, 2013 3:57 am
by chandra.shekhar@tcs.com
That's what Ray, I am doing nothing extra.
Just directly mapping a String Field(which contains date) to a Date Column.
Ideally I should use a StringToDate function but since my dates(from source) are in default YYYY-MM-DD format so I didn't use any conversion.

Posted: Wed Mar 20, 2013 4:22 am
by prasannakumarkk
Why dont you give trim(varahcar column).
is it a fixed lenght or delimited file?

Posted: Wed Mar 20, 2013 7:43 am
by chulett
I would advise to never let a Parallel job an implicit conversion like that, especially with a flat file source. Test for validity, explicitly convert the good dates and handle the bad or missing ones.

Posted: Wed Mar 20, 2013 8:41 am
by chandra.shekhar@tcs.com
I am now handling spaces in my job and explicitly converting into dates.
Datastage is really a mysterious tool :?

Posted: Wed Mar 20, 2013 9:04 am
by bob7027
You are right ... btw what version you are using?

Posted: Thu Mar 21, 2013 12:02 am
by chandra.shekhar@tcs.com
@Bob,
We have two clients 8.1 and 8.7, and I have checked it in both.