Hi,
I have a problem using the iconv and oconv fuctions for the date conversion in Datastage 8.0.1. The format that i entered the date was mm/dd/yyyy and the output desired was yyyy/mm/dd but i got an output of yyyy mm dd.How can i add the slash in my output.
And, i would also like to know how I could convert to date in the form of
yy MON dd.
The fuction that I used is as follows.
Oconv(Iconv(InputFieldName,"D DMY[2,2,4]"),"D YMD[4,2,2]")
Thanks in Advance
Regards,
Tanmaya
Iconv and Oconv Date Conversion
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Welcome aboard. You specified space as the delimiter and that's what you got. What you needed was something like
You might find this article informative.
For the second question, try
Code: Select all
Oconv(Iconv(InputFieldName,"DMDY"),"D/YMD[4,2,2]")
For the second question, try
Code: Select all
Oconv(Iconv(InputFieldName,"DMDY"),"D YMD[2,A3,2]")
Last edited by ray.wurlod on Wed Jun 17, 2009 1:41 am, edited 2 times in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Re: Iconv and Oconv Date Conversion
Oconv(Iconv("06/17/2009" ,"D MDY[2,2,4]"),"D/YMD[4,2,2]") gives the output 2009/06/17.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Iconv and Oconv Date Conversion
tanmaya wrote:... the output desired was yyyy/mm/dd
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod wrote:Welcome aboard. You specified space as the delimiter and that's what you got. What you needed was something likeYou might find this article informative.Code: Select all
Oconv(Iconv(InputFieldName,"DMDY"),"D/YMD[4,2,2]")
For the second question, tryCode: Select all
Oconv(Iconv(InputFieldName,"DMDY"),"D YMD[2,A3,2]")
Thank you Ray, that surely worked.
Regards,
Tanmaya