Matching header record with detail records of an input file

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
mkapoor
Participant
Posts: 5
Joined: Mon Feb 06, 2006 8:03 am

Matching header record with detail records of an input file

Post 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
ccatania
Premium Member
Premium Member
Posts: 68
Joined: Thu Sep 08, 2005 5:42 am
Location: Raleigh
Contact:

Post 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,
Charlie
Post Reply