using transfomer or modify

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
harikumar
Participant
Posts: 33
Joined: Wed Apr 21, 2010 9:19 pm
Location: banglore

using transfomer or modify

Post by harikumar »

i have source like this
date
02-06-2010
05-01-2010
23-09-2010


i want to transform target side like this
date
2-6-2010
5-1-2010
23-9-2010
Last edited by harikumar on Mon Jun 28, 2010 11:25 pm, edited 1 time in total.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Is there a question here? What are your actual source and target datatypes? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
venugopal.123
Participant
Posts: 9
Joined: Sun Jun 27, 2010 11:52 pm

Post by venugopal.123 »

Hi use transformer in that use stage variable and then you can find the first character in the date column is "0" then trim the column else pass the column as it is.... Hope this will help....
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If your data type is date you will need type conversion functions DateToString() and StringToDate() with different format strings.

If your data type is string you will need Field() functions to unpack the components and Trim() to remove the leading zeroes, then concatenation to re-assemble the date.

In the first case you will have to handle separately one-digit day and one-digit month, one-digit day and two-digit month, two-digit day and one-digit month, and two-digit day and two-digit month, using nested If..Then..Else constructs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply