TimeStamp Difference
Moderators: chulett, rschirm, roy
TimeStamp Difference
Hi all,
I searched the forum for an answer and still I have not found one. My problem is,
I want to find the difference (right down to the microsecond) between two timestamps. I can see the timestamp and microseconds from the input but I can't seem to find a function that will allow me to do this. I thought of creating a server routine, but I don't think I will be able to see it in the Parallel Transformer.
Is there a solution on the forum that I didn't find or has someone come up with a BuildOp that will solve this problem.
Thanks.
I searched the forum for an answer and still I have not found one. My problem is,
I want to find the difference (right down to the microsecond) between two timestamps. I can see the timestamp and microseconds from the input but I can't seem to find a function that will allow me to do this. I thought of creating a server routine, but I don't think I will be able to see it in the Parallel Transformer.
Is there a solution on the forum that I didn't find or has someone come up with a BuildOp that will solve this problem.
Thanks.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The input comes from DB2 mainframe. I modified the field attributes with extended equal to microseconds. I can get the microseconds from DB2. What I was hoping to accomplish was write a routine or BuildOp that would take the start and end timestamps and provide the difference in seconds. I started to code a server routine only to find out that it wasn't visible in the PX transformer. I don't want to use the Basic Transformer. Another problem I encountered was trying to use DS functions within the coding. I am not sure if this is possible as well.
Thanks
Thanks
Getting jitter free microsecond resolution from Wintel platform will be difficult. There are hardware plugs-ins that can easily resolve to that granularity, but associating the timestamp to the event still requires the CPU and OS, which are too often busy doing other things.
Here's a link to folks facing similar challenges:
http://www.csm.ornl.gov/~dunigan/atmgps/
In the end, it would be cheaper/easier to just use a UNIX box.
Carter
Here's a link to folks facing similar challenges:
http://www.csm.ornl.gov/~dunigan/atmgps/
In the end, it would be cheaper/easier to just use a UNIX box.
Carter
Getting jitter free microsecond resolution from Wintel platform will be difficult. There are hardware plugs-ins that can easily resolve to that granularity, but associating the timestamp to the event still requires the CPU and OS, which are too often busy doing other things.
Here's a link to folks facing similar challenges:
http://www.csm.ornl.gov/~dunigan/atmgps/
In the end, it would be cheaper/easier to just use a UNIX box.
Carter
Here's a link to folks facing similar challenges:
http://www.csm.ornl.gov/~dunigan/atmgps/
In the end, it would be cheaper/easier to just use a UNIX box.
Carter
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Well, you can always work at the millisecond level, which IS supported. Indeed you can get the values for CPU and elapsed time (to millisecond accuracy, rounded) in log messages, so you don't even need to calculate them yourself.
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.
You can write a c function. Use the time.h library. It has time structs that can get your work done. You can also do string manipulation within C. Read it like
You can do the same for the second timestamp and minus them and return a concatenated value. This is a very general direction, for details you need to google it.
Code: Select all
sscanf("%4d-%2d-%2 %2:%2:%2.%6d", &yr, &mo, &dy, &hh, &mm, &ss, &nn)
Last edited by DSguru2B on Wed Dec 20, 2006 10:47 am, edited 1 time in total.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: