DCount / Concatenate

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
shaminmin26
Participant
Posts: 17
Joined: Mon Apr 21, 2008 9:53 pm
Location: SG

DCount / Concatenate

Post by shaminmin26 »

For Example :


Key Fact_Type FACT_VALUE
1 FF 10
1 FP 20


Output Results

Key FF FP
1 10 20


Currently, i am using stage variable to concatenate it. After Concatenate, the result will be FF|10|FP|20. After getting this result, i will use field to get the value.

If FF does not exists, my whole job will be screw up. Any better solutions?

Thanks in advance. :D
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Why don't you create separate stage variables ?

How do you decide when to write them to output?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What do you mean by 'if FF does not exists'... the record doesn't exist? The field is null? Something else? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
shaminmin26
Participant
Posts: 17
Joined: Mon Apr 21, 2008 9:53 pm
Location: SG

Post by shaminmin26 »

Bcos i am grapping the data from database. Although is known that the format will not change, there are times that records are rejected when it is load inside database.

If FF records does not load inside database. My whole job will go haywire bcos i am using field to determine. Are there any better idea around in doing it?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Order the records properly and check to see if the first value per key is 'FF' and handle accordingly if it is not... assuming that 'fact_value' would always come first per key.
-craig

"You can never have too many knives" -- Logan Nine Fingers
shaminmin26
Participant
Posts: 17
Joined: Mon Apr 21, 2008 9:53 pm
Location: SG

Post by shaminmin26 »

Ok. Thanks. :P
Post Reply