Converting MM/DD/YY date to DD/MM/YYYY in EE

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
StuM
Participant
Posts: 17
Joined: Thu Mar 23, 2006 10:45 am
Location: London

Converting MM/DD/YY date to DD/MM/YYYY in EE

Post by StuM »

Hi All,

I am trying to convert a character date, format:

MM/DD/YY

to a character date, format:

DD/MM/YYYY

In Server Edition, this was easily taken care of using oconv, but now tht we are moving onto EE, I am having difficulty. I tried the following:

DateToString(StringToDate(Trim(lkDatesStripped.DataOut), "%mm/%dd/%yy"), "%dd/%mm/%yyyy")

This however took input 05/11/06 and converted to 11/05/1906!

Any suggestions gratefully received.

Regards
StuM
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

It seems that your settings for the $APT_DATE_CENTURY_BREAK_YEAR are such that this conversion works incorrectly. You can also specifically force a century for a 2 digit date by using %year_cutoffyy two digit year from year_cutoff (e.g. %2000yy)
StuM
Participant
Posts: 17
Joined: Thu Mar 23, 2006 10:45 am
Location: London

Post by StuM »

ArndW wrote:It seems that your settings for the $APT_DATE_CENTURY_BREAK_YEAR are such that this conversion works incorrectly. You can also specifically force a century for a 2 digit date by using %year_cutoffy ...


Thanks very much for the info, I shall have a play and see how it goes.

Cheers
StuM
StuM
Participant
Posts: 17
Joined: Thu Mar 23, 2006 10:45 am
Location: London

Post by StuM »

Thanks again - use of %year_cutoffyy achieved the desired result.

Could anyone tell me how this works. I am using %2000yy. What theoretically will happen in 2100?

Thanks in advance.
StuM
Lotus26
Premium Member
Premium Member
Posts: 48
Joined: Tue Jul 13, 2004 2:09 pm

Post by Lotus26 »

StuM wrote:Thanks again - use of %year_cutoffyy achieved the desired result.

Could anyone tell me how this works. I am using %2000yy. What theoretically will happen in 2100?

Thanks in advance.
StuM
I think it works same. The behaviour will not change.

Rgds
Lotus
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Four digit year which marks the century two-digit dates belong to. It is
set to 1900 by defult.

At 2100 $APT_DATE_CENTURY_BREAK_YEAR should be changed to 2100.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
StuM
Participant
Posts: 17
Joined: Thu Mar 23, 2006 10:45 am
Location: London

Post by StuM »

Great, thanks very much for your help.

Regards
StuM
Post Reply