Re: STCK and epoch time

2021-01-12 Thread Paul Gilmartin
On Tue, 12 Jan 2021 12:34:20 -0800, Charles Mills wrote:

>http://www.longpelaexpertise.com/toolsTOD.php sez 
>
>TOD: (STCK): x" D91B6D3E F6430440 "
>UTC Date and Time (Date + HH:MM:SS): 11-Jan-2021 21:25:22
>UNIX Date/Time: 1610400322
> 
Some consequence of this impelled me to look for CVTLSO:
PH03250: TIME64() FAILS TO RETURN A VALID VALUE WHEN CVTLSO IS NEGATIVE.

Over 11 days of negative leap seconds!?  And I thought I was the compulsive
tester of edge cases.

IBM fixed it

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread Paul Gilmartin
On Tue, 12 Jan 2021 17:24:52 -0600, Mike Schwab wrote:

>Request for information.
>To convert from STCK format to Unix time, what constants would you
>subtract from the STCK value for the same origin, then divide by what
>constant for the same time unit?  Or divide / subtract if easier.
> 
An example in Regina, tested with Itschak's hex example, giving
the same result as http://www.longpelaexpertise.com/toolsTOD.php

1073 $ cattimeoff
trace R
signal on novalue
numeric digits 20

call putenv "TZ=Universal"

TodOff = date( 'T', '1900-01-01', 'I' )
TimeNow = x2d( 'D91B6D3EF6430440' )
TimeDiv = 409600

UnixTime = TimeNow % TimeDiv + TodOff
1074 $ 
1074 $ regina timeoff
 2 *-* signal on novalue
 3 *-* numeric digits 20
 5 *-* call putenv "TZ=Universal"
 7 *-* TodOff = date( 'T', '1900-01-01', 'I' )
   >=>   "-2208988800"
 8 *-* TimeNow = x2d( 'D91B6D3EF6430440' )
   >=>   "15644217847788536896"
 9 *-* TimeDiv = 409600
   >=>   "409600"
11 *-* UnixTime = TimeNow % TimeDiv + TodOff
   >V>   "15644217847788536896"
   >V>   "409600"
   >V>   "-2208988800"
   >=>   "1610400322"


>> >> -Original Message-
>> >> From: Itschak Mugzach
>> >> Sent: Tuesday, January 12, 2021 10:00 AM
>> >>
>> >> This is the STCK value: D91B6D3EF6430440 (I have it in hex in variable 
>> >> TOD)
>> >> Converted to decimal  : 15644217847788536896
>> >> Actual dat eof run is : Yesterday

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread Mike Schwab
Request for information.
To convert from STCK format to Unix time, what constants would you
subtract from the STCK value for the same origin, then divide by what
constant for the same time unit?  Or divide / subtract if easier.

On Tue, Jan 12, 2021 at 5:09 PM Paul Gilmartin
<000433f07816-dmarc-requ...@listserv.ua.edu> wrote:
>
> On Tue, 12 Jan 2021 22:53:02 +0200, Itschak Mugzach wrote:.
> >
> >I tested that there already. My rexx returns a different time. I noticed
> >that they only use the first four bytes. The code snip I gave is from the
> >TOD IPCS rexx.
> >
> Regina gives me:
> 502 $ date
> Tue Jan 12 15:59:30 MST 2021
> 503 $  rxx "numeric digits 20; say d2x( (  time( 'T' ) - date( 'T', 
> '1900-01-01', 'I' ) ) %1.048576 )"
> D91C6646
>
> Pasting into  http://www.longpelaexpertise.com/toolsTOD.php sez
> TOD: (STCK): x" D91C6646  "
> UTC Date and Time (Date + HH:MM:SS): 12-Jan-2021 15:59:31
> UNIX Date/Time: 1610467171
>
> What was the output of your:
> >> Say 'STCK HEX VALUE ' c2x(tod)
> >> tod=C2D(tod)
> >> Say 'STCK DEC VALUE ' tod
> ???
>
> >> -Original Message-
> >> From: Itschak Mugzach
> >> Sent: Tuesday, January 12, 2021 10:00 AM
> >>
> >> This is the STCK value: D91B6D3EF6430440 (I have it in hex in variable TOD)
> >> Converted to decimal  : 15644217847788536896
> >> Actual dat eof run is : Yesterday
> >> the code:
> >> /* rexx */
> >> NUMERIC DIGITS 20
> >> RC = SYSCALLS('ON')
> >> ADDRESS SYSCALL  'TIME'
> >> Say 'Current date is' retval
> >>
> >> TOD = 'R _ 6   '
> >> Say 'STCK HEX VALUE ' c2x(tod)
> >> tod=C2D(tod)
> >> Say 'STCK DEC VALUE ' tod
> >> tod=Trunc(tod/4096)
> >> microsec=tod//100
> >> seconds=Trunc(tod/100)
> >> Say 'Seocnds =' Seconds
> >> xxx = 70 * 3600 * 24 * 365
> >> Say 'diff=' xxx
> >> Say Seconds - xxx
> >> SAY '2ND DIF = ' SECONDS - XXX - RETVAL
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN



-- 
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread George Kozakos
You can use IPCS LTOD stck-value to check that your calculation is correct


