Loop Activity

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
palaniappan
Participant
Posts: 41
Joined: Wed Mar 05, 2003 1:28 am

Loop Activity

Post by palaniappan »

Dear All,

Would like to have your suggestion for the below scenario.

Source table has the following structure and data

Geo_Name, Geo_Ds, Cntry_Cd
'ABC','ABC','FI'
'DEF','DEF','FI'
'ASD','ASD',DK'

The target table is country specific like Geo_#Cntry_Cd#

I have a DS Job which has Cntry_Cd as a parameter and selects only country specific data from the source and inserts into the specific target table. I have set this job as a multi instance job

I am done till this. I am a bit struck when it comes to including this job in a sequencer. I want to sequence this in such a way that If there are 'n' distinct country codes in the source, this job has to run for 'n' instances each selecting the respective countries data and inserting into the respective countries table. Also I want to run all these jobs in parallel.

Assuming that I know the country codes for which I need to process, I designed a sequencer job which uses loop activity. I hard coded the two country codes in the list of the loop activity. The sequence successfully triggers the job twice but it does sequentially. How can I achieve parallel processing of these jobs?

And if I need to arrive at the country codes while executing rather than hard coding in the loop activity, how can I achieve it?

Thanks, Pal.
palaniappan
Participant
Posts: 41
Joined: Wed Mar 05, 2003 1:28 am

Post by palaniappan »

Just realised from looking into other posts that I can arrive at a solution to my second question of getting the country codes by writing a routine. So I would like to have an answer for the first question of how to achieve parallel processing rather than sequential execution.

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

Post by ray.wurlod »

If you're going to write this routine you could write it as a job control routine, and invoke the jobs directly. This might be a bother to maintain, however. Alternately use a job sequence with Job activities started in parallel but subject to the list of country codes containing the particular code for that job (using a Nested Condition activity in each case). Design the job sequence so that not too many jobs are started in parallel, lest you overload the machine and generate code -14 errors (unable to start job within expected time).
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