Problem while parameter for date

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Problem while parameter for date

Post by hhh »

Hello friends

I m using job parameter for date ,and datatype is date .

but when i enter the date as 0001-01-01 it gives output as 2005-01-01
similarly for 0002-01-01 gives 2002-01-01
0030-01-01 gives 1930-01-01
0099-01-01 gives 1999-01-01
0029-01-01 gives 2029-01-01

can u please say what is going on ?


regards

Hman
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
Seems like it's treating those as 2 digit years.
Is there any problem in using a string type instead?

(Trying to remember is there any configuration to force proper interpretation :roll: )
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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard! :D

DataStage has rules for handling of two digit dates. They are converted into the century defined by the CENTURYPIVOT configuration parameter; by default the century 1930-2029.

It also appears that the underlying mechanism is treating 00yy as yy.

I have no explanation for '0001-01-01 it gives output as 2005-01-01' I would have expected 2001-01-01 given the other examples.

However, I would expect '0000-01-01' to generate 2005-01-01, since 0 is understood to be "current year". There is no year 0; the year before 1AD is 1BC.

Interestingly, the underlying query engine is unaffected. Iconv("0001-01-01", "DYMD") returns -718432 which converts back to 1 Jan 1AD.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

date as a parameter

Post by hhh »

Hi Roy,

for datatype as string it gives appropriate value.

Thx

Hman
Post Reply