Page 1 of 1

DB2 date and time column

Posted: Tue Feb 02, 2010 1:00 pm
by kogads
Hi All,
When i read the date and time column from DB2/UDB API stage i see the date as 12436 (2002-01-17) for date and 58384 (16:13:04) for time column instead of 2002-01-17 for DT and 16:13:04 for Time.These columns are loaded into seq file and the rarget data looks like 12436 for Date and 58384 for time.Pleae help.

Thanks in advance.

Posted: Tue Feb 02, 2010 2:30 pm
by vinothkumar
Use DateFromDaysSince function. Give the first argument as the the value you are getting from date and second argument as '1970-01-01'

Re: DB2 date and time column

Posted: Wed Feb 10, 2010 11:35 am
by dhelsley
Define the input column as VARCHAR and DataStage will not convert it to Universe's internal format.

Posted: Wed Feb 10, 2010 12:49 pm
by DSguru2B
Or just use the OCONV() function to convert it from internal to whatever format you like.

Posted: Wed Feb 10, 2010 12:58 pm
by chulett
vinothkumar wrote:Use DateFromDaysSince function.
No such thing in a Server job.

Posted: Thu Feb 11, 2010 11:24 am
by kogads
Thank You very much for your reply.It worked for me when defined as varchar.