Comparing 2 dates in a Filter stage

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
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Comparing 2 dates in a Filter stage

Post by ag_ram »

Hi Folks

I'm passing date in a a preset format to a filter stage from a unix script, this is a constant for a particular day . I am comparing this date with data coming into a Filter . The comparison seems to yield some results that are not consistent . Do i have to use a transformer to compare the dates , or i have to the check th comparison logic in the filter ?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What is the date format?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
vipshiva
Participant
Posts: 26
Joined: Thu Sep 28, 2006 4:48 am

Post by vipshiva »

Ram,
Both the date formats have to be same....

Regards,
Shiva....
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Comparison could be >, <, =<, => or even <>. For this very reason, not only they have to be in identical formats, they should be in YYYY-MM-DD or YYYY/MM/DD. In short, any format that first has 4 digit year, 2 digit month and 2 digit day.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post by ag_ram »

Folks thanks for your comments first ! But seems that there is something missing altogether , i tried to parameterise the date passed from a shell script and compare Something like

ROWDATEFIELD > #shellScriptDate#

This is not working at all ! The where clause does not get a boolean parameter to evaluate !

-------------------------------------------------------
Parse error: Expected 'is' statement ('is true', 'is false') or boolean operator (and, or) got: "-05".
Parse error: Expected 'is' statement ('is true', 'is false') or boolean operator (and, or) got: "-05".

05 is the month in the shellScriptDate (YYYY-MM-DD) and MM is 05 !
------------------------------------------------------

Any other stages that can pull this trick off ? Any workarounds for the filter ..
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

Aint this a Parallel Edition Question? Its in the wrong Forum..
Post Reply