Page 1 of 1

Splitting Record and Merging after the Process.

Posted: Wed Dec 07, 2005 9:01 am
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

Posted: Wed Dec 07, 2005 9:40 am
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?

Posted: Wed Dec 07, 2005 12:58 pm
by ameyvaidya
Recommend using the row number(@INROWNUM) as the hash key.

Splitting Record and Merging after the Process

Posted: Wed Dec 07, 2005 5:39 pm
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.

Re: Splitting Record and Merging after the Process

Posted: Wed Dec 07, 2005 6:25 pm
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. :)

Re: Splitting Record and Merging after the Process.

Posted: Fri Dec 09, 2005 4:52 am
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.