Page 1 of 1

String to Date conversion error

Posted: Wed Feb 11, 2009 9:18 pm
by verify
I have a date field from input as Start_Date(8) which has Nullabilty as "Yes".My requirement is to check whether the field is Null, if null then it should be replace with 00000000.This field is mapped to the target field Charge_Date(8) in the target dataset.

In the output derivation of the transformer stage i've used like this:-
Charge_Date:
If IsNull(Start_Date) Then StringToDate("00000000",%yy%mm%dd) Else Start_Date.

But i'm getting the warning as "Conversion error calling conversion routine data_from_ustring data may have been lost"

Please help me out..

Thanks

Posted: Wed Feb 11, 2009 9:25 pm
by Mike
The StringToDate function is going to require a string representation of a valid date matching the specified format. You have met neither requirement. "00000000" is not a valid date... and your format only specifies six characters.

Mike

Posted: Wed Feb 11, 2009 10:17 pm
by verify
Thanks Mike for your instant response... I got the output without any warning...

Could you please tell me why in warning message datastage mentions about the date_from_string function though i'm using StringToDate() function?


Thanks..

Posted: Wed Feb 11, 2009 10:20 pm
by verify
Thanks Mike for your instant response... I got the output without any warning...

Could you please tell me why in warning message datastage mentions about the date_from_string function though i'm using StringToDate() function?


Thanks..

Posted: Thu Feb 12, 2009 12:34 am
by ray.wurlod
When your job is compiled the stages you use are converted into Orchstrate operators, and the functions that you use to convert data are converted to those used by the modify operator (which is also used for the Modify stage). As a general rule the "To" function names are for the Transformer stage and the "_from_" function names are for the Modify stage.

Posted: Thu Feb 12, 2009 10:32 am
by verify
Thanks Ray..