Page 1 of 1

What factor influence the CPU time and elapsed time for a Job.

Posted: Tue Dec 15, 2015 10:39 pm
by Kanika
Hi,

I want to know what are the factors which can influence and decide on CPU time and the elapsed time taken by a Job. I have a Job which is running a simple COBOL batch program. This program has a single input file and two output file. The program read the input file and writes to output files.

I execute this Job for five time with same number of input records and keeping all the other things same but in all the runs I get different CPU and elapsed times. Why this happens? I would expect the times to be same. Are there some factors influencing the CPU time and elapsed time apart from the obvious. Please enlighten me.

Re: What factor influence the CPU time and elapsed time for a Job.

Posted: Tue Dec 15, 2015 10:51 pm
by Robert Sample
CPU won't usually vary much for a given job -- but the system records it to much greater precision that the JES2 or JES3 output will show. Hence you may see slight variations in CPU time but you won't generally see huge differences. If you see more than .1 or .2 CPU second difference between jobs, there's probably something else going on to impact CPU time.

Elapsed time, however, is a totally different story. Elapsed time depends upon the number of address spaces (batch jobs, TSO users, started tasks and possibly OMVS processes) executing in the LPAR, their relative priorities compared to yours, how busy the CPU is, the WLM (Workload Manager) policy, and so forth. I have seen jobs that run in 2 minutes when the system is not busy take more than 5 hours when the CPU is running 100% -- even though the CPU time was within .1 second of the same.

Re: What factor influence the CPU time and elapsed time for a Job.

Posted: Fri Mar 25, 2016 1:48 pm
by Kanika
Robert Sample wrote:CPU won't usually vary much for a given job -- but the system records it to much greater precision that the JES2 or JES3 output will show.  Hence you may see slight variations in CPU time but you won't generally see huge differences.  If you see more than .1 or .2 CPU second difference between jobs, there's probably something else going on to impact CPU time.

Elapsed time, however, is a totally different story.  Elapsed time depends upon the number of address spaces (batch jobs, TSO users, started tasks and possibly OMVS processes) executing in the LPAR, their relative priorities compared to yours, how busy the CPU is, the WLM (Workload Manager) policy, and so forth.  I have seen jobs that run in 2 minutes when the system is not busy take more than 5 hours when the CPU is running 100% -- even though the CPU time was within .1 second of the same.
Thanks!
If I want to calculate the CPU time consumed by a job, then should I rely on the CPU time shown in the SYSOUT of the job or I should look for some other place?

Re: What factor influence the CPU time and elapsed time for a Job.

Posted: Fri Mar 25, 2016 4:39 pm
by Robert Sample
The quick and easy and hence not very accurate way is to look at the job output.  If you want more detail the SMF type 30 record is generated at the end of the job and it has LOTS of detail.  It may not be accessible to applications people at your site, though.
And your post said CPU time as if it is a single number.  It is actually multiple numbers (TCB, SRB, zAAP, zIIP) that are combined to be called "the" CPU time for the job.

Re: What factor influence the CPU time and elapsed time for a Job.

Posted: Fri Apr 29, 2016 12:14 pm
by Kanika
And your post said CPU time as if it is a single number. It is actually multiple numbers (TCB, SRB, zAAP, zIIP) that are combined to be called "the" CPU time for the job.
So I need to calculate all these to get the CPU time or look at the CPU time from SYSOUT?

ANd Where are these factors shown for a job run?

Re: What factor influence the CPU time and elapsed time for a Job.

Posted: Fri Apr 29, 2016 4:19 pm
by Robert Sample
 The CPU time on SYSOUT is TCB and SRB if I recall correctly.  The source for good CPU data is the SMF records - for a batch job, type 30 subtype 4 / 5 (step / job termination records).