yearweekfromdate function starts on tuesday

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
mmartin
Participant
Posts: 16
Joined: Mon Dec 18, 2006 3:16 am

yearweekfromdate function starts on tuesday

Post by mmartin »

I'm facing an issue using the yearweekfromdate function in a PX transformer.
My job uses a row generator in input to generate incremental dates.

I want to catch the week number for each date but it seems that this function returns tuesday as the first day of the week (monday is day 0 and tuesday is day 1).

What is very strange is that using the function weekdayfromdate, the first day of the week is set to sunday which is day 0.

Does anybody knows if it is a platform setting issue or anything wrong in my use of these functions?

Thanks for your precious answers.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Perhaps YearWeekFromDate's results are based upon a week starting on the weekday of the first day of the year being examined? So, if the year started on a Wednesday, then you would see the week number advance on every Wednesday of that year.

Simply a hypothesis: I don't have access to a DS server at the moment to verify.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
mmartin
Participant
Posts: 16
Joined: Mon Dec 18, 2006 3:16 am

Post by mmartin »

It was because the first day of the year is a tuesday that's right!

Thanks for your precious help.
Post Reply