Date functions

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
seanc217
Premium Member
Premium Member
Posts: 188
Joined: Thu Sep 15, 2005 9:22 am

Date functions

Post by seanc217 »

Hi all,

I am looking for a way to calcuate the week of the month For example, 4/01/06 would calulate to week 1, while 4/8/06 would calculate to week 2.

Is there a function in DataStage to do this?

Thanks
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You will need to code a custom routine to perform this task. Keep in mind the scenario what if the 1st April 2006 is a friday, will you still consider it as the first week or no?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
seanc217
Premium Member
Premium Member
Posts: 188
Joined: Thu Sep 15, 2005 9:22 am

Post by seanc217 »

I think since I am loading an Oracle table, that I can just use the to_char function to do it.

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Curious to learn how TO_CHAR could return a week number. What are the business rules that define "week 1 in a month"? (For example read post from dsguru2b.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply