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

Get time in microsecond granularity


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

PostPosted: Mon Nov 19, 2007 1:38 pm
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: 771
Location: Germany

PostPosted: Mon Nov 19, 2007 1:51 pm
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: 148
Location: Ottawa Canada

PostPosted: Tue Nov 20, 2007 1:29 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts C Compile time time stamps Java & MQSeries 10
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
Search our Forums:

Back to Top