calculate number of days excluding weekends

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sudheer05
Participant
Posts: 30
Joined: Sun Oct 02, 2005 1:36 pm

calculate number of days excluding weekends

Post by sudheer05 »

Hi,
My input has two timestamps,I need to calculate the number of days between these two timestamps excluding weekends.
Any help would be appreciated.
My source is Orcale.
ThankYou,
Sudheer.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can use Oracle functions or you can use DataStage.
If you use DataStage you will need either a (parallel) routine or a calendar table to determine which days are weekends. This is particularly true if your requirement extends the definition of "weekend" to include "holiday".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sudheer05
Participant
Posts: 30
Joined: Sun Oct 02, 2005 1:36 pm

Post by sudheer05 »

Thanks Ray,
Yes I do have a Calender Table which has a Calendar date and a flag field which tells me if it is a working day or a holiday.
But I need some help to count these flags for which this calendar date lies between my date1 and date2 from the source.
ThankYou.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
I was wondering how can a 7.5.1a be parallel?
It certainly can't run those kind of jobs!

Most simple way is to use a sql join to calculate it from the calendar table

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
ajith
Participant
Posts: 86
Joined: Thu Nov 10, 2005 11:10 pm

Post by ajith »

select count(*) from Hol_Tab where hol_ind <>'Y'

or something like that?


It is just a matter of a query anyway
Post Reply