The STORECLOCK
function returns the current eight (8) byte storeclock (STCK) value in a displayable hexadecimal character format of 16 bytes.
Category
Date / Time
STORECLOCK()
Parameter and Description
This function has no parameters.
Example
Retrieve the current MVS storeclock value and map the hexadecimal character result in target field USER_STCK.
USER_STCK = STORECLOCK()
Given a current date and time of 12/1/2022 09:15:00
USER_STCK = DC7D0F08AED00000
- The MVS Storeclock is used by zOS systems and the tools that run on it like IMS and Db2 to uniquely identify the instant data was changed. More commonly referred to by the assembler instruction STCK that returns its value, it is an 8 byte binary number where bit 51 equal 1 microsecond. The origin (i.e., the meaning of 0) is midnight January 1, 1900. Since it is 8 bytes, it will roll over back to 0 in 2043. zOS ensures that every reference to a STCK will be unique.
- The Connect CDC (SQData) creates STCK like values for its captures on Linux and AIX as well to provide a common set of multi-platform functions including those that convert the STCK to a human readable Date, Time and Timestamp.
Conversion programs
Performing that conversion outside an Apply Engine is a challenge. There are a few hard to find third party tools to help including one from IBM that converts in both directions. Two examples include the Longpela Expertise page at http://www.longpelaexpertise.com.au/toolsTOD.php
The second is a JavaScript tool from IBM available here https://www.ibm.com/support/pages/store-clock-utility. The utility does require downloading a zip file. Once extracted, simply point your browser to the zos-storeclock-calculator.htm
file.
Lastly, a REstructured eXtended eXecutor (REXX) called Time-of-day (TOD) is available on all z/OS systems and part of the IPCS dump analysis component. The conversion program changes a STCK storeclock value to a date and time.
From any ISPF command line, type:
TSO EXEC 'SYS1.SBLSCLI0(TOD)' 'DE5ECFDD84CA2202'
SYS1.SBLSCLI0
in your SYSPROC or SYSEXEC concatenation, you can execute it more simply as:TSO %TOD DE5ECFDD84CA2202