NEW TO DATASTAGE(SCENARIO HELP)

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
VVVRAVINDRA999
Participant
Posts: 7
Joined: Fri Jul 08, 2011 8:32 am
Location: AUS

NEW TO DATASTAGE(SCENARIO HELP)

Post 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
ravi
Romy
Participant
Posts: 26
Joined: Thu Nov 13, 2008 3:37 am
Location: Chennai

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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)?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
VVVRAVINDRA999
Participant
Posts: 7
Joined: Fri Jul 08, 2011 8:32 am
Location: AUS

Post 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
ravi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So, one way would be two output links from a Transformer with appropriate constraints on the STATE_DESC column.
-craig

"You can never have too many knives" -- Logan Nine Fingers
VVVRAVINDRA999
Participant
Posts: 7
Joined: Fri Jul 08, 2011 8:32 am
Location: AUS

Post 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
ravi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
VVVRAVINDRA999
Participant
Posts: 7
Joined: Fri Jul 08, 2011 8:32 am
Location: AUS

Post 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.
ravi
siauchun84
Participant
Posts: 63
Joined: Mon Oct 20, 2008 12:01 am
Location: Malaysia

Post by siauchun84 »

Have you tried IsNull(DSLink8.State_desc) for the link DSLink8.State_desc = " "?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply