Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

COBOL Time in Micro Second Level

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ashimprodhan

New User


Joined: 08 Dec 2006
Posts: 12
Location: Kolkata

PostPosted: Tue Nov 25, 2008 6:40 pm    Post subject: COBOL Time in Micro Second Level
Reply with quote

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
View user's profile Send private message

agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Tue Nov 25, 2008 7:04 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Tue Nov 25, 2008 7:04 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Nov 25, 2008 9:07 pm    Post subject: Re: COBOL Time in Micro Second Level
Reply with quote

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) icon_wink.gif

Bill
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Nov 26, 2008 2:00 am    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Wed Nov 26, 2008 2:18 am    Post subject:
Reply with quote

Huh? You trying to say this isn't common knowledge? That surprises me! icon_lol.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Wed Nov 26, 2008 2:32 am    Post subject: Reply to: COBOL Time in Micro Second Level
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Wed Nov 26, 2008 2:41 am    Post subject: Reply to: COBOL Time in Micro Second Level
Reply with quote

follow on to my previous post...
it would be better to investigate the use of the time macro
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Nov 26, 2008 2:58 am    Post subject:
Reply with quote

Robert Sample wrote:
Huh? You trying to say this isn't common knowledge? That surprises me! icon_lol.gif
Well, "that statement" just didn't click me that time.. icon_razz.gif
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1239
Location: Richfield, MN, USA

PostPosted: Wed Nov 26, 2008 10:55 am    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Wed Nov 26, 2008 5:53 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS transaction slow response time vasanthz All Other Mainframe Topics 1 Thu Jan 19, 2017 1:31 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts DD DUMMY & CPU TIME Nileshkul Testing & Performance analysis 16 Mon Dec 19, 2016 11:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us