Page 1 of 1

wrapped stage

Posted: Mon Jul 19, 2010 9:08 am
by Mallayagari
Hi,
I need to run a sequencer in multiple instance mode. I have file say EMP_ID. For each EMP_ID I need to run the sequencer with EMP_ID as the parameter to the sequencer. [b]My requirement is that at any given time only N number of instances should be running untill it finishes for all the EMP_ID.[/b] Ex if in dev N=4 only four instances should be running and once the first EMP_ID is done it should take the 5th EMP_ID and run the sequencer.
I am planning to create a PX job which reads this sequjential file (which as EMP_ID list) and use the wrapped stage that calls the unix command DSJOB run command. When I try I am not able run any unix command from the wrapped stage.
[b]Can wrapped stage be used to run a unix script for each input row(sinlge column)?[/b]

Any other better solution?

Posted: Mon Jul 19, 2010 9:54 am
by ArndW
Using a server job or, better yet, logic in a job sequence is going to be much simpler than attempting to do in PX with a wrapped stage.

Is your EMP_ID file a sequential one with just the EMP_IDs in it and no other information? If so, you could read the file into a variable (just "cat" the file as an external command), then use that variable as your loop condition.

Try getting that basic loop to work first, then you can start adding functionality regarding concurrent multiple instance runs.

Posted: Mon Jul 19, 2010 5:12 pm
by ray.wurlod
Use a routine in the master control sequence that (a) checks how many instances are already running and (b) invokes the sub-sequence via DataStage API functions.