George Kozakos
z/OS Software Service, Level 2 Supervisor

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread Paul Gilmartin
On Tue, 12 Jan 2021 22:53:02 +0200, Itschak Mugzach wrote:.
>
>I tested that there already. My rexx returns a different time. I noticed
>that they only use the first four bytes. The code snip I gave is from the
>TOD IPCS rexx.
> 
Regina gives me:
502 $ date
Tue Jan 12 15:59:30 MST 2021
503 $  rxx "numeric digits 20; say d2x( (  time( 'T' ) - date( 'T', 
'1900-01-01', 'I' ) ) %1.048576 )"
D91C6646

Pasting into  http://www.longpelaexpertise.com/toolsTOD.php sez
TOD: (STCK): x" D91C6646  "
UTC Date and Time (Date + HH:MM:SS): 12-Jan-2021 15:59:31
UNIX Date/Time: 1610467171 

What was the output of your:
>> Say 'STCK HEX VALUE ' c2x(tod)
>> tod=C2D(tod)
>> Say 'STCK DEC VALUE ' tod
???

>> -Original Message-
>> From: Itschak Mugzach
>> Sent: Tuesday, January 12, 2021 10:00 AM
>>
>> This is the STCK value: D91B6D3EF6430440 (I have it in hex in variable TOD)
>> Converted to decimal  : 15644217847788536896
>> Actual dat eof run is : Yesterday
>> the code:
>> /* rexx */
>> NUMERIC DIGITS 20
>> RC = SYSCALLS('ON')
>> ADDRESS SYSCALL  'TIME'
>> Say 'Current date is' retval
>>
>> TOD = 'R _ 6   '
>> Say 'STCK HEX VALUE ' c2x(tod)
>> tod=C2D(tod)
>> Say 'STCK DEC VALUE ' tod
>> tod=Trunc(tod/4096)
>> microsec=tod//100
>> seconds=Trunc(tod/100)
>> Say 'Seocnds =' Seconds
>> xxx = 70 * 3600 * 24 * 365
>> Say 'diff=' xxx
>> Say Seconds - xxx
>> SAY '2ND DIF = ' SECONDS - XXX - RETVAL

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread Itschak Mugzach
Tx Charles.

I tested that there already. My rexx returns a different time. I noticed
that they only use the first four bytes. The code snip I gave is from the
TOD IPCS rexx.

Anyway, it will be an assembler, but I still wonder why I get wrong
numbers.

ITschak

*| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
and IBM I **|  *

*|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
*Skype**: ItschakMugzach **|* *Web**: www.Securiteam.co.il  **|*





On Tue, Jan 12, 2021 at 10:35 PM Charles Mills  wrote:

> http://www.longpelaexpertise.com/toolsTOD.php sez
>
> TOD: (STCK): x" D91B6D3E F6430440 "
> UTC Date and Time (Date + HH:MM:SS): 11-Jan-2021 21:25:22
> UNIX Date/Time: 1610400322
>
> Charles
>
>
> -Original Message-
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
> Behalf Of Itschak Mugzach
> Sent: Tuesday, January 12, 2021 10:00 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: STCK and epoch time
>
> This is the STCK value: D91B6D3EF6430440 (I have it in hex in variable TOD)
> Converted to decimal  : 15644217847788536896
> Actual dat eof run is : Yesterday
> the code:
> /* rexx */
> NUMERIC DIGITS 20
> RC = SYSCALLS('ON')
> ADDRESS SYSCALL  'TIME'
> Say 'Current date is' retval
>
> TOD = 'R _ 6   '
> Say 'STCK HEX VALUE ' c2x(tod)
> tod=C2D(tod)
> Say 'STCK DEC VALUE ' tod
> tod=Trunc(tod/4096)
> microsec=tod//100
> seconds=Trunc(tod/100)
> Say 'Seocnds =' Seconds
> xxx = 70 * 3600 * 24 * 365
> Say 'diff=' xxx
> Say Seconds - xxx
> SAY '2ND DIF = ' SECONDS - XXX - RETVAL
>
>
>
> *| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
> Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
> and IBM I **|  *
>
> *|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
> *Skype**: ItschakMugzach **|* *Web**: www.Securiteam.co.il  **|*
>
>
>
>
>
> On Tue, Jan 12, 2021 at 7:30 PM Seymour J Metz  wrote:
>
> > 409600 will give you units of 10 ms. Is that really what you want?
> >
> >
> > --
> > Shmuel (Seymour J.) Metz
> > http://mason.gmu.edu/~smetz3
> >
> > 
> > From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf
> > of Itschak Mugzach [0305158ad67d-dmarc-requ...@listserv.ua.edu]
> > Sent: Tuesday, January 12, 2021 12:19 PM
> > To: IBM-MAIN@LISTSERV.UA.EDU
> > Subject: Re: STCK and epoch time
> >
> > Paul,
> >
> > So if I ignore leap seconds, Can I just divide the number by 409600 and
> > subtruct 1.1.1970-1.1.1900?
> >
> > *| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
> > Platform* *|* *Information Security Continuous Monitoring for Z/OS,
> zLinux
> > and IBM I **|  *
> >
> > *|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404
> **|*
> > *Skype**: ItschakMugzach **|* *Web**:
> >
> http://secure-web.cisco.com/1L852dJoPXmqKt9ESjpybzsrC6kwCrmelHuY9TPZ6FI1UhWGxaTPRmDMPbv2-J-TuNYR19i6Etk0RoqzBfZLQdQtLviWwwBp8h9N4dDQB8A3EYjz9KKOqUnYbzA7gaNnoYO2QfsLXZEtnUlTJRXD0XDjWu63swogFiPD2kMAZ3JuBQaB5QMgq6ez7eOinZRRxlKKgcL_TnDcJbNi4LeM2hMtheU40OhWYMuPWP1WVeMCRcujHG9YP8bNig6miEen_MPWOkmLAWIUE_y1DiNulpfiKwSNgfGdpd4e1JXrM8nF-uSVh4vBU9A6-GSINEcDfR1D_BjfuPVtcl86DWYoDhc5NnvCbr2SlwtU_sZGrTobUpcBKotsb_8is79X7TY6ISxy2KRLlqDdGOkhH0qHDMlQjNd0ViYcltcvCTHTEJWaRSHpwx1hRx5cjiLjiqAHA/http%3A%2F%2Fwww.Securiteam.co.il
> > **|*
> >
> >
> >
> >
> >
> > On Tue, Jan 12, 2021 at 7:09 PM Paul Gilmartin <
> > 000433f07816-dmarc-requ...@listserv.ua.edu> wrote:
> >
> > > On Tue, 12 Jan 2021 16:30:52 +, Seymour J Metz wrote:
> > >
> > > >The TOD clock is just a counter; what you get out of it depends on
> what
> > > you put into it. There is a convention in PoOps, but if you want the
> > > correct time and date it is much easier to use system services than to
> do
> > > the adjustments yourself.
> > > >
> > > >MVS does not use the same epoch as Eunix. Unix System Services will
> > > adjust the epoch properly.
> > > >
> > > UNIX counts seconds, excluding leap seconds, starting
> 1970-01-01t00:00:00
> > > MVS  counts microseconds/4096, including leap seconds, starting
> > > 1900-01-01t00:00:10.
> > >
> > > >
> > > >From: ITschak Mugz

