Juilan date Conversion

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
dslearner
Premium Member
Premium Member
Posts: 67
Joined: Thu May 26, 2005 3:09 am

Juilan date Conversion

Post 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
Last edited by dslearner on Mon Aug 29, 2005 10:57 pm, edited 1 time in total.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

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

Post by ray.wurlod »

There are some SDK Routines for working with dates based on 1900-01-01. Check them out.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kommven
Charter Member
Charter Member
Posts: 125
Joined: Mon Jul 12, 2004 12:37 pm

Post 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)
Post Reply