String to Date conversion error

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
verify
Premium Member
Premium Member
Posts: 99
Joined: Sun Mar 30, 2008 8:35 am

String to Date conversion error

Post 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
RK Raju
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post 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
verify
Premium Member
Premium Member
Posts: 99
Joined: Sun Mar 30, 2008 8:35 am

Post 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..
RK Raju
verify
Premium Member
Premium Member
Posts: 99
Joined: Sun Mar 30, 2008 8:35 am

Post 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..
RK Raju
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
verify
Premium Member
Premium Member
Posts: 99
Joined: Sun Mar 30, 2008 8:35 am

Post by verify »

Thanks Ray..
RK Raju
Post Reply