Appending data to the exising record

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

Appending data to the exising record

Post by deva »

Hi,
I have 4 fields from source those are
fac
pol
end
comm

if fac,pol,end is same then I have to append the comm to existing comm, without creating new record.

Thanks in advance.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Put your source keys into a work table if not already there. Join to existing keys and build a hashed file. Reference lookup drives update v. insert and gives the 'old' value to append to for the updates.

Pretty standard stuff.
-craig

"You can never have too many knives" -- Logan Nine Fingers
deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

Post by deva »

Hi thanks for you reply I am doing the same

I am taking the source file and doing the lookup with 3 key cols(fac,pol,end) and comparing those 3 keys if same then append.

It is appending correctly, but it is creating one more record and appending the data.

EX: out put is showing as follows, insted of second row , it showing first row as well.
999, 1991, 10, Hi
999, 1991, 10, Hi How r u
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What's your target? Update action? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

Post by deva »

I am writing into file.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:? I don't see how that would happen. Post the details of your job design including constraints, stage variables, etc. As much detail as you can stand to document.
-craig

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