Julian Dates to Regular Dates

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
mannoo19
Participant
Posts: 6
Joined: Mon May 31, 2004 10:59 am

Julian Dates to Regular Dates

Post by mannoo19 »

Hi,,
Can someone help me by telling, how can we convert julian dates to regular dates..
Thanks in advance..
bryan
Participant
Posts: 91
Joined: Sat Feb 21, 2004 1:17 pm

Post by bryan »

there are many posts which covered this topic


would appreciate any senior validate my answer

oconv(iconv(JulianDate,"DYJ"),"D4-YMD[4,2,2]")



You could have wrote whats the format of your regular date.

hope that works
mannoo19
Participant
Posts: 6
Joined: Mon May 31, 2004 10:59 am

Post by mannoo19 »

Thanks Bryan,,
Let me try if this thing works,,
Thanks..
Shaina Austin
Participant
Posts: 17
Joined: Wed Jul 07, 2004 7:59 am

Post by Shaina Austin »

Hi,

If your format of output date is YYYYMMDD, this one works

DateGenericToTimeStamp(SourceLink)[1,8]

This converts to a Time stamp and you can just pickup the date.

I am not sure if this is the right way to do it. But it works.
bryan
Participant
Posts: 91
Joined: Sat Feb 21, 2004 1:17 pm

Post by bryan »

It works. Its easy than knowing the whole D conversion code.

Or

we could also use the

DateGenericToODBC(linkname.input)

It ouputs date in the format YYYY-MM-DD.

Thanks Shaina
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

All of the previous responses are correct if, by "Julian dates", you mean a date containing the ordinal number of the day within the year.

If you mean some other form if Julian date, such as the ordinal number of the day in the century, or since some given "day zero", then techniques are similar but not identical. For example, there are some SDK transforms for handling dates based on day zero being 01/01/1970. Internally, DataStage uses a day zero of 31 December 1967.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mannoo19
Participant
Posts: 6
Joined: Mon May 31, 2004 10:59 am

Post by mannoo19 »

Hi ,
I have tried using :
DateGenericToTimeStamp(SourceLink)[1,8]
but i get the error message as :
"nput value not long enough for date format"

the input value is actually the julian date : 94070...
can someone help ..
thanks,
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Iconv(94070, "DYJ") or Iconv(94070, "D2YJ")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply