Page 1 of 1

Fatal Error: Invalid Julian day

Posted: Mon Mar 01, 2010 5:46 am
by satish.raghavan
Hi all,

i have a job where the data is extracted from four sequential file undergoing joins and then the data is transformed and loaded into the Target.

In the transformer stage the following operations are done:

STAGE VAR:NEWCHABIM
If (IsNull(Ln_To_TRF.CHABIM) Or Trim(Ln_To_TRF.CHABIM, " ", "A") = '' Or Ln_To_TRF.CHABIM = "0") Then '2050-12-31' Else StringToDate(Ln_To_TRF.CHABIM,"%yyyy%mm%dd")


STAGE VAR:NEWOUVOR
If (IsNull(Ln_To_TRF.OUVOR) Or Trim(Ln_To_TRF.OUVOR, " ", "A") = '' Or Ln_To_TRF.OUVOR = "0") Then '2050-12-31' Else StringToDate(Ln_To_TRF.OUVOR,"%yyyy%mm%dd")


TARGET VARIABLE:DIFFERENCE
If (NEWCHABIM = '2050-12-31' Or NEWOUVOR = '2050-12-31') Then SetNull() Else Abs(JulianDayFromDate(NEWCHABIM) - JulianDayFromDate(NEWOUVOR))


When i run the job it is showing the error as
->Fatal Error: Invalid Julian day.
->Failure during execution of operator logic.
->The Section Leader on node node2 has terminated unexpectedly.

though it is showing job aborted in the director, the job is running and the data is loading into the target.

can anyone give me a solution to remove this error.

Posted: Mon Mar 01, 2010 6:38 am
by nani0907
hello,

convert in correct format .You have ''2050-12-31' .but while conveting it into StringToDate(Ln_To_TRF.CHABIM,"%yyyy%mm%dd") .It should bas as StringToDate(Ln_To_TRF.CHABIM,"%yyyy-%mm-%dd") .

Check format correctly

Posted: Mon Mar 01, 2010 8:12 am
by chulett
What is your target? And you haven't shown us what your input data actually looks like.

Posted: Tue Mar 02, 2010 12:11 am
by satish.raghavan
The input data is extracted as VARCHAR8 in the format 'YYYYMMDD' and then transformed and loaded into the target DATABASE TABLE as the DIFFERENCE of DAYS between the two DATES Z_OUVOUR and Z_CHABIM.

thanks and Regards,:)

Posted: Tue Mar 02, 2010 3:25 am
by ArndW
What datatype is "NEWCHABIM" - if you look at your code your are treating it as a string in the THEN clause, but as a date in the ELSE clause.

Posted: Wed Mar 03, 2010 12:48 am
by satish.raghavan
i hd tried converting it using string to date function for the variables NEWCHABOM AND OUVOR.

Now its working fine.

Thanks Arndw