Calculating buisness hours between two timestamps
Moderators: chulett, rschirm, roy
Calculating buisness hours between two timestamps
Dear experts,
I need to calculate the buisness hours between two timestamps.
Buisness hours are between 7am and 9pm Mon - Sat (no pub holiday exeptions)
I'm guessing I will need to write a routine for this. What are your suggestions?
I need to calculate the buisness hours between two timestamps.
Buisness hours are between 7am and 9pm Mon - Sat (no pub holiday exeptions)
I'm guessing I will need to write a routine for this. What are your suggestions?
You posted in the "General" but specified a PX job, so we would need to confirm if this is for a PX/EE job or for a server one.
Although this could be done with stage variables to compute the hour ranges, a routine would be much more efficient (as well as being more legible and maintainable).
Although this could be done with stage variables to compute the hour ranges, a routine would be much more efficient (as well as being more legible and maintainable).
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Not until you end any confusion over your job type.
PX means Parallel Extender and is the reason you buy the "Enterprise" Edition. You used the word "routine" which is typically associated with Server jobs and which would be written in BASIC, whereas custom PX goodies would be written in C or C++.
How about this, do your jobs use Hashed Files?
PX means Parallel Extender and is the reason you buy the "Enterprise" Edition. You used the word "routine" which is typically associated with Server jobs and which would be written in BASIC, whereas custom PX goodies would be written in C or C++.
How about this, do your jobs use Hashed Files?
Last edited by chulett on Sun Sep 23, 2007 9:22 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
So you are using the Parallel Extender / Extended Edition (PX/EE) version of the product; this means you should not be using the DS/BASIC language subroutines to do these computations.
You would code your own routine in C++ and call it from your datastage job. The effort to code this is a bit more than can be quickly done for this forum, but perhaps someone already has a similar program that can be posted here and adapted by others.
Have you looked at what is involved in adding your own c++ routine?
You would code your own routine in C++ and call it from your datastage job. The effort to code this is a bit more than can be quickly done for this forum, but perhaps someone already has a similar program that can be posted here and adapted by others.
Have you looked at what is involved in adding your own c++ routine?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I have programming experience in other languages, so I guess I could work it out with a little research.
What would help me in the meantime then would be for someone to explain to me exactly how to implement a custom C++ stage into a parallel job. Maybe show me a simple one that will add 1 to a value or concatenate a string to a piece of text. If I can get that working I should be able to work the rest out.
What would help me in the meantime then would be for someone to explain to me exactly how to implement a custom C++ stage into a parallel job. Maybe show me a simple one that will add 1 to a value or concatenate a string to a piece of text. If I can get that working I should be able to work the rest out.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Open Designer.
Open a parallel job.
Select the Stage Types branch.
From the New tool choose new parallel stage then, from the menu presented, choose Build.
Note the names of the tabs. Emplace your code there.
You can use F1 to get help or read the pertinent chapter of the Parallel Job Advanced Developer's Guide or both.
Open a parallel job.
Select the Stage Types branch.
From the New tool choose new parallel stage then, from the menu presented, choose Build.
Note the names of the tabs. Emplace your code there.
You can use F1 to get help or read the pertinent chapter of the Parallel Job Advanced Developer's Guide or both.
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:
There are already some examples in the Parallel forum. Search is your friend. There's a good one by dsguru2b that mimics the functionality of an Ereplace function.
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.
Thanks Ray!
I got the Ereplace code which I wouldn't have found without your guidance.
So now I have the code, I just want to know, in the "build" stage type dialogue, where exactly do I put this code?
Now I would love to search for this but I am a bit vague on what key words to search on
I tried: "build px stage" and "build parallel stage"
Both returned "No topics or posts met your search criteria"
Kind regards,
perfman
I got the Ereplace code which I wouldn't have found without your guidance.
So now I have the code, I just want to know, in the "build" stage type dialogue, where exactly do I put this code?
Now I would love to search for this but I am a bit vague on what key words to search on
I tried: "build px stage" and "build parallel stage"
Both returned "No topics or posts met your search criteria"
Kind regards,
perfman