TYPECONVERSION

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
ntr
Participant
Posts: 110
Joined: Fri Dec 18, 2009 10:30 am
Location: pune

TYPECONVERSION

Post by ntr »

Hi,

My input data format is varchar:(08August2011)

i want to convert out put as date (2011-08-08)

i had written logic

String To Date((Left(col,2):-:(If ((col,3,3)="JAN" Then "01" Else if (col,3,3)="Feb" Then "02"........upto December i had written and :-:Right(col,4),"%dd-%mm-%yyyy")

its working fine .

is there any option to handle this insted of writing this much of big syntax

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

Post by ArndW »

I'm not at a DataStage session where I can confirm, but think that

Code: Select all

StringToDate(In.Col,"%dd%mmmm%yyyy")
should work.
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Post by BI-RMA »

Confirm that.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
ntr
Participant
Posts: 110
Joined: Fri Dec 18, 2009 10:30 am
Location: pune

Post by ntr »

Sorry for the delay .

its working perfectly thank you so much ArndW
Post Reply