Friends,
I'm trying to create a new job which parses a Sequential file and populates a staging table.
The problem is with one of the date columns present in the file. The format of the data is "Jul 31 2009" (MM DD YYYY) whereas the DataStage function ICONV expects it in "DD MM YYYY".
How can I convert this format so that I can populate the table
Thanks
Yamini
Problem converting date formats
Moderators: chulett, rschirm, roy
First off, "Jul 31 2009" is not "MM DD YYYY" but rather "MON DD YYYY" and secondly IConv only has expectations if you don't help it so use the appropriate mask to tell it what format the string that needs to be converted is coming in as.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
As this article shows, Iconv() is rather agnostic about such niceties. All you need is the order of the components to be right. will convert any date in any legal format in month-day-year order into DataStage internal format (number of days since 1967-12-31).
Code: Select all
Iconv(InLink.TheDate, "DMDY")
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.