Datatype Conversion Warning.....from StringToDate

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
ajmore
Participant
Posts: 22
Joined: Fri Aug 25, 2006 5:25 am

Datatype Conversion Warning.....from StringToDate

Post by ajmore »

Hi :) ,
I am getting Following warning while converting data in string format to date

Transformer :Conversion error calling conversion routine date_from_string data may be lost

The String Length is 8(e.g. 20341221),and I used the StingToDate function and got the output 2034-12-21 but with warnings...
What should be the appropiate Date datatype Length and how i can suppress above warning?? :shock:
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Can you post the exact derivation from the Transformer stage you have used? It should be

Code: Select all

StringToDate(InputLink.Column, "%yyyy%mm%dd")
Kris

Where's the "Any" key?-Homer Simpson
ajmore
Participant
Posts: 22
Joined: Fri Aug 25, 2006 5:25 am

Post by ajmore »

kris007 wrote:Can you post the exact derivation from the Transformer stage you have used? It should be

Code: Select all

StringToDate(InputLink.Column, "%yyyy%mm%dd")
Thanks for quick response..."Kris007"
I used the following derivation
StringToDate(DDate [1,4] : "-" : DDate [5,2] :"-" : DDate [7,2],"%yyyy-%mm-%dd")
i actually want Date in dd-mm-yyyy format can anyone specify the derivation
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Dates aren't "in" any particular kind of format. It's only when they are converted to string that format becomes important. Having created a date, as in this thread, you can then apply a DateToString() function and specify an explicit date picture such as "%dd-%mm-%yyyy".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

i have same problem when we upgrade to version 7.5.2 , it was not a problem in 7.5.1. check some records may not be convertible to date.
you can try this:
if DDate<19000000 then '1900-01-01' else StringToDate(InputLink.Column, "%yyyy%mm%dd")
[/quote]
Post Reply