Running same job multiple times for different records

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
Suman
Participant
Posts: 53
Joined: Thu Oct 07, 2004 8:28 am

Running same job multiple times for different records

Post by Suman »

Hi,
I have a job which is loading using BAPI to SAP from an Oracle table. I want to run this job for every 1000 records in a sequential way several times. Is there any way to automate this in datastage. I do not want to run the job in multiple instance.For example if the Oracle table has 20050 records the number of times this job should run is 21. The number of runs will vary with the number of records in the table.

Regards,
Suman
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In a job sequence get the count. Create a counted loop in the job sequence in which the start value is 1, the increment is 1000, and the limit is the count obtained from the table. When running the job within the loop assign one job parameter with the loop index variable ($Counter) and another with a value 999 higher. Use these job parameters in the WHERE clause when selecting from the Oracle table.
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