Arguments in Job sequence Start 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
pavan31081980
Participant
Posts: 17
Joined: Sun Mar 19, 2006 5:46 am
Location: vja

Arguments in Job sequence Start Loop Activity

Post by pavan31081980 »

Hi All,

I need to run the jobs in multiple times,I designed the Job sequence for a particular job and added Start & End loop activity between the Job activity..It's working fine.

now i would like to know ;in runtime...how we can pass the START LOOP Activity 'FROM' & 'To' value.while running job ,Job should take the value from the database table or file and get the counts how many times jobs needs to run and run this job.

Please let me know ...ASAP

Thanks in advance.

Regards,
Durai
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And here we were, doing just fine up until you said this:

Please let me know ...ASAP

[sigh]

:!: Please try to avoid demands in your posts, everyone here is posting when and how often they can or care to. Demand 'ASAP' from your Support Provider, you are paying them for that service after all.

What precisely is your question? I'm not aware of any way to pull any hard-coded From and To values from the Start Loop stage, only the current loop $Counter value. You can, however, use job parameters for those values and then use those same job parameters in any job that needs to know what they were.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: Arguments in Job sequence Start Loop Activity

Post by sachin1 »

hello dear,

for your requirement, you need command activity stage, which will output start loop and end loop value concatenated.
just for example you create one .bat file with echo command.

get the output from command activity stage and put it in UserVariables_Activity stage creating one/two variables as per your requirement(use OCONV as required).

use these UserVariables in startloop stage.

it works fine just try.

job design as follows:

Execute_Command ------>UserVariables_Activity---->startloop---->Job_Activity---->EndLoop-->startloop
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Use the UserVariables stage for dynamic values, ones that change from run to run. For this, simple Job Parameters will work fine. Unless, of course, they really need to be dynamic. :wink:
Last edited by chulett on Mon Nov 19, 2007 7:50 am, edited 1 time in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

After you read the (number of iterations for loop) value from Database, store it in a hashed file. Now, in the job sequence, read the hashed file value (may be using the UtilityHashLookup via a RoutineActivity) and pass it to the Counter value of the StartLoop stage. Note: Use a dummy value (say, '1' as the value for the hashed file key coloumn).
gateleys
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Post by sachin1 »

yes job parameter will do if you are executing through batch runtime value change will be captured in sequencer.
Post Reply