Thanks Paul Gilmartin, you've reminded me to get GCC try on this museum
piece. And maybe PL/1, for old times :-)

And thanks to all for the advice.

If I read the replies right, z/OS does what I expected--keeps track of how
many leap seconds are included in the TOD clock, so that short intervals
measured across the leap second are right, but it can still be converted
into date&time by subtracting the extra seconds.

But MVS 3.8 (I checked SYS1.AMODGEN(CVT) ) doesn't have any reference to
leap seconds i can see. I suppose it was up to ops to adjust the time, and
TOD intervals would be out by a second across the leap second, but it makes
TOD time a bit easier to convert.

Hercules (as installed with defaults from TK4-) follows the Win64 host
clock trustingly. I IPL'd in 2019, saved my work, wound the clock forward
to the evening of Feb 28th 2020, and all the TSO sessions timed out in the
blink of an eye :-)

Interestingly perhaps, this version of MVS returns the century from TIME
DEC in x'0cyydddF', so I only have to add 1900 for YYYY. But there is no
STCKCONV, and the instruction set of a 3033 is a bit limiting :-)

Roops


On Thu., Nov. 12, 2020, 10:47 Paul Gilmartin, <
[email protected]> wrote:

> On Thu, 12 Nov 2020 16:13:41 +1100, Attila Fogarasi  wrote:
>
> >Hercules emulates the TOD clock, so what you see is Hercules behaviour and
> >not the real hardware behaviour for any particular machine type.
> >
> Yes.  And I suspect H merely naively converts the Linux(?) system clock
> to TOD format (add 1970 years; etc.)
> >
> >On Thu, Nov 12, 2020 at 2:13 PM Rupert Reynolds  wrote:
> >
> >> I did look for IBM docs online, but I haven't found anything very
> helpful.
> >>
> You have probably read "TOD Programmable Register" in recent PoOp.
>
> >> I read of someone using STCK and converting (the hard way!) to display
> >> time, instead of using TIME DEC. So I tried it on my Hercules/MVS 3.8
> >> setup.
> >>
> Officially, z/OS keeps a leap second count in CVTLSO and *subtracts* that
> from TOD to get UTC and adds CVTLDTO to get local time.  What value
> do you see for CVTLSO/4096/1000000?  (Oops!  Does 3.8 have a CVTLSO?)
>
> At an ordinary leap second z/OS adds 1 second to CVTLSO (there has never
> been a negative leap second.)
>     https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat
>     https://www.iana.org/time-zones
>
> During that leap second z/OS makes user processes nondispatchable so
> callers
> of TIME do not see anachronistic results.  No z/OS internals expert has
> ever
> come forth in this forum to explain how TIME accounts for the minuscule
> timing window that CVTLSO/CVTLDTO might be accessed and STCK performed
> on opposite sides of a leap second or DST boundary.
>
> Years ago, our site encountered two software products (both from IBM, IIRC)
> that had different notions of whether to apply CVTLSO, resulting in several
> seconds' inconsistency in SMF data.  We turned off leap seconds; set
> CVTLSO=0 and stayed that way ever after.
>
> I'll attempt to attach a C program that displays TAI rather than UTC.
>
> -- gil
> /* ********************************************************** */
> /* Doc: Display TAI.
>    BUGS: Requires /usr/share/zoneinfo/right.
>          Will never display 23:59:60.  */
>
> #include <stdlib.h>
> #include <langinfo.h>
> #include <stdio.h>
> #include <sys/types.h>
> #include <time.h>
>
> int main( int argc, char **argv ) {
>
> char *format;
> time_t t;
> char str[ 99 ];
> size_t len;
> struct tm timestruc;
>
> /* Use either argument as format or (volatile) environment string.
> */
> format = argv[ 1 ] ? argv[ 1 ]
>                    : nl_langinfo( D_T_FMT );
> /* get system time; convert to (UTC) struct tm.
> */
> t = time( &t );
> putenv( "TZ=Etc/Zulu");  /* Assume this indicates TAI vs. UTC.  */
> tzset();
> gmtime_r( &t, &timestruc );
> len = strftime( str, sizeof( str ) -1, format, &timestruc );
>
> /* Convert struct tm to atomic time.
> */
> putenv( "TZ=right/Etc/Zulu");
> tzset();
> t = mktime( &timestruc );
> t = t + 10;  /* (10-second bias when UTC began in 1972.)  */
>
> /* Convert; format; and display.
> */
> putenv( "TZ=posix/Etc/Zulu");
> tzset();
> gmtime_r( &t, &timestruc );
> len = strftime( str, sizeof( str ) -1, format, &timestruc );
> printf( "%s\n", str );
>
> return( 0 ); }
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to