Re: COBOL Time of Day in micro-seconds or nano-seconds
- From: SkippyPB <swiegand@xxxxxxxxxxxxxxxxx>
- Date: Fri, 30 May 2008 11:32:13 -0400
On Thu, 29 May 2008 11:46:43 -0700 (PDT), "don@xxxxxxxxxxx"
<don@xxxxxxxxxxx> wrote:
All
Does anyone know of a "standard" or widely accepted way to get COBOL
time of day in micro-seconds or nano-seconds for use in generating
more accurate transaction time-stamp and for use in measuring
transaction turn-around time.
The current-date function only returns hundredth of a second.
Using mainframe assembler the micro-second clock counter can be
accessed but that's not standard COBOL and not portable across
platforms. In J2SE Java, there is the method System.nanotime() to get
the more accurate time of day in nano-secounds available from the host
system but that's not standard COBOL either.
Don Higgins
don@xxxxxxxxxxx
Here's an alternative way that might work instead of using time of
day. This is from tek-tips.com and with it you can find the way to
determine the exact amount of used CPU for the current job. It may be
that you have to update the MVS-addresses. You can find them in some
manuals with a description of MVSDATA.
CBL TRUNC(OPT)
CBL NOSSRANGE
IDENTIFICATION DIVISION.
PROGRAM-ID. CPUTIME.
AUTHOR. CROX.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 CPU-TIME-DEF-WORKING-STORAGE.
03 MICRO-SECONDS PIC S9(15) COMP-3.
03 FW1 PIC S9(08) COMP.
03 PTR4 REDEFINES FW1 POINTER.
03 FW2 PIC S9(08) COMP.
03 PTR5 REDEFINES FW2 POINTER.
03 FW2-ALFA REDEFINES FW2 PIC X(04).
03 BFW2 PIC S9(18) COMP VALUE ZERO.
03 BFW2-ALFA REDEFINES BFW2 PIC X(08).
LINKAGE SECTION.
01 CB1.
03 PTR1 POINTER OCCURS 256.
PROCEDURE DIVISION.
MAIN SECTION.
0000.
PERFORM GET-MICRO-SECONDS.
0000.
GOBACK.
GET-MICRO-SECONDS SECTION.
GMS-01.
SET ADDRESS OF CB1 TO NULL.
SET ADDRESS OF CB1 TO PTR1(136).
SET PTR4 TO PTR1(80).
SET PTR5 TO PTR1(81).
MOVE FW2-ALFA TO BFW2-ALFA (5:).
COMPUTE MICRO-SECONDS = FW1 * 1048576 +
BFW2 / 4096.
DISPLAY 'MICRO-SECONDS = ' MICRO-SECONDS.
GMS-99.
EXIT.
Regards,
////
(o o)
-oOO--(_)--OOo-
"I never said most of the things I said."
-- Yogi Berra
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove nospam to email me.
Steve
.
- References:
- COBOL Time of Day in micro-seconds or nano-seconds
- From: don@xxxxxxxxxxx
- COBOL Time of Day in micro-seconds or nano-seconds
- Prev by Date: Re: COBOL Time of Day in micro-seconds or nano-seconds
- Next by Date: Re: COBOL Time of Day in micro-seconds or nano-seconds
- Previous by thread: Re: COBOL Time of Day in micro-seconds or nano-seconds
- Next by thread: Re: COBOL Time of Day in micro-seconds or nano-seconds
- Index(es):
Relevant Pages
|