Overhead on accepting system time



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Overhead on accepting system time

Postby TaahirZA » Tue Apr 23, 2013 12:57 pm

Hi

I have a program which every transaction invokes. I would like to know if accepting time from the system will incur any overhead. In other words, is accepting the system time equivalent to an I/O?

Thanks
TaahirZA
 
Posts: 3
Joined: Tue Apr 23, 2013 12:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Overhead on accepting system time

Postby enrico-sorichetti » Tue Apr 23, 2013 1:04 pm

describe the environment and define the meaning of transaction
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Overhead on accepting system time

Postby NicC » Tue Apr 23, 2013 1:06 pm

That is not the point: the point is where else would you get the system time?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Overhead on accepting system time

Postby TaahirZA » Tue Apr 23, 2013 1:17 pm

We are running in an IMS environment with an IMS transaction. Getting the time is not a critical aspect of my program, it would be a nice thing to have. If it causes additional I/O, i would rather leave it out.
TaahirZA
 
Posts: 3
Joined: Tue Apr 23, 2013 12:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Overhead on accepting system time

Postby BillyBoyo » Tue Apr 23, 2013 1:24 pm

Can you explain why it would be "nice to have"? It is needed, or it isn't. How are you going to use the time, for what purpose?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Overhead on accepting system time

Postby TaahirZA » Tue Apr 23, 2013 1:27 pm

I want to track errors on transactions. It would be nice to use a time stamp to calculate frequency of errors over a time range, but I don't want to incur additional overhead.
TaahirZA
 
Posts: 3
Joined: Tue Apr 23, 2013 12:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Overhead on accepting system time

Postby BillyBoyo » Tue Apr 23, 2013 1:44 pm

Produce a small batch program which does nothing much but get the time in a loop.

Produce another one which is identical but doesn't get the time.

Run both program with the same number of iterations. Say, 100,000 to start with. Keep going up [or down] until there is a significant difference in CPU used (or IOs, but I doubt it) [or until there is no significant difference in CPU used]. If there is a consistent and noticeable increase in elapsed time that might be something, but elapased time is a fickle beast to measure by (because it depends on so many things).

Assess results from against transaction volumes you system is going to process, per day, per hour, per minute, whatever.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Overhead on accepting system time

Postby dick scherrer » Tue Apr 23, 2013 10:13 pm

Hello and welcome to the forum,

If the time provides value (and it sounds like it does), get the time. You will probably not be able to measure the difference on a per-transaction basis. I'm assuming COBOL and using the internal function(s) rather than calling some subroutine.
Read here:
http://publibz.boulder.ibm.com/cgi-bin/ ... 50/6.2.1.2
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Overhead on accepting system time

Postby pmartyn » Wed Apr 24, 2013 12:57 am

Dick raises a good point. 'If the time provides value' and apparantly so. .
There seems to be some confusion as to what triggers I/O. To answer that we have to remind ourselves about Mainframe System Configuration.
I/O is typically generated when retrieving information is not in main storage (i.e.Disk). Since the System Clock is already in 'Main' Storage your retrieval should not cause any substantial overhead.

Here is the link provided by dick on how to retrieve the time using COBOL.
http://publibz.boulder.ibm.com/cgi-bin/ ... 50/6.2.1.2
pmartyn
 
Posts: 42
Joined: Thu Feb 28, 2013 7:11 pm
Has thanked: 5 times
Been thanked: 3 times

Re: Overhead on accepting system time

Postby Robert Sample » Wed Apr 24, 2013 1:06 am

1. Accepting the system time is going to require fewer system resources than an I/O. CPU activities take nanoseconds while I/O activities require milliseconds (or possibly microseconds in these days of cached disk activity).
2. The system overhead involved in "invoking" your program (whether CICS or IMS or whatever) will be, probably, orders of magnitude (that is, hundreds to thousands) of times more resource-intensive than accepting the system time.

These users thanked the author Robert Sample for the post:
pmartyn (Wed Apr 24, 2013 3:01 am)
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post