Page 1 of 1

Filter

Posted: Fri Jul 28, 2006 11:26 am
by DS_MJ
Hello:

Need to separate data by column Id's (COL_ID) into two files.

File 1 should have column id's with length 10 characters

File 2 should have column id's with "everything else."

COL_ID CHAR 18
AX02L7-CAL-110
AX02D7-DOM
ZZZ2D7-DMM-285

Am able to put column id's with length 10 Char to file 1.
using COL_ID[1,10] in transformer

However, in file 2 am NOT able to keep column id's with length 10 Char "OUT" they too get included in this other column Id's file.

Tried using constraint in transformer with
COL_ID <> COL_ID[1,10] or
COL_ID > COL_ID[1,10]

what happens then is that both files output COL_ID with 10 chars.

Code: Select all


Seq File ---> Transform --->COL_ID_with_10Chars
                   |
                   |
                  \/
            Rest_All_COL_ID

Tried using Filter Stage. But the job aborts due to the following errors:

In the Where Clause used COL_ID[1,10] for Link 1 but when I execute the job get the following error:

Parse error: Expected comparison, 'between', or 'like' operator, got: "["
Parse error: Expected boolean operator (and, or) got: "1".

How do I accomplish this...?

Posted: Fri Jul 28, 2006 11:56 am
by narasimha
Check with len function and add it as a constraint to the required output file

Posted: Fri Jul 28, 2006 2:00 pm
by DS_MJ
narasimha wrote:Check with len function and add it as a constraint to the required output file
Thanks narasimha for your quick reply.

Can u elaborate...?

Posted: Fri Jul 28, 2006 2:14 pm
by meena
Hi DS_MJ,
I think you can write constraint

Code: Select all


[i]Need to separate data by column Id's (COL_ID) into two files. 

File 1 should have column id's with length 10 characters 

File 2 should have column id's with "everything else."[/i]

Code: Select all

LEN(I/P)=10 (FOR FILE 1)
get a reject and keep it in second file(file 2). I am not sure but you can try...

Thank you

Posted: Fri Jul 28, 2006 2:33 pm
by narasimha
To follow up

Constraints on the file where you want 10 chars

Code: Select all

len(DSLink3.Key)=10
Constraints on the file where you want more then 10 chars

Code: Select all

len(DSLink3.Key)>10
or like meena said, write constraint for one and capture the reject in the other.

Posted: Sat Jul 29, 2006 1:23 am
by kumar_s
COL_ID[1,10] will just give you substirng of the first 10 charecters. If you want the based on the length, it has been explined in the previuos post.
If you need the first char in the first link and rest in the second file, then use COL_ID[11,len(COL_ID)] for the second file.

Posted: Mon Jul 31, 2006 4:23 pm
by DS_MJ
Thanks everybody:

Was able to use the Field function with Len function to get the required output.