Page 1 of 1

Help needed in Datastage Parallel Job implementation Logic

Posted: Mon Sep 19, 2011 4:55 am
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:

Posted: Mon Sep 19, 2011 3:32 pm
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.