oconv(data(), "DW") = 4 .. reads as Thursday?!

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
PaulS
Premium Member
Premium Member
Posts: 45
Joined: Fri Nov 05, 2010 4:38 am

oconv(data(), "DW") = 4 .. reads as Thursday?!

Post by PaulS »

Hi,

We've got a new install of ds 8.5 - in a trigger I have the above code so some jobs run on a Thursday. However they ran last night,.. Wednesday.

I though Monday was day one? So day four should be Thursday.

Running "date" on the unix box with the installion shows the correct day. Scheduling jobs to run on Thursday (with is today, day of posting),.. works.

I can do a quick fix by changing 4 to 5, but I don't understand it! Can anyone help please?

Thanks
Paul
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

You have a typo in your subject; it should be date().

Date conversion codes are documented in the DataStage BASIC Reference Guide and other places as well.

The "DW" conversion code description is "Requests only the day number within the week (1 through 7, where Sunday is 7). If NLS locales are enabled, uses the DAYS field in the NLS.LC.TIME file, where Sunday is 1."

It sounds like you fall into the latter part of the description.

You could switch to checking with "DWB" which is "Requests only the abbreviated day name. If NLS locales are enabled, uses the ABDAYS field in the NLS.LC.TIME file." Then you're dealing with day abbreviations rather than numbers.
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I was going to suggest switching to "DWA" and then checking for "THURSDAY" but basically the same suggestion, that way there's no confusion over what day of the week you are looking for.

I also seem to recall there may be a setting in the dsenv file that controls what day of the week is considered day 1? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is a couple of settings. You can also configure that the range of numbers is 0..6.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I was wondering about that... I thought they ran 0 thru 6 rather than 1 thru 7. Would be interesting if the default changed somewhere in the 8.x release pipeline. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
PaulS
Premium Member
Premium Member
Posts: 45
Joined: Fri Nov 05, 2010 4:38 am

Post by PaulS »

qt_ky wrote:The "DW" conversion code description is "Requests only the day number within the week (1 through 7, where Sunday is 7). If NLS locales are enabled, uses the DAYS field in the NLS.LC.TIME file, where Sunday is 1."

It sounds like you fall into the latter part of the description.
Thanks for that - the new install does indeed have NLSlocales enabled, previous install didn't.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

You're welcome. Ah, our good friend NLS strikes once again...
Choose a job you love, and you will never have to work a day in your life. - Confucius
Post Reply