View previous topic :: View next topic
|
Author |
Message |
ashimprodhan
New User
Joined: 08 Dec 2006 Posts: 12 Location: Kolkata
|
|
|
|
Hello Team,
In COBOL-74 there is a special register called TIMER which Represents the number of 2.4-microsecond intervals since midnight. It is a single, unsigned 11-digit, numeric integer.
for example say the time is midnight+4.8 microsecond then it will return 2,if it 7.2 then it will return 3.
I have to convert this COBOL program into Enterprise COBOL. Please suggest me how can i implement this. Is there any function/register that can manipulate time at microsecond level?
True Regards, |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Intrinsic FUNCTION CURRENT-DATE in Enterprise COBOL can give you resolution up to 100th of a second. Check in the manuals for more details and let us know if you need something else. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
To get that level of precision in Enterprise COBOL, you may have to call an Assembler program to get you the time. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
I believe the only way to get this is via a CALL to an ASSEMBLER sub-program, who issues a STCK (Store Clock) instruction.
Refer to your applicable Principles of Operation manual for the definition/use of STCK (One Doubleword) as well as STCKE (Store Clock Extended --- Two Doublewords).
STCKE was defined by IBM because STCK overflows September 2042 (not that I'm worried)
Bill |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Quote: |
STCKE was defined by IBM because STCK overflows September 2042 (not that I'm worried) |
Some times I wonder ..how do you guys know this much - I would need to do a lot more labour..hff...
-Ad |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Huh? You trying to say this isn't common knowledge? That surprises me! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
and before using the stck/stcke it would be importnt to well understand the implications...
the best source of info is the z architecture principle of opertions
searching for "STORE CLOCK" will give a lot of info to meditate on..
for example
Quote: |
..... snipped a few lines
.... For the same reasons, conversion
| between ETR time and UTC does not take
| into consideration the time adjustments prior
| to 1972, and, thus, ETR time differs from TAI
| by a fixed amount of 10 seconds. Because of
| the occurrence of 22 leap seconds, UTC now
| is behind TAI by 32 seconds.
4. A program using the clock value as a timeof-
day and calendar indication must be consistent
with the programming support under
which the program is to be executed. If the
programming support uses the standard
epoch, bit 0 of the clock remains one through
the years 1972-2041. (Bit 0 turned on at
11:56:53.685248 (UTC) May 11, 1971.) Ordinarily,
testing bit 0 for a one is sufficient to
determine if the clock value is in the standard
epoch.
5. In converting to or from the current date or
time, the programming support must take into
account that “leap seconds” have been
inserted or deleted because of time-correction
standards. When the TOD clock has been set
correctly to a time within the standard epoch,
the sum of the accumulated leap seconds
must be subtracted from the clock time to
determine UTC time.
|
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
follow on to my previous post...
it would be better to investigate the use of the time macro |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Robert Sample wrote: |
Huh? You trying to say this isn't common knowledge? That surprises me! |
Well, "that statement" just didn't click me that time.. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
A slightly different approach would be to use the 1st 16 digits of the function current-date (ccyymmddhhmmssth) and append an additional 4 digits to the end to fill out the entire microsecond portion of the time. The additional 4 digits could be a sequential number which would increment until the hundredths (th) changed, then start the 4 digits over again at 0001. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
STCKE was defined by IBM because STCK overflows September 2042 (not that I'm worried)
Some times I wonder ..how do you guys know this much - I would need to do a lot more labour..hff... |
Isn't this like knowing about the Unix time overflows in January 2038? |
|
Back to top |
|
|
|