Re: STCK and epoch time

2021-01-12 Thread Charles Mills
http://www.longpelaexpertise.com/toolsTOD.php sez 

TOD: (STCK): x" D91B6D3E F6430440 "
UTC Date and Time (Date + HH:MM:SS): 11-Jan-2021 21:25:22
UNIX Date/Time: 1610400322

Charles


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Itschak Mugzach
Sent: Tuesday, January 12, 2021 10:00 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: STCK and epoch time

This is the STCK value: D91B6D3EF6430440 (I have it in hex in variable TOD)
Converted to decimal  : 15644217847788536896
Actual dat eof run is : Yesterday
the code:
/* rexx */
NUMERIC DIGITS 20
RC = SYSCALLS('ON')
ADDRESS SYSCALL  'TIME'
Say 'Current date is' retval

TOD = 'R _ 6   '
Say 'STCK HEX VALUE ' c2x(tod)
tod=C2D(tod)
Say 'STCK DEC VALUE ' tod
tod=Trunc(tod/4096)
microsec=tod//100
seconds=Trunc(tod/100)
Say 'Seocnds =' Seconds
xxx = 70 * 3600 * 24 * 365
Say 'diff=' xxx
Say Seconds - xxx
SAY '2ND DIF = ' SECONDS - XXX - RETVAL



*| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
and IBM I **|  *

*|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
*Skype**: ItschakMugzach **|* *Web**: www.Securiteam.co.il  **|*





On Tue, Jan 12, 2021 at 7:30 PM Seymour J Metz  wrote:

> 409600 will give you units of 10 ms. Is that really what you want?
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
> 
> From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf
> of Itschak Mugzach [0305158ad67d-dmarc-requ...@listserv.ua.edu]
> Sent: Tuesday, January 12, 2021 12:19 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: STCK and epoch time
>
> Paul,
>
> So if I ignore leap seconds, Can I just divide the number by 409600 and
> subtruct 1.1.1970-1.1.1900?
>
> *| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
> Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
> and IBM I **|  *
>
> *|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
> *Skype**: ItschakMugzach **|* *Web**:
> http://secure-web.cisco.com/1L852dJoPXmqKt9ESjpybzsrC6kwCrmelHuY9TPZ6FI1UhWGxaTPRmDMPbv2-J-TuNYR19i6Etk0RoqzBfZLQdQtLviWwwBp8h9N4dDQB8A3EYjz9KKOqUnYbzA7gaNnoYO2QfsLXZEtnUlTJRXD0XDjWu63swogFiPD2kMAZ3JuBQaB5QMgq6ez7eOinZRRxlKKgcL_TnDcJbNi4LeM2hMtheU40OhWYMuPWP1WVeMCRcujHG9YP8bNig6miEen_MPWOkmLAWIUE_y1DiNulpfiKwSNgfGdpd4e1JXrM8nF-uSVh4vBU9A6-GSINEcDfR1D_BjfuPVtcl86DWYoDhc5NnvCbr2SlwtU_sZGrTobUpcBKotsb_8is79X7TY6ISxy2KRLlqDdGOkhH0qHDMlQjNd0ViYcltcvCTHTEJWaRSHpwx1hRx5cjiLjiqAHA/http%3A%2F%2Fwww.Securiteam.co.il
> **|*
>
>
>
>
>
> On Tue, Jan 12, 2021 at 7:09 PM Paul Gilmartin <
> 000433f07816-dmarc-requ...@listserv.ua.edu> wrote:
>
> > On Tue, 12 Jan 2021 16:30:52 +, Seymour J Metz wrote:
> >
> > >The TOD clock is just a counter; what you get out of it depends on what
> > you put into it. There is a convention in PoOps, but if you want the
> > correct time and date it is much easier to use system services than to do
> > the adjustments yourself.
> > >
> > >MVS does not use the same epoch as Eunix. Unix System Services will
> > adjust the epoch properly.
> > >
> > UNIX counts seconds, excluding leap seconds, starting 1970-01-01t00:00:00
> > MVS  counts microseconds/4096, including leap seconds, starting
> > 1900-01-01t00:00:10.
> >
> > >
> > >From: ITschak Mugzach
> > >Sent: Tuesday, January 12, 2021 10:36 AM
> > >
> > >How exactly STCK (not STCKE) stores the time? I took the value (8 bytes)
> > >and converted it to decimal 10 characters. I expect it to be the same as
> > >the EPOCH time returned by USS time call. However the returned value is
> > July
> > >29, 2019 (have a time from yesterday). I know there is a macro to do it,
> > >but I want to keep the correct epoch time.
> > >
> > I'm mystified (unless it's a coding error) by the 6-month error.  Show
> > your code.
> >
> > -- gil
> >
> > --
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> -

