Page 1 of 1

Character To Date Conversion

Posted: Wed Sep 24, 2008 12:18 am
by Vivek Vazarkar
Hi All,

My source file .txt having a date value and I'm trying to load it into the Teradata database. The teradata database having DATE column. In the transform the datastage job gets abort with error.

Job_10_TD_SBT_Load..Transform: At row 1, link "ToLoad", while processing column "Scn_Dt"
Value treated as NULL
Attempt to convert String value "2008-09-21" to Date type unsuccessful.

I used Oconv(ToTransform.Scn_Dt,"D-YMD[4,2,2]") function into the transformer.

Please help. Thanks

Posted: Wed Sep 24, 2008 12:37 am
by WoMaWil
Evaluate, how Teradata want to get the data.

(a) only date like 2008-09-24
(b) date-time like 2008-09-24 08:35:24
(e) else

Oconv works only on data you have set a inconv on first.

If you have 24.09.2008 as date-string in the variabe DString a
NewString=iconv(DString,"D.DMY")
changes it to 14878 (=days after 31.12.1967)
then a
oconv(NewString,"D-YMD[4,2,2]")
changes it to:
2008-09-24

Posted: Thu Sep 25, 2008 5:14 am
by tennetiharika
what is the format u r supposed to convert