Page 1 of 1

Juilan date Conversion

Posted: Sat Aug 27, 2005 12:41 am
by dslearner
HI,

i need the some information regarding the julian date convertion,

My input filed value:20031126(flatfile)
My Target field value(julian date):37949(sybase)
base date is 19000101.

How can i get this in datastage??????????????

Thanks
Learner

Posted: Sat Aug 27, 2005 3:15 am
by ArndW
If you take your base date and convert it to internal format ICONV("1900-01-01","D4-YMD") you can subtract that from the date in question ICONV(In.Date,"D4YMD") to get number of days since base. This is, I think, the date you are looking for.

Please refrain from using the word "urgent" in your posts, it will not get you an quicker responses - in fact I am sure that others read this before me and decided not to respond and I almost didn't do so as well because of that one word.

Posted: Sat Aug 27, 2005 6:29 pm
by ray.wurlod
There are some SDK Routines for working with dates based on 1900-01-01. Check them out.

Posted: Mon Aug 29, 2005 3:09 pm
by kommven
create a routine and in routine use this one

Ans = @NULL
If IsNull(TheDate) Then RETURN(Ans)
TheYear = TheDate[1,Len(TheDate)-3] + 1900
TheDay = TheDate[3] ;
DSJulianDate = TheYear : "" : TheDay
Ans = Oconv(Iconv(DSJulianDate, "DYJ"), "D-YMD[4,2,2]")

RETURN(Ans)