Can I compare these two rows using DataStage then update if the Status field changing?
ID | desc | ... | ... | Status | Start_Date | End_Date
------------------------------------------------------------
123456 | ... | ... | ... | Y | 12/31/2014 | 21/31/9999
123456 | ... | ... | ... | N | 12/31/2014 | current_date
At beginning I only have this row
ID | desc | ... | ... | Status | Start_Date | End_Date
------------------------------------------------------------
123456 | ... | ... | ... | Y | 12/31/2014 | 21/31/9999
Then... I want to compare with this row
ID | desc | ... | ... | Status | Start_Date | End_Date
------------------------------------------------------------
123456| ... | ... | ... | N | 12/31/2014 | current_date
If the Status field changing from Y
to N
, I want to update the End_Date
with current_date
. If the Status field changing from N
to Y
, I want to update the Start_Date
with current_date
and End_Date
with 12/31/9999
again. Is it possible to do this in DataStage?
I tried using Switch Processing, but stuck when I want to Update in Netezza Connector.