time conversion
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 10
- Joined: Thu Jan 28, 2010 1:03 am
- Location: hyderabad
time conversion
Hi All,
I have a sequential file, which has the time field. I was unable to transfer the records which has the time format '0:00:00' i.e the records of 0:00:00 to 9:59:59 were not loading into my target table. My target column has Time field and iam using an transformer stage.
can anyone help with this, pls!!
I have a sequential file, which has the time field. I was unable to transfer the records which has the time format '0:00:00' i.e the records of 0:00:00 to 9:59:59 were not loading into my target table. My target column has Time field and iam using an transformer stage.
can anyone help with this, pls!!
sri
-
- Participant
- Posts: 111
- Joined: Thu Jun 01, 2006 5:12 am
- Location: Detroit
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The default time format has two digits for the hour component. You have to use a different format, by overriding the default either explicitly in your transformation function or by changing the system-wide default. I would prefer the former.
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: 10
- Joined: Thu Jan 28, 2010 1:03 am
- Location: hyderabad
Hi,
My target database is DB2, and the fieldtype of the column is TIME of length 8.My sequential file contains time column which has fieldtype of varchar. i used the following type conversion in transformer stage,
StringToTime(DSLink3.Obs_tm,"%hh:%nn:%ss"), but i was unable to load the whole data.
My target database is DB2, and the fieldtype of the column is TIME of length 8.My sequential file contains time column which has fieldtype of varchar. i used the following type conversion in transformer stage,
StringToTime(DSLink3.Obs_tm,"%hh:%nn:%ss"), but i was unable to load the whole data.
sri
-
- Participant
- Posts: 10
- Joined: Thu Jan 28, 2010 1:03 am
- Location: hyderabad
-
- Participant
- Posts: 10
- Joined: Thu Jan 28, 2010 1:03 am
- Location: hyderabad
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 10
- Joined: Thu Jan 28, 2010 1:03 am
- Location: hyderabad
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I don't know whether U (one of our posters can get you the solution). Why not send U an email or private message?
The format string "%hh:%nn:%ss" expects two digits in the hour component. I mentioned that before. Your data only has one.
You need to handle that with a different format string, or by adding leading zero when it occurs.
The format string "%hh:%nn:%ss" expects two digits in the hour component. I mentioned that before. Your data only has one.
You need to handle that with a different format string, or by adding leading zero when it occurs.
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.
Request away, but that's not the way it works here and this had no business coming to me in a private email. If you still have questions you need to post them here so anyone can help you. In this specific case that means anyone with DB2 experience and, as I've noted here many times, that's not me.In a private email, srinivasayedla wrote:Hi Chulett,
I had post with the subject time conversion in general forum in dsxchange, I couldn't get the solution for the problem. I request you to go through that and provide me an solution for that. I really got strucked with my work.
Please help me regarding this.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Prefix 0 if hour is one char
Code: Select all
Right('0':Field(InputColumn,':',1),2)
-
- Premium Member
- Posts: 892
- Joined: Thu Oct 16, 2003 5:18 am