Robin,

PMFJI here: I do not know offhand what facilities PL/1 provides, but neither 
COBOL nor LE facilities provide time functions that return anything 
finer-grained than milliseconds.  COBOL native facilities are limited to 
hundredths of a second (ACCEPT from TIME).  In addition, you cannot measure CPU 
time with any of these facilities, only elapsed time.

The OP's original request seems to be asking for the equivalent of a profiling 
tool that will show CPU time spent in a COBOL program by statement or block of 
statements.  Language-based time facilities will not help solve that request.


Jake,

AFAIK there are no free tools or programs you can write which can measure CPU 
time for each COBOL statement.  You need to use a software tool like STROBE or 
CA-TRITUNE or one like them to get that kind of information.

For measuring elapsed (NOT CPU) time for large blocks of code, you can write an 
assembler subroutine to invoke one of the z/OS TIME macros to capture a start 
time and an end time for executing code, but you obviously have to modify your 
code to call the timing subroutine.

I know that is not much help, but that is the reality of measuring program 
performance on z/OS.  You have to pay for software to get that kind of 
information.

Peter

> -----Original Message-----
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-
> [email protected]] On Behalf Of robin
> Sent: Thursday, March 08, 2012 9:18 AM
> To: [email protected]
> Subject: Re: CPU timeused
>
> From: "Jake anderson" <[email protected]>
> Sent: Wednesday, 7 March 2012 7:05 PM
>
>
> > Hello All,
> >
> > I am looking for a assembler  source code which would help in measurng
> > the CPU time taken for each statement in COBOL. Could anyone advise me
> > if you have sample Code using which I can modify according to my
> > requirement.
>
> PL/I has builtin functions for obtaining the time, and for computing the
> elapsed time.
>
> Doesn't your COBOL compiler have something similar?
--


This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.

Reply via email to