Date comparision (greater than or less than)

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
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

Date comparision (greater than or less than)

Post by pavan_test »

Hi All,

I have source datatype from oracle as 'date'. I am reading this as timestamp.

I have another source from different table with datatype as 'date' and i am reading this as timestamp.

in ETL transformer, I am using timestamptodate function to convert them to date.

I am trying to achieve this in ETL, if a > b and a<=c then output 'true'

after i use TimestampToDate function i find these values in peek stage for a,b,c

a= 2006-03-24
b=2004-06-07
c=2007-05-24

when i try this in transformer a > b and a<=c, i get null in the output. can someone please suggest. Thanks You.
can
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Post by srinivas.nettalam »

Where are you writing this derivation? What is the datatype of the field/variable where you are writing this expression?
N.Srinivas
India.
bob7027
Participant
Posts: 22
Joined: Wed Oct 03, 2012 2:49 pm
Location: United States

Post by bob7027 »

change the data type for all fields to timestamp & check with 'isvalid' condition for 'timestamp', then you can write if then else condition

thx
123gopal
Participant
Posts: 16
Joined: Sat Feb 09, 2013 11:41 am
Location: chennai

Re: Date comparision (greater than or less than)

Post by 123gopal »

could be Use Oconv() and ICONV() fuctions after compare that
mgplk
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: Date comparision (greater than or less than)

Post by ray.wurlod »

123gopal wrote:could be Use Oconv() and ICONV() fuctions after compare that
In a parallel job?
After?!!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
123gopal
Participant
Posts: 16
Joined: Sat Feb 09, 2013 11:41 am
Location: chennai

Re: Date comparision (greater than or less than)

Post by 123gopal »

use the functions ICONV() and OCONV() instead of using timestamp to date in parallel job
mgplk
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

123gopal: To echo Ray's question, why? ICONV and OCONV would require the use of a BASIC transformer, potentially affecting performance if this parallel job.

Pavan, can you provide the actual derivations you have written?

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
Post Reply