Making Timestamp column for DB2

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
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Making Timestamp column for DB2

Post by ds2000 »

In a server job, have two columns:
TranDate Decimal(8) values= 20080812
TranTime Decimal(8) values= 00000000

and want to load into db2 timestamp column: TrandtTime Timestamp

Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Substring and concatenation will suffice.

Code: Select all

InLink.TranDate[1,4]:"-":InLink.TranDate[5,2]:"-":InLink.TranDate[7,2]:" ":InLink.TranTime[1,2]:":"InLink.TranTime[3,2]":":":InLink.TranTime[5,2]:".":InLink.TranTime[7,2]
I have assumed here that the final two digits of TranTime are centiseconds.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Post by ds2000 »

I used following and it worked:

Code: Select all

Oconv(Iconv(a.TRANDATE_C702,"D YMD"),"D-YMD[4,2,2]"): " " : Oconv(Iconv(svTime, "MTS"),"MTS")
Post Reply