Warnings due to date_from_string,julian_day_from_date fns

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
partheev123
Premium Member
Premium Member
Posts: 20
Joined: Sun Dec 20, 2009 10:46 pm

Warnings due to date_from_string,julian_day_from_date fns

Post by partheev123 »

Hello All,

In my requirement I need to convert a input field(COL1) which is read as String(Varchar(8)) to JulianDay.

Example of Input field value : 20110222
I used the following derivation in the Transformer.

JulianDayFromDate(StringToDate(COL1,"%yyyy%mm%dd") )

I am getting the correct output but found two warnings in the DataStage log.

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

Can you guys please suggest me ways to fix these warnings?
Ravi.K
Participant
Posts: 209
Joined: Sat Nov 20, 2010 11:33 pm
Location: Bangalore

Post by Ravi.K »

Some where in your data there may be invalid date. Try for one record and check whether the warning appear or not.
Cheers
Ravi K
partheev123
Premium Member
Premium Member
Posts: 20
Joined: Sun Dec 20, 2009 10:46 pm

Post by partheev123 »

Hi Ravi..Thanks for the response...

I tried for one record but still have the same warnings.
greggknight
Premium Member
Premium Member
Posts: 120
Joined: Thu Oct 28, 2004 4:24 pm

Post by greggknight »

Try using this to make sure your data is correct.
and reject the row that has invalid date conversions

IsValidDate
Returns whether the given value is valid for the type date.
v Input: testdate (date)
v Output: result (int8)
v Examples. If the column mylink.mydate contains the date 2011-09-13, then the following
function returns the value 1.
IsValidDate(mylink.mydate)
If the column mylink.mydate contains the string "380096.06", then the following function
returns the value 0, because the converted string is not a valid date.
IsValidDate(StringTodate (mylink.mydate))
"Don't let the bull between you and the fence"

Thanks
Gregg J Knight

"Never Never Never Quit"
Winston Churchill
ravireddy25
Participant
Posts: 59
Joined: Wed Dec 31, 2008 5:49 am

Post by ravireddy25 »

greggknight wrote:Try using this to make sure your data is correct.
and reject the row that has invalid date conversions

IsValidDate
Returns whether the given value is valid for the type date.
v Input: testdate (date)
v Output: result (int8)
v Examples. If the column mylink.mydate contains the date 2011-09-13, then the following
function returns the value 1.
IsValidDate(mylink.mydate)
If the column mylink.mydate contains the string "380096.06", then the following function
returns the value 0, because the converted string is not a valid date.
IsValidDate(StringTodate (mylink.mydate))

Try First Convert the string to date format like(yyyy-mm-dd) then convert the date to Julian.

Regards
Ravi
Ravi
ravireddy25
Participant
Posts: 59
Joined: Wed Dec 31, 2008 5:49 am

Post by ravireddy25 »

greggknight wrote:Try using this to make sure your data is correct.
and reject the row that has invalid date conversions

IsValidDate
Returns whether the given value is valid for the type date.
v Input: testdate (date)
v Output: result (int8)
v Examples. If the column mylink.mydate contains the date 2011-09-13, then the following
function returns the value 1.
IsValidDate(mylink.mydate)
If the column mylink.mydate contains the string "380096.06", then the following function
returns the value 0, because the converted string is not a valid date.
IsValidDate(StringTodate (mylink.mydate))

Try First Convert the string to date format like(yyyy-mm-dd) then convert the date to Julian.

Regards
Ravi
Ravi
ravireddy25
Participant
Posts: 59
Joined: Wed Dec 31, 2008 5:49 am

Post by ravireddy25 »

greggknight wrote:Try using this to make sure your data is correct.
and reject the row that has invalid date conversions

IsValidDate
Returns whether the given value is valid for the type date.
v Input: testdate (date)
v Output: result (int8)
v Examples. If the column mylink.mydate contains the date 2011-09-13, then the following
function returns the value 1.
IsValidDate(mylink.mydate)
If the column mylink.mydate contains the string "380096.06", then the following function
returns the value 0, because the converted string is not a valid date.
IsValidDate(StringTodate (mylink.mydate))

Try First Convert the string to date format like(yyyy-mm-dd) then convert the date to Julian.

Regards
Ravi
Ravi
Post Reply