Re: STCK and epoch time

2021-01-12 Thread Seymour J Metz
Nit: the code would be more readable with s hexadecimal constant for TOD.

70 * 3600 * 24 * 365 doesn't account for leap years.




--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Itschak Mugzach [0305158ad67d-dmarc-requ...@listserv.ua.edu]
Sent: Tuesday, January 12, 2021 1:00 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: STCK and epoch time

This is the STCK value: D91B6D3EF6430440 (I have it in hex in variable TOD)
Converted to decimal  : 15644217847788536896
Actual dat eof run is : Yesterday
the code:
/* rexx */
NUMERIC DIGITS 20
RC = SYSCALLS('ON')
ADDRESS SYSCALL  'TIME'
Say 'Current date is' retval

TOD = 'R _ 6   '
Say 'STCK HEX VALUE ' c2x(tod)
tod=C2D(tod)
Say 'STCK DEC VALUE ' tod
tod=Trunc(tod/4096)
microsec=tod//100
seconds=Trunc(tod/100)
Say 'Seocnds =' Seconds
xxx = 70 * 3600 * 24 * 365
Say 'diff=' xxx
Say Seconds - xxx
SAY '2ND DIF = ' SECONDS - XXX - RETVAL



*| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
and IBM I **|  *

*|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
*Skype**: ItschakMugzach **|* *Web**: 
http://secure-web.cisco.com/1ZnbiZNcLTWRGelbKd-Vmb2tmDrGsG6dZmkbDcfS4vllmm7mdtkgPkvyxkyUk_KEBvVwY3mkFdR7J7V52GZIcpGGoVUw2SP2PG_0G80wSwli94THWvq8n1F2vTzNvrbbUghDEkPwbD34bST_Rh0Uhrp3obW9kRDaUkTJS4x3qYVt9DhrFTA_E-v7yhxc_Ahp0Fnk2GgfOFTmjrPaN4dqu-UZQdMncGRqRp4fcHAaeH-9UbAUnjQdx0Lpo2frp1MqxLYs58Qj2KcpQIj7SBqC_wp6Ww-J-8SWEvWs56Hmh2VV0boArCa681GHzEyTtoZh0zM_O8BJIXzOumqIAzYbCW2nW-7uc8CjomZHeyRsiKZ8OR6wltyxtUiwnpDPUiNRt59m8SE4Qyvst9SHZfTIGcF1GFjL0ehOTdO_JiISK0VFa6jVUbMNRZlintxoAqiLt/http%3A%2F%2Fwww.Securiteam.co.il
  **|*





On Tue, Jan 12, 2021 at 7:30 PM Seymour J Metz  wrote:

> 409600 will give you units of 10 ms. Is that really what you want?
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
> 
> From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf
> of Itschak Mugzach [0305158ad67d-dmarc-requ...@listserv.ua.edu]
> Sent: Tuesday, January 12, 2021 12:19 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: STCK and epoch time
>
> Paul,
>
> So if I ignore leap seconds, Can I just divide the number by 409600 and
> subtruct 1.1.1970-1.1.1900?
>
> *| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
> Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
> and IBM I **|  *
>
> *|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
> *Skype**: ItschakMugzach **|* *Web**:
> http://secure-web.cisco.com/1L852dJoPXmqKt9ESjpybzsrC6kwCrmelHuY9TPZ6FI1UhWGxaTPRmDMPbv2-J-TuNYR19i6Etk0RoqzBfZLQdQtLviWwwBp8h9N4dDQB8A3EYjz9KKOqUnYbzA7gaNnoYO2QfsLXZEtnUlTJRXD0XDjWu63swogFiPD2kMAZ3JuBQaB5QMgq6ez7eOinZRRxlKKgcL_TnDcJbNi4LeM2hMtheU40OhWYMuPWP1WVeMCRcujHG9YP8bNig6miEen_MPWOkmLAWIUE_y1DiNulpfiKwSNgfGdpd4e1JXrM8nF-uSVh4vBU9A6-GSINEcDfR1D_BjfuPVtcl86DWYoDhc5NnvCbr2SlwtU_sZGrTobUpcBKotsb_8is79X7TY6ISxy2KRLlqDdGOkhH0qHDMlQjNd0ViYcltcvCTHTEJWaRSHpwx1hRx5cjiLjiqAHA/http%3A%2F%2Fwww.Securiteam.co.il
> **|*
>
>
>
>
>
> On Tue, Jan 12, 2021 at 7:09 PM Paul Gilmartin <
> 000433f07816-dmarc-requ...@listserv.ua.edu> wrote:
>
> > On Tue, 12 Jan 2021 16:30:52 +, Seymour J Metz wrote:
> >
> > >The TOD clock is just a counter; what you get out of it depends on what
> > you put into it. There is a convention in PoOps, but if you want the
> > correct time and date it is much easier to use system services than to do
> > the adjustments yourself.
> > >
> > >MVS does not use the same epoch as Eunix. Unix System Services will
> > adjust the epoch properly.
> > >
> > UNIX counts seconds, excluding leap seconds, starting 1970-01-01t00:00:00
> > MVS  counts microseconds/4096, including leap seconds, starting
> > 1900-01-01t00:00:10.
> >
> > >
> > >From: ITschak Mugzach
> > >Sent: Tuesday, January 12, 2021 10:36 AM
> > >
> > >How exactly STCK (not STCKE) stores the time? I took the value (8 bytes)
> > >and converted it to decimal 10 characters. I expect it to be the same as
> > >the EPOCH time returned by USS time call. However the returned value is
> > July
> > >29, 2019 (have a time from yesterday). I know there is a macro to do it,
> > >but I want to keep the correct epoch time.
> > >
> > I'm mystified (unless it's a coding error) by the 6-month error.  Show
> > your code.
> >
> > -- gil
> >
> >

