2 Char year - YY Conversion
Moderators: chulett, rschirm, roy
2 Char year - YY Conversion
Hi,
In PX, using the Env Variable for APT_DATE_CENTURY_BREAK_YEAR with values 2000 will ensure that all YY will be converted to 20YY or using the format %2000yy will do the same.
But if we have dates like 20-AUG-96 and 10-SEP-08 both will be converted to 20-AUG-2096 and 10-SEP-2008 , which is wrong as first one shld be 20-AUG-1996
In a server job, using ICONV & OCONV the same case worked correctly and it inserted the right century. Does DS internally makes an educated guess or how else it does this in Server?
Arg1 - 'DD MMM YY'
Used in a routine - OCONV(Iconv(Arg1, "D DMY[,A3,2]"),"D-YMD[4,2,2]")
Thanks,
NV
In PX, using the Env Variable for APT_DATE_CENTURY_BREAK_YEAR with values 2000 will ensure that all YY will be converted to 20YY or using the format %2000yy will do the same.
But if we have dates like 20-AUG-96 and 10-SEP-08 both will be converted to 20-AUG-2096 and 10-SEP-2008 , which is wrong as first one shld be 20-AUG-1996
In a server job, using ICONV & OCONV the same case worked correctly and it inserted the right century. Does DS internally makes an educated guess or how else it does this in Server?
Arg1 - 'DD MMM YY'
Used in a routine - OCONV(Iconv(Arg1, "D DMY[,A3,2]"),"D-YMD[4,2,2]")
Thanks,
NV
My question is..the dates mentioned in my previos message are translated correctly in Server where as in PX using the Env Variable, it traslates the Centruy part incorrectly..always add "20" to the YY part and makes it YYYY
e.g 96 comes 2096 and 08 becomes 2008 in PX where as in server it makes it 1996 and 2008
(For Server I did not set the variable as you mentioned...it will be using the default value..)
e.g 96 comes 2096 and 08 becomes 2008 in PX where as in server it makes it 1996 and 2008
(For Server I did not set the variable as you mentioned...it will be using the default value..)
My question is..the dates mentioned in my previos message are translated correctly in Server where as in PX using the Env Variable, it traslates the Centruy part incorrectly..always add "20" to the YY part and makes it YYYY
e.g 96 comes 2096 and 08 becomes 2008 in PX where as in server it makes it 1996 and 2008
(For Server I did not set the variable as you mentioned...it will be using the default value..)
e.g 96 comes 2096 and 08 becomes 2008 in PX where as in server it makes it 1996 and 2008
(For Server I did not set the variable as you mentioned...it will be using the default value..)
Yes you are right..If I pass the same date values in a Server job and use ICONV & OCONV functions as mentioned in my previous message, it seems to be intelligently converting 96 to 1996 and 08 to 2008.
This is precisely my question, how is it working correctly in Server?
I have not done any Env level settings in Server
This is precisely my question, how is it working correctly in Server?
I have not done any Env level settings in Server
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
1996 will always be displayed as 1996.
APT_DATE_CENTURY_BREAK_YEAR is defined (in DataStage Parallel Job Advanced Developer's Guide page 6-19 for version 7.5) as "Four digit year which marks the century two-digit dates belong to. It is set to 1900 by default." That is, if you have a two-digit year, then the first two digits of APT_DATE_CENTURY_BREAK_YEAR are used to make up the four-digit year.
This is different behaviour than that of the CENTURYPIVOT (note "pivot" not "break") in the uvconfig file for server jobs.
APT_DATE_CENTURY_BREAK_YEAR is defined (in DataStage Parallel Job Advanced Developer's Guide page 6-19 for version 7.5) as "Four digit year which marks the century two-digit dates belong to. It is set to 1900 by default." That is, if you have a two-digit year, then the first two digits of APT_DATE_CENTURY_BREAK_YEAR are used to make up the four-digit year.
This is different behaviour than that of the CENTURYPIVOT (note "pivot" not "break") in the uvconfig file for server jobs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.