cancel
Showing results for 
Search instead for 
Did you mean: 

Estimate of a batch job

Former Member
0 Kudos

Hello Experts

Is there a way to find the estimation of a background job, for example a batch job is already in process, business want to know , how long will it run?

This can be a new batch job or existing batch job. If this is an existing batch job, we compare with the average of previous ones and provides an estimate, this cannot be correct ,most of the time. What I am looking for is a way to find % completion of a batch job, This was an interview question to me, and he has given an hint, it is an SQL queries where they will input table info's and gets the estimate.

Does any one knows about this, I mean the sql query or any direct report or any other method, Waiting for your inputs.

When ever we face an issue like long running batch jobs, we raise a ticket with AGS and they tells an estimate, not sure how does they do.

Regards

Kiran

Accepted Solutions (0)

Answers (3)

Answers (3)

Reagan
Advisor
Advisor
0 Kudos

Hello

The SQL Trace, Single trace analysis functions will only help you in tracing the job activity which is under execution.

It will get the call points, execution plan, statements etc. It is not going to provide you the estimated time of completion of the job.

A batch might have completed yesterday within 1 hour. It can take more than that time today or in the future or maybe even less time.

It depends on the amount of data processed by the job, the I/O and also the present workload on the system.

You are not going to find the estimation with regards to what percentage a job has been completed using the above tracing.

As soon as you stop the tracing for an activity even though the job is still under execution it will only tell you the information traced until that time.

You can simply rule out these possible scenarios for the job completion estimation .

Even the run-time analysis of a job needs the activity to complete in order to provide the complete details else you will only get the information until you stopped the tracing.

When ever we face an issue like long running batch jobs, we raise a ticket with AGS and they tells an estimate, not sure how does they do.

Have a look at these links

http://help.sap.com/saphelp_40b/helpdata/en/c4/3a804a505211d189550000e829fbbd/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a804a505211d189550000e829fbbd/content.htm

I believe they must be using this mechanism. Not sure how effective this is and also I have never tried it to confirm.

At and to the left of the "current time" line, jobs that have already been processed or that are currently being processed.

The color of a job indicates its status. The length of a job symbol shows the amount of time actually required to process the job.

Regards

RB

Former Member
0 Kudos

Thanks Reagan, let me check and confirm you..........

Former Member
0 Kudos

Hi,

This is a question when the scenario will change depending on the type of the job.

Like i have one new batch job which is set up in Hr system relate to any functionality.

So the first step is to identify that what the job is doing and what is the criteria for it to complete. So like i need to check how many people in org structure have booked a leave. So i have here that if the no of employee as my criteria . So simple run a SQL trace and see which employee do you see in the trace and then go with an estimate how much time it took to reach here and how much it will take more.

This will give you an estimate for the time required for a job to complete.

Thanks

Rishi abrol

Former Member
0 Kudos

When you say SQL trace , is it a st05 trace, or an sql query.

Former Member
0 Kudos

Hi,

Yes its Sql trace not query.

Thanks

Rishi Abrol

Former Member
0 Kudos

But Rishi, how will you select the right query, because there might be some 40-60 batch runs happens simultaneously, and all of them will be using the same user batchuser, generic user. 

Former Member
0 Kudos

Hi mate,

You are making thing more and more complex. but still have got some thing to justify that.

But you can start try to to have valid selection using filter and that can be related to program or table.

We can also use st12 and then save the trace related to the background process.

Thanks

Rishi abrol

Former Member
0 Kudos

Thanks Rishi, I will try and let you know.

Former Member
0 Kudos

Hi Rishi

how does SQL trace help here. Because from the above scenario, how do you know , how much records you are going to get processed, for example, say "x" records. After doing the trace, how do you know that some "y" records is completed. SQL trace does not give that info.Only in Job logs you get that info in the start, if the abaper has written a program like 8000 object selected or 10000 object selected etc.

Please let me know .

Regards

Kiran

Former Member
0 Kudos

Hi,

As i mentioned you you will have an idea like in above case how many employees are active and how many employee will be come in the criteria of the leave booked.

And the developer will know some stat who would have worked on it.

Thanks

Rishi Abrol

Former Member
0 Kudos

Hi Rishi

Those information I will not have, because most of the jobs will be periodic jobs.Some times 4 hrs or 12 hrs or 1 day. Here the scenario is much complex, it will be a job chain, which consists of multiple jobs with multiple programs and multiple variants, which has access to n number of tables.

I Appreciate your response .

Regards

Kiran

Former Member
0 Kudos

Hi,

What ever be the complexity at a time job will still run with program and with a varient.

If you know some functionality of the system you can figure the time or the stats that job will take. A thing is that you need to pick one chain at atime.

A chain would mean that you have n job in chain and if you know some point you have reached at n-10 job .for the current job running can be found using sql trace and for the further job you need to get the stats of old job that have run .To get the stats of the old job just find the time which is similar like billing cycle week or pay run week ie. just an idea .

Thanks

Rishi Abrol

Former Member
0 Kudos

HI Kiran,

As per my knowledge its very difficult to predict or to give estimation on any batch job.

It depends on the programme we are using to automate & its variant we set to consider the data range etc. Actually it depends on the data exactly it fetches during the run & how much time it takes to execute. So I am not very sure there is a way to precisely tell on the exact time it takes but just we can compare out of it previous run & predict.

Regards.

Former Member
0 Kudos

Previous run stat is helpful some times, but not always, it is just a prediction.For every run of the batch job, the number of records it access might be different, but the program will access basically the same tables, it won't be different. System load can be different every time, but if there is a sql query or some thing, it should tell the exact percentage completion or time needed to complete for that particular run.

This is what I am looking for...............

Thanks mate for the quick response .

Cheers

Kiran