Re: STCK and epoch time

2021-01-12 Thread Paul Gilmartin
On Tue, 12 Jan 2021 19:19:01 +0200, Itschak Mugzach wrote:
>
>So if I ignore leap seconds, Can I just divide the number by 409600 and
>subtruct 1.1.1970-1.1.1900?
> 
Here's some code I wrote.  The input data are the list of leap seconds
in PoOp.

Restriction:  Presumes a system such as Linux providing the "right"
hierarchy in /usr/share/zoneinfo.

-- gil


--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
/*bin/true;exec rexx "$0" "$@";exit # REXX  Magic!
   Doc: Verify the leap second list in Principles of Operation.
*/

ABCD = ,
7D91 048B CA00  ,  /* Circa Jan 1970 -- Must be first!  */
,  /* From PrincOps:   */ 
8000    ,  /* May 1971 -- TOD Rollover.   */
8126 D60E 4600  ,  /* Dec 1971 -- UTC begins. */
820B A981 1E24  ,  /* Jun 1972 -- first leap second.  */
82F3 00AE E248  84BD E971 146C  8688 D233 4690  8853 BAF5 78B4  
8A1F E595 20D8  8BEA CE57 52FC  8DB5 B719 8520  8F80 9FDB B744  
9230 5C0F CD68  93FB 44D1 FF8C  95C6 2D94 31B0  995D 40F5 17D4  
9DDA 69A5 57F8  A171 7D06 3E1C  A33C 65C8 7040  ,
A5EC 21FC 8664  A7B7 0ABE B888  A981 F380 EAAC  AC34 336F ECD0  
AEE3 EFA4 02F4  B196 2F93 0518  BE25 1097 973C  C387 0CB9 BB60  
C9CC 9A70 4D84  CF2D 54B4 FBA8  ,
D1E0 D681 73CC , /* 2016-12-31 23:59:60  */
d7c7 8993 9481 99a3, /* EBCDIC "PGilmart"*/
D7D9 E4C9 E3C5 D940, /* EBCDIC "PRUITER" */
F7A3 048A D5DC   /* The End of Time! */

signal on novalue
numeric digits 25
say ABCD
say
parse value ABCD with A B C D .
call Adjust
TOD1970 =  TOD
say '/*' TOD TOD1970 '*/'
say d2x( ( x2d( '7FFF' ) + TOD1970 + 1 ) * 4096 * 100 )
say d2x( ( 1483228827+ TOD1970 ) * 4096 * 100 )
say

RC = W( '#include ', 1 )  /* Start at line 1  */
RC = W( '#include ' )
RC = W( '#include ' )
RC = W( 'static const time_t leaps[] = {' )

do Lctr = 0 while ABCD<>''
parse value ABCD with A B C D ABCD
call Adjust
RC = W( '/* TOD:' A B C D ,
'UNIX: */' right( TOD - TOD1970, 10 )copies( ',', ABCD>>'' ),
'/*' Frac '*/' );  end Lctr
RC = W( '};' )
RC = W( '' )

RC = W( 'int ShowIt( const time_t *pT ) {' )
RC = W( 'char s[100];' )
RC = W( '' )
RC = W( 'strftime( s, 99, "%c", localtime( pT ) );' )
RC = W( 'printf( "Time =%11ld  for: %s\n", (long)*pT, s );' )
RC = W( 'return 0; }' )

RC = W( '' )
RC = W( 'int main( void ) {' )
RC = W( 'const time_t *I;' )
RC = W( '  time_t TT;' )
RC = W( '' )

