IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

TIMESTAMP in ASSEMBLER


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ravi243

New User


Joined: 03 Aug 2011
Posts: 9
Location: Bangalore

PostPosted: Tue May 26, 2015 12:13 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue May 26, 2015 12:55 am
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue May 26, 2015 1:43 am
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue May 26, 2015 4:05 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
No new posts Timestamp difference and its average ... DB2 11
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts Finding Assembler programs PL/I & Assembler 5
Search our Forums:

Back to Top