TIME CONVERSION
Moderators: chulett, rschirm, roy
TIME CONVERSION
All, Have a question on time conversion.
From DB2 DB we pulled calculated some total call time and columns are like
Tot_Time Tot.Attend
1.22 1.51
I need to have hh:mm:ss format. Is there any way we can convert it in datastage.
It should be,
00:01:22 and 00:01:51
Thanks,
From DB2 DB we pulled calculated some total call time and columns are like
Tot_Time Tot.Attend
1.22 1.51
I need to have hh:mm:ss format. Is there any way we can convert it in datastage.
It should be,
00:01:22 and 00:01:51
Thanks,
This looks like a Server job question; StringToTime is a parallel function.
So just to confirm, what does the actual input data look like for call times over an hour? That example makes a difference in your logic.
So just to confirm, what does the actual input data look like for call times over an hour? That example makes a difference in your logic.
Choose a job you love, and you will never have to work a day in your life. - Confucius
Yes it just leaves a little too much up to my imagination.
A really, really bad call in real life could go on for 50 hours and 30 seconds. Just curious in the data if that would look like 3000.30 or if calls > 59 minutes may be filtered out. If the latter, then the conversion logic is simpler.
A really, really bad call in real life could go on for 50 hours and 30 seconds. Just curious in the data if that would look like 3000.30 or if calls > 59 minutes may be filtered out. If the latter, then the conversion logic is simpler.
Choose a job you love, and you will never have to work a day in your life. - Confucius
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I'd use a Fmt() function. Something like
Code: Select all
Fmt(DIGITS(InLink.TheValue), "R##:##")
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.
Varchar 1 & 3? How does that work? Seems to me your fields would need to be Varchar 5 to accomodate a full value - double digits for both plus the delimiter. And the target would need to be 8.
An alternative to Ray's fancy FMT:
All off the top of my head so YMMV.
An alternative to Ray's fancy FMT:
Code: Select all
'00:' : FMT(FIELD(InLink.TheValue,'.',1),'2"0"R')) : ':' : FMT(FIELD(InLink.TheValue,'.',2),'2"0"R'))
You tell us... what is your actual target? I've been assuming a string.sam334 wrote:Do i need to change the output data type to time or anything
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers