Page 1 of 1

Matching header record with detail records of an input file

Posted: Wed May 17, 2006 7:38 am
by mkapoor
Hi,

We have a requirement in our project wherein a source file having a single header record and multiple detail records have to be matched for batch date and update date respectively.

Current job design is as follows:-
1.Source file read using Complex file stage (using redefine feature of Cobol file layout we are able to read header and detail records having different structure).
2.Next stage is a filter stage wherein we seperate the header record and detail record on the basis of record type field value (0 for header, 1 for detail).
3.Both these streams joined using join stage with following inputs-
-detail record link from filter stage.
-column added to header record with a constant value 1 (record type of detail) and then feeded into join.
4.Join output :- Equi Join (1(header record) X N(detail records)) = N records with each record carrying batch date from header and all fields from detail record.
5. transformer to perform comparison between formatted update date (derived from detail record) and batch date (derived from header).
6. If batch date and update not equal reject, if equal accept else if update date is null replace it with batch date.

Can anyone please suggest a better way of doing the same.

Thanks and regards
Manish

Posted: Wed May 17, 2006 8:47 am
by ccatania
I have a similar process, where we load the header database first, then in the detail DS process, we used the header table for the look-up. I had originally tried it in one process, but it was not matching properly.

This process works,