Page 1 of 1

constraints in transformer stage

Posted: Wed Aug 17, 2005 3:47 am
by Luk
Hello everybody!

I have following issue:

I want to test if input column1 is null, if yes I want to reject column (I do not want to have it in my output1)
I have transformer stage with 1 input and two outputs, also I have constraint defined for two outputs:

output1: IsNull(DSLink1.col1)
output2: REJECTED

also I have marked checkbox "reject row"

I don't get what I want. In output 1 I have all rows (even that in which column1 is NULL), and in output2 I have only theese rows in which column1 is NULL (that is what I want). I don't want rows with column1=NULL in output1!!

What am I doing wrong? Have you any sugestions?

regards

Posted: Wed Aug 17, 2005 4:47 am
by roy
Hi,
Usually I use:

Code: Select all

Len(Trim(Link.col)) = 0
As indication for empty or space only strings or nulls, when reading a sequential file they are the same.
Bare in mind there are times, like reading from DB, where they should be distincted and they don't mean the same thing.

this example is good when all stated options should be concidered as nulls.

IHTH,

Posted: Wed Aug 17, 2005 5:03 am
by Luk
roy, thanks for sugestionn , but this is not my problem! NULL detection (isnull() or Len(Trim(Link.col))=0) works fine !! But I don't want that rows with NULL detected goes to output1!! But they goes!! I don't know why!

Posted: Wed Aug 17, 2005 5:07 am
by ArndW
Luk,

did you remember that a constraint gets evaluated to TRUE and then sends the column out that stream.

Meaning that if the constraint reads "ISNULL(In.Column)" then only nulls columns are passed, and the REJECT merely takes any rows that haven't gone down any previous links.

Looking at your logic and reading your text I think you have the functionality inverted.

Posted: Wed Aug 17, 2005 6:31 am
by Luk
Yes, you have right Arnd! My nistake! Thanks!

Posted: Wed Aug 17, 2005 4:43 pm
by ray.wurlod
So you really need Not(IsNull(In.Column))