Comparing 2 date values

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
vskr72
Premium Member
Premium Member
Posts: 128
Joined: Wed Apr 28, 2004 9:36 pm

Comparing 2 date values

Post by vskr72 »

I am creating a simple Date comparision job.
1. Data is fed to Tx using 2 paths.
2. First path give a list of date values (Lets say Date1)
3. 2nd path gives me 2 ref dates from a Hash file. ( St_Dt and End_Dt).

All are in internal format. In the transformer I am using a simple constraint like this:

St_Dt=<Date1=<End_Dt.

I am not getting any result in the output seq file. The whole bunch of data is dumped a rejects. Basially no Lookup is performed. Not sure why this happens.

I removed the St_Dt and End_Dt and replaced them with physical values ( by viewing data from Hash file) and thejob works perfectly fine. Is there anything that I am missing here?

Appreciate your help/feedback. Thank you.
diamondabhi
Premium Member
Premium Member
Posts: 108
Joined: Sat Feb 05, 2005 6:52 pm
Location: US

Post by diamondabhi »

Hi vskr72,
U can solve this by using stage variables. :idea:
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Vskr,

try using

Code: Select all

 (St_Dt=<Date1) AND (Date1=<End_Dt)
in your constraint, this is parsed the way you want it; your original statement gets parsed left-to-right so that the result of the first compare gets evaluated to 0 or 1 and that is then used as the left argument of the next compare.
Post Reply