ca.portal.admin

Arithmetic on FORMAT=3D(DTS) date from #GETIME

Discussion created by ca.portal.admin on Jul 7, 2010
Latest reply on Jul 8, 2010 by ca.portal.admin
#GETIME FORMAT=3D(DTS) returns a 64 bit date/time stamp (same as the SQL
date/time stamp) in registers 0 and 1. Does anybody know if you can perform
arithmetic on, for example, successive values of a FORMAT=3D(DTS) date/time
stamp.

In this instance all I am after is differences, often measured in
nanoseconds and rarely across minutes, between two times.

If I can get the time difference by simply getting successive values of
FORMAT=3D(DTS) and subtracting - then all is beautiful - I could use IDMSIN=
01
to give me DISPLAY values of the resultant time difference.

The main reason for asking is that this solves all of the problems with
first time in one day (or year) and the second time being in another day (o=
r
year). It also means I don't have to write my own formatting in assembler -
but that's been done before 8-)

TIA - cheers - Gary

Gary Cherlet
Justice Technology Services
Department of Justice, SA Government

"""""""" Telephone +61 (0)8 8226 5199
@@ Facsimile +61 (0)8 8226 5311
> Mobile +61 (0)41 333 1613
~~ MailTo:gary.cherlet@sa.gov.au


Gary says: Grab them by their data - and their hearts and minds will follow=
!

This e-mail message and any attachments are qualified as follows:
Addressing: If you have received this e-mail in error, please advise by
reply e-mail to the sender. Please also destroy the original transmission
and its contents. Confidentiality: This e-mail may contain confidential
information which also may be legally privileged. Only the intended
recipient(s) may access, use, distribute or copy this e-mail. Individual
Views: Unless otherwise indicated, the views expressed are those of the
sender, not Justice Technology Services. Computer Viruses: It is the
recipient's responsibility to check the e-mail and any attached files for
viruses.
"
IDMS 3rd-party providers forum
IDMSVENDOR-L@LISTSERV.IUASSN.COM
SMTP
IDMSVENDOR-L@LISTSERV.IUASSN.COM
IDMSVENDOR-L@LISTSERV.IUASSN.COM
SMTP








Normal

Normal
Re: Arithmetic on FORMAT=(DTS) date from #GETIME
"Here is what I have ended up doing - and thanks to everybody for their suggestions - cheers - Gary

Here's the #GETIME I used and the arithmetic to get the difference in 10,000ths of a second between two events:


#GETIME FORMAT=BINABS,RGSV=(R2-R8) <<R0 = time in nnnn.nnnn's and Julian date in R1>>
st R1,ccyyddd Store date in ccyyddd
* 00yyddd = 1900+ dates = add 19 to 0 = 20th century
* 01yyddd = 2000+ dates = add 19 to 1 = 21st century
ap ccyyddd,=pl4'1900000' Get correct Century into CC
* <19yyddd> Shows correct number of zeroes !
st R0,nsecs Time in nsecs
mvc edesc,descn Description in edesc

s R0,pnsecs
st R0,dnsecs Difference of CURRENT - PREVIOUS

l R1,nsecs
s R1,startnsecs Now calculate ""elapsed time""
st R1,elnsecs Difference of CURRENT - START


The results are stored in an array of ""events"" starting with a baseline event which has the start time, each subsequent event automatically gets two values associated with it - the ""difference"" between the prior and current events, and the ""elapsed time"" or duration between the current event and the ""first"" event.

After you have recorded as many events (each with an associated description) that you want - you can write the whole lot to scratch and then call a DC-Cobol program that will display the event array in a meaningful way. Here's the results from the ""Timer Event Display"" Program - which exposes in a formatted report of the contents of the ""Event Timer"" Record array stored in Scratch:

<Timer Event Display>0003<Events>0002<Differences>----------------------------
Started... Difference Elapsed... Description..... .................
10:02:12.2931 **< 1st CALL in DBUT001D <<< On first call there is no ""difference or elapsed - it is a ""priming call"" >>>

10:02:12.5531 00:00:00.2600 00:00:00.2600 **< Final CALL in DBUT001D <<< On second call the Difference between calls and the total elapsed are the same >>>

10:02:13.3756 00:00:00.8225 00:00:01.0825 **< last call to DBUT001D in ENTER <<< On 3rd and subsequent calls the difference is between current and previous call and elapsed is total time since first call >>>

<Timer Event Display>0003<Events>0002<Differences>----------------------------
GUT0125To: VoV ------> done <--- VoV

Gary Cherlet
Justice Technology Services
Department of Justice, SA Government

"""""""" Telephone +61 (0)8 8226 5199
@@ Facsimile +61 (0)8 8226 5311
> Mobile +61 (0)41 333 1613
\/ MailTo:gary.cherlet@sa.gov.au

Gary says: Boycott Apple - the hardware company that puts software companies out of business!


This e-mail message and any attachments are qualified as follows: Addressing: If you have received this e-mail in error, please advise by reply e-mail to the sender. Please also destroy the original transmission and its contents. Confidentiality: This e-mail may contain confidential information which also may be legally privileged. Only the intended recipient(s) may access, use, distribute or copy this e-mail. Individual Views: Unless otherwise indicated, the views expressed are those of the sender, not Justice Technology Services. Computer Viruses: It is the recipient's responsibility to check the e-mail and any attached files for viruses.

Outcomes