Date from Julian Date CCYYDDD

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
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

Date from Julian Date CCYYDDD

Post by harshada »

Hi,

I need to convert the Julian Date to date of format 'YYYYMMDD'.
I read in the forum that the DateFromJulianDay should work and give the date in format 'YYYY-MM-DD'.

My input date is 2008354 (CCYYDDD)
so this should be 2008-12-19. I used
DateFromJulianDay(StringToDecimal(Trim(INP_2.DATEP)))
but got the output as '0786-08-02' which is incorrect

The input is coming in from the file and read as char(7).


Can anyone help me why I am getting the output like this.

Thanks,
Harshada
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

Post by harshada »

hey...

its resolved...

Just used StringToDate(Trim(INP_2.DATEP),"%yyyy%ddd")

Thanks anyways.. if anyone was trying over this one

Harshada
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

harshada wrote:
Thanks anyways.. if anyone was trying over this one

Harshada
That'll be me then!

For future info, this format of date is called an Ordinal Date, not Julian Date.
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

Post by harshada »

ohh sorry about that.. thanks for letting me know.

:)
Post Reply