Hi,
I have a csv file that needs to be loaded into a DB2 table. The csv file has a date field in this format: 'm/d/yyyy hh:mi". Some examples are:
4/1/2008 1:23
12/31/2008 23:52
10/31/2008 22:20
..... etc
The month field is not always 2-digit. The date field is not always 2-digit. The hour field is not always 2-digit. Please see the examples above.
I would like to know the best way of loading this data into datastage. Use ICONV?? OR use any routines? OR use any transforms? Please help.
- Joy.
How to convert this string 'm/d/yyyy h:mi' to date?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can do it in stage variables if you don't need to do a routine.
The Oconv on the time may require "MTS" as its second argument (rather than "MT") if the database requires seconds in its timestamp format.
The Oconv on the time may require "MTS" as its second argument (rather than "MT") if the database requires seconds in its timestamp format.
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Your conversions will not work. The second argument of each is invalid. You can not convert timestamps - you must split them in to date and time components, convert these separately, then re-assemble the result.
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.
Not really all that successful then, eh? To me, this implies you are running the job from the Designer and haven't looked at the actual job log from the Director or you would undoubtedly see it chock full o' warnings.Tlam wrote:When I run the job, the job runs successful, but the data is not shown in the table. Please advice.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers