Hi datastagers,
in order to calculate the period of time between a fix timestamp and the current timestamp I would need something like a SecondsSinceFromTimestamp(fix_timestamp, current_timestamp) in my sequence job but unfortunately haven't found a good possibility to do that so far. Do you have any ideas?
Best regards,
ke.rstin_
Calculating with timestamps in a sequence job
Moderators: chulett, rschirm, roy
You'd need to create a custom routine and then run that in the Sequence job and that means writing it in BASIC. I think you'll find Ray has some prebuilt that he gives away on his site that do "date math"... let's see what he says when he wanders by. ![Wink :wink:](./images/smilies/icon_wink.gif)
Once you have computed this period of time (in seconds?) then what do you need to do with it?
![Wink :wink:](./images/smilies/icon_wink.gif)
Once you have computed this period of time (in seconds?) then what do you need to do with it?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hi Chulett,
what I need it for: I have a loop where I start a wait-for-file-job to see if the file is already here. Let's say they are named File1 ... File32. In my wait-for-file-job I compare the current date with the start date of the main sequence in order to guarantee that the whole searching process doesn't need longer than two hours. If I set my timeout for every file separately I could get in trouble because it runs too long.![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
what I need it for: I have a loop where I start a wait-for-file-job to see if the file is already here. Let's say they are named File1 ... File32. In my wait-for-file-job I compare the current date with the start date of the main sequence in order to guarantee that the whole searching process doesn't need longer than two hours. If I set my timeout for every file separately I could get in trouble because it runs too long.
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The routines that Craig mentioned are here - however there isn't a TimestampDifference in that set.
This can be done with a simple expression (it only looks complex). That expression can be used in a sequence or in server job components or even in a BASIC Transformer stage.
This can be done with a simple expression (it only looks complex). That expression can be used in a sequence or in server job components or even in a BASIC Transformer stage.
Code: Select all
(Iconv(Field(Timestamp2, " ", 1, 1), "DYMD") * 86400 + Iconv(Field(Timestamp2, " ", 2, 1), "MTS")) - (Iconv(Field(Timestamp1, " ", 1, 1), "DYMD") * 86400 + Iconv(Field(Timestamp1, " ", 2, 1), "MTS"))
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.
Hi Chulett and Ray,
thank you for your help.
Unfortunately I can't see Ray's full entry because I'm no premium member (I know that's my own fault
). We made a workaround which doesn't really do exactly what it should, but it's enough for the job:
We have a load_timestamp for the start of the main sequence and we create a current date with a user variable activity. It's compared via a nested condition.
Best regards, ke.rstin_
thank you for your help.
Unfortunately I can't see Ray's full entry because I'm no premium member (I know that's my own fault
![Wink ;)](./images/smilies/icon_wink.gif)
We have a load_timestamp for the start of the main sequence and we create a current date with a user variable activity. It's compared via a nested condition.
Best regards, ke.rstin_