Page 1 of 1

Iconv Oconv Issue

Posted: Fri Sep 19, 2008 5:37 am
by Amit_111
Hi All,

I am getting a strange issue with Iconv Oconv function. I have generated a function to retrive a date and insert it in the target table.

The function i have written is as follows :
" OCONV(ICONV("Column_Name","D-MDY"),"D YMD[4,2,2]") "

It is working fine for some dates and they are geting inserted properly in the target but for some dates it is sending blank. On further analyzing this issue deeper i found out that dates having day > 15 for e.g. 15th Sep 2008 is going as blank but a date like 2nd SEP 2008 is going fine as is in the target .
Not able to conclude why this is happening. any pointers on this issue are welcomed. Thanks in Advance

Re: Iconv Oconv Issue

Posted: Fri Sep 19, 2008 5:48 am
by sachin1
please let us know the input format of date, give an example of your input date.

Posted: Fri Sep 19, 2008 6:40 am
by Amit_111
My date format is "19-SEP-08" in source table.

Posted: Fri Sep 19, 2008 7:22 am
by sachin1
OCONV(ICONV(ereplace("19-SEP-08","-"," "),"D2"),"D YMD[4,2,2]"), so when your input is "19-SEP-08" output is 2008 09 19, taking your oconv format into account.

Posted: Fri Sep 19, 2008 7:37 am
by chulett
The IConv mask must match the incoming date format. You've used "ICONV("Column_Name","D-MDY")" and shown a date example of "19-SEP-08". See the problem?

Posted: Fri Sep 19, 2008 9:52 am
by Amit_111
Thanks Craig it working now. I used as follows:

OCONV(ICONV(ColumnName,"D DMY"),"D YMD[4,2,2]")