RC = W( 'system( "uname -a" );' )
RC = W( 'putenv( "TZ=right/Universal" );')
RC = W( 'putenv( "TZ=right/America/Denver" );')
RC = W( 'putenv( "TZ=right/America/Los_Angeles" );')
RC = W( 'printf( "For Timezone: %s\n", getenv( "TZ" ) );' )
RC = W( 'tzset(); for ( I = leaps; I

Re: STCK and epoch time

2021-01-12 Thread Itschak Mugzach
This is the STCK value: D91B6D3EF6430440 (I have it in hex in variable TOD)
Converted to decimal  : 15644217847788536896
Actual dat eof run is : Yesterday
the code:
/* rexx */
NUMERIC DIGITS 20
RC = SYSCALLS('ON')
ADDRESS SYSCALL  'TIME'
Say 'Current date is' retval

TOD = 'R _ 6   '
Say 'STCK HEX VALUE ' c2x(tod)
tod=C2D(tod)
Say 'STCK DEC VALUE ' tod
tod=Trunc(tod/4096)
microsec=tod//100
seconds=Trunc(tod/100)
Say 'Seocnds =' Seconds
xxx = 70 * 3600 * 24 * 365
Say 'diff=' xxx
Say Seconds - xxx
SAY '2ND DIF = ' SECONDS - XXX - RETVAL



*| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
and IBM I **|  *

*|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
*Skype**: ItschakMugzach **|* *Web**: www.Securiteam.co.il  **|*





On Tue, Jan 12, 2021 at 7:30 PM Seymour J Metz  wrote:

> 409600 will give you units of 10 ms. Is that really what you want?
>
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
>
> 
> From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf
> of Itschak Mugzach [0305158ad67d-dmarc-requ...@listserv.ua.edu]
> Sent: Tuesday, January 12, 2021 12:19 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: STCK and epoch time
>
> Paul,
>
> So if I ignore leap seconds, Can I just divide the number by 409600 and
> subtruct 1.1.1970-1.1.1900?
>
> *| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
> Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
> and IBM I **|  *
>
> *|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
> *Skype**: ItschakMugzach **|* *Web**:
> http://secure-web.cisco.com/1L852dJoPXmqKt9ESjpybzsrC6kwCrmelHuY9TPZ6FI1UhWGxaTPRmDMPbv2-J-TuNYR19i6Etk0RoqzBfZLQdQtLviWwwBp8h9N4dDQB8A3EYjz9KKOqUnYbzA7gaNnoYO2QfsLXZEtnUlTJRXD0XDjWu63swogFiPD2kMAZ3JuBQaB5QMgq6ez7eOinZRRxlKKgcL_TnDcJbNi4LeM2hMtheU40OhWYMuPWP1WVeMCRcujHG9YP8bNig6miEen_MPWOkmLAWIUE_y1DiNulpfiKwSNgfGdpd4e1JXrM8nF-uSVh4vBU9A6-GSINEcDfR1D_BjfuPVtcl86DWYoDhc5NnvCbr2SlwtU_sZGrTobUpcBKotsb_8is79X7TY6ISxy2KRLlqDdGOkhH0qHDMlQjNd0ViYcltcvCTHTEJWaRSHpwx1hRx5cjiLjiqAHA/http%3A%2F%2Fwww.Securiteam.co.il
> **|*
>
>
>
>
>
> On Tue, Jan 12, 2021 at 7:09 PM Paul Gilmartin <
> 000433f07816-dmarc-requ...@listserv.ua.edu> wrote:
>
> > On Tue, 12 Jan 2021 16:30:52 +, Seymour J Metz wrote:
> >
> > >The TOD clock is just a counter; what you get out of it depends on what
> > you put into it. There is a convention in PoOps, but if you want the
> > correct time and date it is much easier to use system services than to do
> > the adjustments yourself.
> > >
> > >MVS does not use the same epoch as Eunix. Unix System Services will
> > adjust the epoch properly.
> > >
> > UNIX counts seconds, excluding leap seconds, starting 1970-01-01t00:00:00
> > MVS  counts microseconds/4096, including leap seconds, starting
> > 1900-01-01t00:00:10.
> >
> > >
> > >From: ITschak Mugzach
> > >Sent: Tuesday, January 12, 2021 10:36 AM
> > >
> > >How exactly STCK (not STCKE) stores the time? I took the value (8 bytes)
> > >and converted it to decimal 10 characters. I expect it to be the same as
> > >the EPOCH time returned by USS time call. However the returned value is
> > July
> > >29, 2019 (have a time from yesterday). I know there is a macro to do it,
> > >but I want to keep the correct epoch time.
> > >
> > I'm mystified (unless it's a coding error) by the 6-month error.  Show
> > your code.
> >
> > -- gil
> >
> > --
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread Seymour J Metz
409600 will give you units of 10 ms. Is that really what you want?


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Itschak Mugzach [0305158ad67d-dmarc-requ...@listserv.ua.edu]
Sent: Tuesday, January 12, 2021 12:19 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: STCK and epoch time

Paul,

So if I ignore leap seconds, Can I just divide the number by 409600 and
subtruct 1.1.1970-1.1.1900?

*| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
and IBM I **|  *

*|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
*Skype**: ItschakMugzach **|* *Web**: 
http://secure-web.cisco.com/1L852dJoPXmqKt9ESjpybzsrC6kwCrmelHuY9TPZ6FI1UhWGxaTPRmDMPbv2-J-TuNYR19i6Etk0RoqzBfZLQdQtLviWwwBp8h9N4dDQB8A3EYjz9KKOqUnYbzA7gaNnoYO2QfsLXZEtnUlTJRXD0XDjWu63swogFiPD2kMAZ3JuBQaB5QMgq6ez7eOinZRRxlKKgcL_TnDcJbNi4LeM2hMtheU40OhWYMuPWP1WVeMCRcujHG9YP8bNig6miEen_MPWOkmLAWIUE_y1DiNulpfiKwSNgfGdpd4e1JXrM8nF-uSVh4vBU9A6-GSINEcDfR1D_BjfuPVtcl86DWYoDhc5NnvCbr2SlwtU_sZGrTobUpcBKotsb_8is79X7TY6ISxy2KRLlqDdGOkhH0qHDMlQjNd0ViYcltcvCTHTEJWaRSHpwx1hRx5cjiLjiqAHA/http%3A%2F%2Fwww.Securiteam.co.il
  **|*





