how to handle the warnings when using the stingTodate

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
thumati.praveen
Participant
Posts: 106
Joined: Wed Oct 04, 2006 5:21 am

how to handle the warnings when using the stingTodate

Post by thumati.praveen »

hi all,

when i am trying to validate the input field type is char and convert to date,it is generating the warnings like...

xfmIIPNT0: Conversion error calling conversion routine date_from_string data may have been lost

can u provide the best input for this warnings.

thanks inadvance
praveen
BalageBaju
Participant
Posts: 34
Joined: Fri Sep 22, 2006 10:59 pm
Location: India

Post by BalageBaju »

Hi,

First Trim that field and then apply 'StringToDate' function.
Hope this will help you...
Regards,
Balaji.
thumati.praveen
Participant
Posts: 106
Joined: Wed Oct 04, 2006 5:21 am

Post by thumati.praveen »

BalageBaju wrote:Hi,

First Trim that field and then apply 'StringToDate' function.
Hope this will help you...
I used TrimLeadingandTrilig funcion,but warning is still comining
ajith
Participant
Posts: 86
Joined: Thu Nov 10, 2005 11:10 pm

Post by ajith »

thumati.praveen wrote:
I used TrimLeadingandTrilig funcion,but warning is still comining

can u post the transformation you are doing and the datatypes and lengths of inputs and outputs. More importantly, Check whether your conversion works, If everything is fine, just ignore the warnings, It signifies nothing then.

If you have a problem with the data, please post the problem in details so that others can help you out.

Thanks,
Ajith
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What Ajith is suggesting is that your string dates may contain more information than can be converted to a date type - for example they may really be timestamps, so that the time portion is lost so you get warned that this may be occurring.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Mahadev
Participant
Posts: 5
Joined: Tue Nov 21, 2006 5:13 am
Location: Bangalore

Try this code.

Post by Mahadev »

Try the following code in a transformer stage. In place of X give your coloumn name.
StringToDate(X[1,4] :"-" : X[5,2] : "-" : X[7,2], "%yyyy-%mm-%dd").
Also check the date format in the input to see if it is "YYYYMMDD". change the code accordingly.
Mahadev V
bandish
Participant
Posts: 41
Joined: Tue Oct 11, 2005 1:30 am

Post by bandish »

There might be NULL values in the input column.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Then use :

Code: Select all

 If IsNull(X) then 'NULL' else StringToDate(X[1,4] :"-" : X[5,2] : "-" : X[7,2], "%yyyy-%mm-%dd")
Sam
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Still waiting to hear from the original poster what the input format of the dates might be.
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