I am a .net programmer started working in Datastage. I have a question where if anyone can help me will be appriciated.
Situvation
=======
I have a source flat file with two columns ID & NAME. I am passing data to another flat file using a transformer where I have a reject link also.
Flat file data is like this
1,"Arun"
2,"John"
3,"Neri"
My constraint in the transformer is
(InputLnk.ID <> 2 and InputLnk.NAME <> "Arun")
Expected output
==========
All rows should go to the target flat file
Actual Output
========
Row 1 and Row 2 rejected
Question
======
I consider this constraint of datastage is like an if condition in c++. It will be true if both the condition in the constraint is true. In the above example, if you check there is no row where the ID=2 and Name="Arun".
But still it rejecting.
Observation
========
In the constraint if I replace "AND" with "OR". It is not rejecting any rows. I feel like datastage doing "AND" purpose using "OR" and "OR purpose using "AND".
CAn anyone clarify me whats the actul situvation here?
Constraint issue
Moderators: chulett, rschirm, roy
This is not correct.Observation
========
In the constraint if I replace "AND" with "OR". It is not rejecting any rows. I feel like datastage doing "AND" purpose using "OR" and "OR purpose using "AND".
Please check in the source file stage whether the data is read correctly or not through ViewData..You may have missed to specify the quotes(") for the name field.
Thanks,
Mohan.A.Jasti.
Mohan.A.Jasti.
-
- Premium Member
- Posts: 238
- Joined: Fri Jul 25, 2008 8:55 am
The result you get is correct.
You wrote:
1,"Arun"
condition A:
condition B:
2,"John"
condition A:
condition B:
3,"Neri"
condition A:
condition B:
So DataStage worked right!!!
If you want none of this rows to reject, then write:
You wrote:
now let us look at each lineInputLnk.ID <> 2 and InputLnk.NAME <> "Arun"
1,"Arun"
condition A:
TRUEInputLnk.ID <> 2
condition B:
FALSEInputLnk.NAME <> "Arun"
FALSE => reject itA AND B
2,"John"
condition A:
FALSEInputLnk.ID <> 2
condition B:
TRUEInputLnk.NAME <> "Arun"
FALSE => reject itA AND B
3,"Neri"
condition A:
TRUEInputLnk.ID <> 2
condition B:
TRUEInputLnk.NAME <> "Arun"
TRUE => take itA AND B
So DataStage worked right!!!
If you want none of this rows to reject, then write:
NOT ( InputLnk.ID = 2 AND InputLnk.NAME = "Arun" )
Wolfgang Hürter
Amsterdam
Amsterdam