On Tue, Jan 12, 2021 at 7:09 PM Paul Gilmartin <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Tue, 12 Jan 2021 16:30:52 +, Seymour J Metz wrote:
>
> >The TOD clock is just a counter; what you get out of it depends on what
> you put into it. There is a convention in PoOps, but if you want the
> correct time and date it is much easier to use system services than to do
> the adjustments yourself.
> >
> >MVS does not use the same epoch as Eunix. Unix System Services will
> adjust the epoch properly.
> >
> UNIX counts seconds, excluding leap seconds, starting 1970-01-01t00:00:00
> MVS  counts microseconds/4096, including leap seconds, starting
> 1900-01-01t00:00:10.
>
> >
> >From: ITschak Mugzach
> >Sent: Tuesday, January 12, 2021 10:36 AM
> >
> >How exactly STCK (not STCKE) stores the time? I took the value (8 bytes)
> >and converted it to decimal 10 characters. I expect it to be the same as
> >the EPOCH time returned by USS time call. However the returned value is
> July
> >29, 2019 (have a time from yesterday). I know there is a macro to do it,
> >but I want to keep the correct epoch time.
> >
> I'm mystified (unless it's a coding error) by the 6-month error.  Show
> your code.
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread Paul Gilmartin
On Tue, 12 Jan 2021 19:19:01 +0200, Itschak Mugzach wrote:
>
>So if I ignore leap seconds, Can I just divide the number by 409600 and
>
409600?

>subtruct 1.1.1970-1.1.1900?
>
Are you doing it the hard way?  Borrowing from seconds to minutes,
minutes to hours, hours to days, days to months (which aren't of
uniform lengths), months to years (which aren't of uniform lengths
in some calendars) ...?

Show sample data and your code.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread Itschak Mugzach
True, but the difference may be within 24 hours. I get 21 days late

*| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
and IBM I **|  *

*|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
*Skype**: ItschakMugzach **|* *Web**: www.Securiteam.co.il  **|*





On Tue, Jan 12, 2021 at 7:23 PM Charles Mills  wrote:

> As @Shmuel says, it depends on how the clock is set.
>
> Charles
>
>
> -Original Message-
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
> Behalf Of Itschak Mugzach
> Sent: Tuesday, January 12, 2021 9:19 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: STCK and epoch time
>
> Paul,
>
> So if I ignore leap seconds, Can I just divide the number by 409600 and
> subtruct 1.1.1970-1.1.1900?
>
> *| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
> Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
> and IBM I **|  *
>
> *|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
> *Skype**: ItschakMugzach **|* *Web**: www.Securiteam.co.il  **|*
>
>
>
>
>
> On Tue, Jan 12, 2021 at 7:09 PM Paul Gilmartin <
> 000433f07816-dmarc-requ...@listserv.ua.edu> wrote:
>
> > On Tue, 12 Jan 2021 16:30:52 +, Seymour J Metz wrote:
> >
> > >The TOD clock is just a counter; what you get out of it depends on what
> > you put into it. There is a convention in PoOps, but if you want the
> > correct time and date it is much easier to use system services than to do
> > the adjustments yourself.
> > >
> > >MVS does not use the same epoch as Eunix. Unix System Services will
> > adjust the epoch properly.
> > >
> > UNIX counts seconds, excluding leap seconds, starting 1970-01-01t00:00:00
> > MVS  counts microseconds/4096, including leap seconds, starting
> > 1900-01-01t00:00:10.
> >
> > >
> > >From: ITschak Mugzach
> > >Sent: Tuesday, January 12, 2021 10:36 AM
> > >
> > >How exactly STCK (not STCKE) stores the time? I took the value (8 bytes)
> > >and converted it to decimal 10 characters. I expect it to be the same as
> > >the EPOCH time returned by USS time call. However the returned value is
> > July
> > >29, 2019 (have a time from yesterday). I know there is a macro to do it,
> > >but I want to keep the correct epoch time.
> > >
> > I'm mystified (unless it's a coding error) by the 6-month error.  Show
> > your code.
> >
> > -- gil
> >
> > --
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread Charles Mills
As @Shmuel says, it depends on how the clock is set. 

Charles


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Itschak Mugzach
Sent: Tuesday, January 12, 2021 9:19 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: STCK and epoch time

Paul,

So if I ignore leap seconds, Can I just divide the number by 409600 and
subtruct 1.1.1970-1.1.1900?

*| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
and IBM I **|  *

*|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
*Skype**: ItschakMugzach **|* *Web**: www.Securiteam.co.il  **|*





