DB2 date and time column

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
kogads
Premium Member
Premium Member
Posts: 74
Joined: Fri Jun 05, 2009 5:36 pm

DB2 date and time column

Post 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.
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post 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'
dhelsley
Participant
Posts: 9
Joined: Thu Jan 05, 2006 9:23 am

Re: DB2 date and time column

Post by dhelsley »

Define the input column as VARCHAR and DataStage will not convert it to Universe's internal format.
Dave
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Or just use the OCONV() function to convert it from internal to whatever format you like.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

vinothkumar wrote:Use DateFromDaysSince function.
No such thing in a Server job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kogads
Premium Member
Premium Member
Posts: 74
Joined: Fri Jun 05, 2009 5:36 pm

Post by kogads »

Thank You very much for your reply.It worked for me when defined as varchar.
Post Reply