Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Get time in microsecond granularity

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
tusharguptait

New User


Joined: 15 Feb 2006
Posts: 32

PostPosted: Mon Nov 19, 2007 9:55 am    Post subject: Get time in microsecond granularity
Reply with quote

Hi,
I am writing records to a file with time component being part of key and uniquely identifying records (rest of key being same for multiple records).

Using 'EXEC CICS ASKTIME' , i am able to get time in millisecond granularity.
But due to fast cpu processing, multiple 'CICS ASKTIME' commands are giving same time. This results in 'DUPREC' error when writing to file.

Can I get time in Microsecond granularity in cobol program?

Thanks
TG.
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Mon Nov 19, 2007 1:38 pm    Post subject:
Reply with quote

Tushar,

Go thru manual/qw for more info -
Quote:
ASKTIME

Request current date and time of day.

+------------------------------------------------------------------------+
¦ ¦
¦ ¦
¦ >>--ASKTIME--------------------------------------------------------->< ¦
¦ +-ABSTIME(data-area)-+ ¦
¦ This command is threadsafe. ¦
¦ ¦
+------------------------------------------------------------------------+
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 755
Location: Germany

PostPosted: Mon Nov 19, 2007 1:51 pm    Post subject:
Reply with quote

Hi !

In fact you have DB2, you could use CurentTimestamp.

Regards, Umeysan
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Tue Nov 20, 2007 1:29 am    Post subject:
Reply with quote

Without DB2 here is one way to do it using the asm macro TIME...

* if we needed more resolution than microseconds we could use the
* STCKE instruction. Microseconds are good enough here, so we use
* the TIME macro, since it does some nice formatting for us.
*
TIME DEC,RATICKWA,LINKAGE=SYSTEM,
MF=(E,LIST1MAC),DATETYPE=YYYYMMDD

We have a common subroutine that calls the Assembler.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts CICS transaction slow response time vasanthz All Other Mainframe Topics 3 Thu Jan 19, 2017 1:31 am
No new posts DD DUMMY & CPU TIME Nileshkul Testing & Performance analysis 16 Mon Dec 19, 2016 11:35 pm
This topic is locked: you cannot edit posts or make replies. Get a job submitted itself every time... arunsoods JCL & VSAM 3 Tue Nov 22, 2016 4:05 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us