On Tue, Jan 12, 2021 at 7:09 PM Paul Gilmartin <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Tue, 12 Jan 2021 16:30:52 +, Seymour J Metz wrote:
>
> >The TOD clock is just a counter; what you get out of it depends on what
> you put into it. There is a convention in PoOps, but if you want the
> correct time and date it is much easier to use system services than to do
> the adjustments yourself.
> >
> >MVS does not use the same epoch as Eunix. Unix System Services will
> adjust the epoch properly.
> >
> UNIX counts seconds, excluding leap seconds, starting 1970-01-01t00:00:00
> MVS  counts microseconds/4096, including leap seconds, starting
> 1900-01-01t00:00:10.
>
> >
> >From: ITschak Mugzach
> >Sent: Tuesday, January 12, 2021 10:36 AM
> >
> >How exactly STCK (not STCKE) stores the time? I took the value (8 bytes)
> >and converted it to decimal 10 characters. I expect it to be the same as
> >the EPOCH time returned by USS time call. However the returned value is
> July
> >29, 2019 (have a time from yesterday). I know there is a macro to do it,
> >but I want to keep the correct epoch time.
> >
> I'm mystified (unless it's a coding error) by the 6-month error.  Show
> your code.
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread Itschak Mugzach
Paul,

So if I ignore leap seconds, Can I just divide the number by 409600 and
subtruct 1.1.1970-1.1.1900?

*| **Itschak Mugzach | Director | SecuriTeam Software **|** IronSphere
Platform* *|* *Information Security Continuous Monitoring for Z/OS, zLinux
and IBM I **|  *

*|* *Email**: i_mugz...@securiteam.co.il **|* *Mob**: +972 522 986404 **|*
*Skype**: ItschakMugzach **|* *Web**: www.Securiteam.co.il  **|*





On Tue, Jan 12, 2021 at 7:09 PM Paul Gilmartin <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Tue, 12 Jan 2021 16:30:52 +, Seymour J Metz wrote:
>
> >The TOD clock is just a counter; what you get out of it depends on what
> you put into it. There is a convention in PoOps, but if you want the
> correct time and date it is much easier to use system services than to do
> the adjustments yourself.
> >
> >MVS does not use the same epoch as Eunix. Unix System Services will
> adjust the epoch properly.
> >
> UNIX counts seconds, excluding leap seconds, starting 1970-01-01t00:00:00
> MVS  counts microseconds/4096, including leap seconds, starting
> 1900-01-01t00:00:10.
>
> >
> >From: ITschak Mugzach
> >Sent: Tuesday, January 12, 2021 10:36 AM
> >
> >How exactly STCK (not STCKE) stores the time? I took the value (8 bytes)
> >and converted it to decimal 10 characters. I expect it to be the same as
> >the EPOCH time returned by USS time call. However the returned value is
> July
> >29, 2019 (have a time from yesterday). I know there is a macro to do it,
> >but I want to keep the correct epoch time.
> >
> I'm mystified (unless it's a coding error) by the 6-month error.  Show
> your code.
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread Paul Gilmartin
On Tue, 12 Jan 2021 16:30:52 +, Seymour J Metz wrote:

>The TOD clock is just a counter; what you get out of it depends on what you 
>put into it. There is a convention in PoOps, but if you want the correct time 
>and date it is much easier to use system services than to do the adjustments 
>yourself.
>
>MVS does not use the same epoch as Eunix. Unix System Services will adjust the 
>epoch properly.
> 
UNIX counts seconds, excluding leap seconds, starting 1970-01-01t00:00:00
MVS  counts microseconds/4096, including leap seconds, starting 
1900-01-01t00:00:10.

>
>From: ITschak Mugzach
>Sent: Tuesday, January 12, 2021 10:36 AM
>
>How exactly STCK (not STCKE) stores the time? I took the value (8 bytes)
>and converted it to decimal 10 characters. I expect it to be the same as
>the EPOCH time returned by USS time call. However the returned value is July
>29, 2019 (have a time from yesterday). I know there is a macro to do it,
>but I want to keep the correct epoch time.
>
I'm mystified (unless it's a coding error) by the 6-month error.  Show your 
code.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread Seymour J Metz
The TOD clock is just a counter; what you get out of it depends on what you put 
into it. There is a convention in PoOps, but if you want the correct time and 
date it is much easier to use system services than to do the adjustments 
yourself.

MVS does not use the same epoch as Eunix. Unix System Services will adjust the 
epoch properly.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
ITschak Mugzach [imugz...@gmail.com]
Sent: Tuesday, January 12, 2021 10:36 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: STCK and epoch time

How exactly STCK (not STCKE) stores the time? I took the value (8 bytes)
and converted it to decimal 10 characters. I expect it to be the same as
the EPOCH time returned by USS time call. However the returned value is July
29, 2019 (have a time from yesterday). I know there is a macro to do it,
but I want to keep the correct epoch time.

ITschak Mugzach
*|** IronSphere Platform* *|* *Information Security Continuous Monitoring
for z/OS, x/Linux & IBM I **| z/VM coming soon  *

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: STCK and epoch time

2021-01-12 Thread Mike Schwab
https://www.mail-archive.com/search?l=ibm-main@listserv.ua.edu=subject:%22Re%5C%3A+Converting+STCK%5C%28tod%5C%29+to+readable+format%22=newest=1

On Tue, Jan 12, 2021 at 9:37 AM ITschak Mugzach  wrote:
>
> How exactly STCK (not STCKE) stores the time? I took the value (8 bytes)
> and converted it to decimal 10 characters. I expect it to be the same as
> the EPOCH time returned by USS time call. However the returned value is July
> 29, 2019 (have a time from yesterday). I know there is a macro to do it,
> but I want to keep the correct epoch time.
>
> ITschak Mugzach
> *|** IronSphere Platform* *|* *Information Security Continuous Monitoring
> for z/OS, x/Linux & IBM I **| z/VM coming soon  *
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN



-- 
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN