Unusual date conversion

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
chandra.shekhar@tcs.com
Premium Member
Premium Member
Posts: 353
Joined: Mon Jan 17, 2011 5:03 am
Location: Mumbai, India

Unusual date conversion

Post by chandra.shekhar@tcs.com »

Hi,
My source is a File and contains a varchar field which actually stores date in the basic format YYYY-MM-DD.
In the transformer I didn't use any conversion methods for date conversion since the date is in default datastage format. Well this worked perfectly until I validated the data.
For spaces, some random date e.g 2009-07-28, 2010-05-04 etc is getting generated. What could be the reason for this ?
Thanx and Regards,
ETL User
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The only explanation is that the design specifies generation of a random date. Does the extended column metadata include a random Generator property?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chandra.shekhar@tcs.com
Premium Member
Premium Member
Posts: 353
Joined: Mon Jan 17, 2011 5:03 am
Location: Mumbai, India

Post by chandra.shekhar@tcs.com »

The extended column metadata doesn't have anything enabled..
Thanx and Regards,
ETL User
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Then you'd better show us exactly what you are doing.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chandra.shekhar@tcs.com
Premium Member
Premium Member
Posts: 353
Joined: Mon Jan 17, 2011 5:03 am
Location: Mumbai, India

Post by chandra.shekhar@tcs.com »

That's what Ray, I am doing nothing extra.
Just directly mapping a String Field(which contains date) to a Date Column.
Ideally I should use a StringToDate function but since my dates(from source) are in default YYYY-MM-DD format so I didn't use any conversion.
Thanx and Regards,
ETL User
prasannakumarkk
Participant
Posts: 117
Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India

Post by prasannakumarkk »

Why dont you give trim(varahcar column).
is it a fixed lenght or delimited file?
Thanks,
Prasanna
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I would advise to never let a Parallel job an implicit conversion like that, especially with a flat file source. Test for validity, explicitly convert the good dates and handle the bad or missing ones.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chandra.shekhar@tcs.com
Premium Member
Premium Member
Posts: 353
Joined: Mon Jan 17, 2011 5:03 am
Location: Mumbai, India

Post by chandra.shekhar@tcs.com »

I am now handling spaces in my job and explicitly converting into dates.
Datastage is really a mysterious tool :?
Thanx and Regards,
ETL User
bob7027
Participant
Posts: 22
Joined: Wed Oct 03, 2012 2:49 pm
Location: United States

Post by bob7027 »

You are right ... btw what version you are using?
chandra.shekhar@tcs.com
Premium Member
Premium Member
Posts: 353
Joined: Mon Jan 17, 2011 5:03 am
Location: Mumbai, India

Post by chandra.shekhar@tcs.com »

@Bob,
We have two clients 8.1 and 8.7, and I have checked it in both.
Thanx and Regards,
ETL User
Post Reply