Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 757
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 Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
This topic is locked: you cannot edit posts or make replies. 00D3003B - time outs in DB2 when invo... chavinash2004 DB2 2 Mon Oct 09, 2017 4:39 pm
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us