Page 1 of 1

NEW TO DATASTAGE(SCENARIO HELP)

Posted: Sun Jul 24, 2011 11:10 pm
by VVVRAVINDRA999
I/P after using look-up is like this
CID,CNAME,STATE,STATUS,State_desc
11,sun,AP,1001,ANDHRA PRADESH
22,moon,TN,1111,TAMIL NADU
33,star,KK,1000,KANYA KUMARI
44,pluto,JK,1011,
55,sunn,ap,1000,
66,rad,AP,1111,ANDHRA PRADESH
73,star,kk,1000,
84,pluto,JK,1011,
95,sunn,ap,1000,
46,rad,AP,1111,ANDHRA PRADESH

have to load in to target using transformers or filter with out using reject link so o/p shold be like this

T1
11,sun,AP,1001,Andhra Pradesh
-----
----
T2
44,pluto,JK,1011,
55,sunn,ap,1000,

plz help

Posted: Mon Jul 25, 2011 2:52 am
by Romy
can you be still more explain your requirement. how you are filtering the rows between two tables. if state name is present it should go to T1 and if it is null or empty it should go to T2. is that correct?

Posted: Mon Jul 25, 2011 3:30 am
by ray.wurlod
What are T1 and T2? Are there more of them? What determines which rows go into which group? Do you have a specification (in English, not in code or pseudo-code)?

Posted: Mon Jul 25, 2011 5:32 am
by VVVRAVINDRA999
Romy wrote:can you be still more explain your requirement. how you are filtering the rows between two tables. if state name is present it should go to T1 and if it is null or empty it should go to T2. is that correct?
@Romy yes, u exactly got my point
There r 2 tables like
CID,CNAME,STATE,STATUS

Table 2
STATE,STATE_DESC

so i used look-up and made it as 1 table , know I want to load it to 2 targets(sequential file) if state name is present it should go to T1 and if it is null or empty it should go to T2

Posted: Mon Jul 25, 2011 6:58 am
by chulett
So, one way would be two output links from a Transformer with appropriate constraints on the STATE_DESC column.

Posted: Mon Jul 25, 2011 7:27 am
by VVVRAVINDRA999
i have tried writing condition in transformer stage for constraints like
DSLink8.State_desc = " " for one link and
DSLink8.State_desc <> " " for second link but o/p is moved in to 1 target

Posted: Mon Jul 25, 2011 8:06 am
by chulett
Then your constraints are not appropriate. What is the actual value that column has when the lookup fails? It will only be a space if you've made it that, typically one would assume null or not null.

Posted: Mon Jul 25, 2011 8:35 am
by VVVRAVINDRA999
@ chulett yes, I know my constraints are wrong and the looKup has been successful so far but the problem comes when i added transformer stage to it and my o/p is comin to 1 target like ao records to 1 target and 0 records in trget 2 if possible can u plz post the correct syntax for constraints for transfomer.

Posted: Mon Jul 25, 2011 10:02 pm
by siauchun84
Have you tried IsNull(DSLink8.State_desc) for the link DSLink8.State_desc = " "?

Posted: Tue Jul 26, 2011 8:14 am
by chulett
No-one can post the "correct syntax" without knowing what value you have in STATE_DESC for a failed lookup. As noted, null would be a good guess so if we're going to play the guessing game, try:

IsNull(DSLink8.State_desc) for the first (failure) link
Not(IsNull(DSLink8.State_desc)) for the second (success) link