View previous topic :: View next topic
|
Author |
Message |
ravi243
New User
Joined: 03 Aug 2011 Posts: 9 Location: Bangalore
|
|
|
|
Hi All,
How to read the current time stamp in assembler in MMDDYYYYHHMN? Can Some one please tell me ? STCK is the intruction wihch can be used?? Thanks |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
You posted your question in the COBOL forum. Are you asking about the 21-character COBOL CURRENT-DATE intrinsic function format? Something in Assembler? Something else you have not explained? You mentioned STCK -- but why not use the TIME macro in Assembler instead?
I think you need to start over and explain what you want to know and what language you are using -- COBOL, Assembler, or whatever. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
The Assembler TIME macro can obtain the data you want, though not in the format you propose. That is an Assembler question, as Mr. Sample clearly states, not a Cobol question.
This, too, is an Assembler issue: the STCK machine instruction will store a 64-bit binary value that represents the current value in the hardware Time of Date clock. The high order 52 bits represent the number of microseconds since January 1, 1900 in UTC time. In systems using an External Time Reference, this value must be adjusted by the number of "leap" seconds and then converted to local time. Even after these adjustments, as you can see, it requires considerable manipulation to get something more useful. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Code: |
TIME DEC,RESULT,ZONE=LT,LINKAGE=SYSTEM,DATETYPE=YYYYMMDD
...
RESULT DC XL16'0' |
produced
17235816 42190000 20150525 00000000
in RESULT when displayed as hexadecimal digits. 20150525 is the date, and
17235816 42190000 is the time of day - 17:23:58.16.
The discussion of the TIME macro in MVS Programming Assembler Services Reference Vol 2 (IARR2V-XCTLX) for your z/OS release will tell you about additional options and more detail about the output. |
|
Back to top |
|
|
|