Substrings in a 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

A Date datatype doesn't have a format. You don't have a Date, you have a string in "dd/mm/yyyy" format. That's why it works when you declare it as a Varchar.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ajay.vaidyanathan
Participant
Posts: 53
Joined: Fri Apr 18, 2008 8:13 am
Location: United States

Post by ajay.vaidyanathan »

Hi,

If you are sourcing from a Sequential File, goto the file properties tab where you will find a DATE sub-tab. Browse that tab and you will find 'FORMAT' option. If you click it, you will be able to see the format of your date field. By default it is 'mm/dd/yyyy'. You can change this format to whatever format you want.

Other approach to your problem can be, try converting your source DATE to CHAR and then apply the Substrings() you want on it.
Regards
Ajay
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, you cannot change the format to "whatever you want", it needs to match what's in the file to convert properly. Regardless, won't help here. And the OP has already reported success treating the field as a string.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply