cancel
Showing results for 
Search instead for 
Did you mean: 

Run a BODS job, multiple times, parallelly.

Sreekanta
Discoverer
0 Kudos

Hello experts,

I have a unique requirement. Due to large volume of data, the client has asked us to run the same BODS job multiple times. Each job will have filter criteria based on sequence number we pass into the job. We have designed the BODS job (xyz) and the job is running successfully using internal BODS script.

When we are calling the job (xyz) from the .sh file present in another job, as shown below, the xyz job is getting triggered sequentially. Meaning, the second statement is getting executed only when the first statement is complete and so on.

exec('sh','/usr/sap/ADQ/dataservices/log/xyz.bat',8);  
exec('sh','/usr/sap/ADQ/dataservices/log/xyz.bat',8);
exec('sh','/usr/sap/ADQ/dataservices/log/xyz.bat',8);  

How to call the same job (xyz) multiple times, parallel? I do not want to design a job calling another job inside, calling another job and so on.

Note - The Basis team will make sure that the BODS server can support running the same job multiple times. I have read several posts but unfortunately I did not get any clear answer.

Any help or an idea how to achieve this will be highly appreciated.

Thanks and Regards

Sreekanta

 

Accepted Solutions (1)

Accepted Solutions (1)

Julian_Riegel
Product and Topic Expert
Product and Topic Expert

Hi,

I am pretty sure that the exec() function within DS waits for some kind of carriage return. So the batch file needs to be completed before the next line gets executed.

Try putting a single exec() script into a workflow, duplicate that workflow and design it in a way that all 3 workflows containing that script get executed in parallel.

If that does not work I would try using SOAP WS and trigger the jobs via RUN_BATCH_JOB

Edit: I quickly checked the Reference Guide and confirmed - you could also use Flag 256 instead of 8.

exec('sh','/usr/sap/ADQ/dataservices/log/xyz.bat',256);  
exec('sh','/usr/sap/ADQ/dataservices/log/xyz.bat',256);
exec('sh','/usr/sap/ADQ/dataservices/log/xyz.bat',256); 

As per Reference Guide

Page 1099

Use this flag to run your program independently of Data Services. Unlike flags 0-8, if you use flag 256, Data Services does not wait until the command (executable program) completes before continuing with job processing. In this case, the command runs independently of Data Services and stdout, stderr, and return code cannot be returned. Raises an exception (System function failure) if the program cannot be launched (e.g., program file not found).

Julian

Sreekanta
Discoverer

Hi @Julian_Riegel,

Thank you so much for the input.

Changing the number from 8 to 256 really helped to achieve what I was looking for. The same job is getting triggered multiple times, in parallel and independently.

I just added a while loop restricting the loop to run for the no. of times I want the job to get triggered. Inside the loop, I have kept the script with only one Exec() statement as mentioned by you. In this way, now, I am able to control dynamically the no. of times I want to trigger a particular job.

Answers (0)