Run sequence job from parallel job for each incoming value.

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
AKUMAR21
Participant
Posts: 30
Joined: Fri Jul 20, 2007 12:44 am
Location: Chennai

Run sequence job from parallel job for each incoming value.

Post by AKUMAR21 »

I have a parallel job that reads a csv file having two columns (col1, col2) through sequential file stage. For each value in the file I need to run a sequence job SeqJob1 and send the values of col1, col2 as parameter to the sequence job which will finally generate a report in xls format. Thus if there are 500 values in source csv I need to generate 500 reports after various formattings done by the set of jobs controlled by a sequence job SeqJob1.
So, How to run a sequence job by a parallel for every incoming value and send the vlues as parameters to the sequence job?
Any other methods are also welcome. I tried through a shell script but I couldnt able to find the right way.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Search the forums for examples of using the UtilityRunJob function.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chaks
Premium Member
Premium Member
Posts: 39
Joined: Wed Nov 22, 2006 9:21 pm
Location: MA

Post by chaks »

Hi Kumar,
I had similar situation except I wanted to read only one value. What I did was Like this

Code: Select all

Execute_Command     -->Loop Activity            ---> Sequence Job
(Read the values)  (Pass them as Parameters)     (Your job)
In this case you can read both columns as one from Unix and break them again in your parallel job
AKUMAR21
Participant
Posts: 30
Joined: Fri Jul 20, 2007 12:44 am
Location: Chennai

Post by AKUMAR21 »

Chaks

In your code, did u mean to read all the values at first using the shell script or one by one. I'm assuming that u r using the list loop option but how are u passing the values as parameters (one sequencer run per value) to the sequence job


Chulett

Can UtilityRunJob function be run from a parallel job? I think its a sequence job function.
"In god we trust; rest all we virus scan"
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes, of course - I wouldn't have suggested it otherwise. Don't confuse that function with a Job Activity stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chaks
Premium Member
Premium Member
Posts: 39
Joined: Wed Nov 22, 2006 9:21 pm
Location: MA

Post by chaks »

Yeah,Read all the values and pass it as list to the Loop Activity, and in the sequence you should select "Execute_Command.Comand_OutPut", It will pass the output from Execute Command to the list loop as parameter.
AKUMAR21
Participant
Posts: 30
Joined: Fri Jul 20, 2007 12:44 am
Location: Chennai

Post by AKUMAR21 »

Thanks Chaks

Can you show the code snippet of the shell script in which you are reading the values from the file and returning them to be fetched by the loop activity?
I tried doing that but I think I'm missing something in the script.
In addition to that could you let me know what are you mentioning in the loop definition -> delimited values section for the start loop activity stage.
Post Reply