Day Name of the Week From Date

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
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Day Name of the Week From Date

Post by ds2000 »

I want to get DAYNAME from the Integer Date Type:

e.g.
Input: 20090520
Output: Wed

This is a px job, advance thanx for any help.
sourabhverma
Participant
Posts: 74
Joined: Thu Jan 05, 2006 2:07 am

Post by sourabhverma »

Try to use WeekdayFromDate function in the transformation stage.
Thanks,
Sourabh Verma
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Post by ds2000 »

Thanks sourabhverma,

From documentation "WeekdayFromDate" Returns the day number (int8) of the week from the given date.

Is this day number mean 1=Mon 2=Tue 3=Wed ........ ?

Am i right ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sunday is "day zero" of the week unless you override that with the OriginDate option, so yes as long as you know Sunday is 0 and not 7. Now, I think this can change under NLS... or can be changed by LOCALE... not sure. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Post by ds2000 »

Thanks Chullet.
WeekdayFromDate(link.datecolumn) gives Integer from 0-6. Used if conditions to get values for Sun-Sat.
Post Reply