Splitting Record and Merging after the Process.

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
jayram99
Participant
Posts: 10
Joined: Thu Aug 04, 2005 6:38 pm

Splitting Record and Merging after the Process.

Post by jayram99 »

Hi Everyone,

I have 1 record which i will split into 2 records and the 2 Records(Policy Details & Address Details) will follow different path.

I am doing the process for Policy Details and Address Details Simultaneously.

At the end of the Process, I want to Merge the 2 records into a single record as output.

I tried with Hash File to merge the 2 records but getting wrong values.

In Hash File i have Checked the Fields - Creat File and Clear File before writing.

When I run the JOB with 1 record at a time , getting the perfect results.

When i run the JOB with 4 input records and In Hash File it will store only the Last record and After merging i am getting the values of last record and 1,2,3 Records are missing.

Could someone help me about the same.

Thanks in Advance.

jayaram
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Doesn't sound like the Key field(s) you are using in the Hashed file are unique. You do understand that there is no such thing as a 'duplicate record' in a hashed file and duplicates are resolved via destructive overwrite, yes?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Post by ameyvaidya »

Recommend using the row number(@INROWNUM) as the hash key.
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
jayram99
Participant
Posts: 10
Joined: Thu Aug 04, 2005 6:38 pm

Splitting Record and Merging after the Process

Post by jayram99 »

Vaidya,

Thought in that way but we can't use INROWNUM as HASHKEY in HASH FILE.

There is no @INROWNUM for HASH FILE in System Variable.

Thanks & Regards,

jayaram
ameyvaidya wrote:Recommend using the row number(@INROWNUM) as the hash key.
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Re: Splitting Record and Merging after the Process

Post by ameyvaidya »

What I meant was:

In the transformer (I assume) that splits the single record(I assume this to be row of data) into Policy Details and Address Details, add another column to both output streams; set derivation of both to @INROWNUM.

this new column can be used as the hash key.

Sorry if i was not clear before. :)
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
dxp
Charter Member
Charter Member
Posts: 48
Joined: Sat Oct 01, 2005 10:23 am

Re: Splitting Record and Merging after the Process.

Post by dxp »

jayram99 wrote:Hi Everyone,

I have 1 record which i will split into 2 records and the 2 Records(Policy Details & Address Details) will follow different path.

I am doing the process for Policy Details and Address Details Simultaneously.

At the end of the Process, I want to Merge the 2 records into a single record as output.

Could someone help me about the same.

Thanks in Advance.

jayaram
hi jayaram
try this idea.

(1)inputfile-------->(2)transformer(split records)------------(3)write each record to copy stage1,copy stage2-------------->(4)join both copy stages--------->(5)output to target.


in step (3)....u have to create one new column DUMMY with SAME value in both stages.
in step (4)....join based on key column DUMMY with INNER JOIN.

reply me if it fits ur situation.



dxp.
Post Reply