how to load summary and detail records in single target 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
arvind
Participant
Posts: 17
Joined: Sun Aug 07, 2005 7:57 am

how to load summary and detail records in single target file

Post by arvind »

Hello All,

I want to know how to load summary record and detail records in a single target file.

number columns in summary and detail records will be different


A1 abc 20051009 (summary record)
B abc 20051009 123 456 678 (detail record)
B abc 20051009 234 532 567 (detail record)
B abc 20051009 654 234 234 (detail record)
A1 cde 20051009 (summary record)
B cde 20051009 123 456 678 (detail record)
B cde 20051009 234 532 567 (detail record)
B cde 20051009 654 234 234 (detail record)
based on column need to load summary and detail records in a single target file.
Please suggest me how to implement this logic.

Thanks in advance
Arvind
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

You could expirement with sub records via the make subrecord, split subrecord stages. Haven't used them myself.

You can also do it by splitting your input stream into two output streams and combining them again.
- A transformer would split the streams and allocate a counter to each row.
- A column export would merge the columns into two fields, one with the counter the other other with all the fields combined into a delimited string.
- A sort funnel would join the two streams back together again sorting by the counter and outputting the data to a sequential file stage. The sort would put the header and sub records into the correct order.
Post Reply