How to convert JULIAN DATE to DATE using schema file

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
pdv
Premium Member
Premium Member
Posts: 23
Joined: Mon Oct 30, 2006 11:58 pm
Location: Chennai

How to convert JULIAN DATE to DATE using schema file

Post by pdv »

Hi, Could you please anyone help me on the below requirement.

I need to convert Julian date to date using schema file, I tried the below format, but which is not working.

date:nullable date {date_format='%cc%yy%ddd', null_field='0000000'};

date:nullable date {date_format='%yyy%ddd', null_field='0000000'};

Please anyone help me to know what is the correct format for ccyyddd (julian date) in schema file.


Thanks in advance.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Let's start by getting your post in the correct forum.

(moved)
-craig

"You can never have too many knives" -- Logan Nine Fingers
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

What's the format of your incoming date? The format string should specify that format...i.e. the format you're wanting to convert from.
If this were an output stage, it would be the format you're wanting to convert to.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So you're using an ordinal date (year and day number within year) rather than a Julian date (days offset from a known zero date)?
Try "%yyyy%ddd" as the format string.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Explain what you mean by "it's not working". What results DO you get and what is your output target? Are you loading directly to an Oracle table, or are you writing to a file before loading to Oracle?

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Are you sure you've tried "%yyyy%ddd"? Your initial post specified "%yyy%ddd".
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