Help needed in Datastage Parallel Job implementation Logic

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
prabudsx
Participant
Posts: 14
Joined: Tue Dec 07, 2010 12:14 pm

Help needed in Datastage Parallel Job implementation Logic

Post by prabudsx »

Hi,
Please advise how to achieve the below scenario in Datastage

1) Insert one header record for each 100 batch records corresponding to source records.
Eg., IP--> Source 250 records.
OP--> 1 header
100 Batch
1 header
100 Batch
1 header
50 Batch

2) Constraints for Header--> One column in header will contain count of Batch records and another column in header will contain sum of Batch record column values. :oops:
___________________________________
Regards,
Prabu
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Operate in sequential mode.
Generate the line number.
Accumulate your totals in stage variables in a Transformer stage.
Generate a group number on the output, keep the line number, and use 0 as the header line number.
Output header and reset totals once Mod(line_number,100) is 0.
Funnel header and detail rows.
Sort by group then by line number.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply