View previous topic :: View next topic
|
Author |
Message |
rambabu Currently Banned New User
Joined: 18 Apr 2005 Posts: 67
|
|
|
|
how can i get the current time stamp from db2 and cobol?
what is rtt? |
|
Back to top |
|
|
kvivek
New User
Joined: 09 May 2005 Posts: 51 Location: Singapore
|
|
|
|
Hi Ram,
DB2
SELECT CURRENT_TIMESTAMP FROM SYSIBM.SYSDUMMY1
COBOL
01 WS-COBOL-TS PIC X(21)
01 WS-TIME-STAMP PIC X(26) VALUE VALUE '0001-01-01-01.01.01.000001'
MOVE FUNCTION CURRENT-DATE TO WS-COBOL-TS
MOVE WS-COBOL-TS(1:4) TO WS-TIME-STAMP(1:4)
MOVE WS-COBOL-TS(5:2) TO WS-TIME-STAMP(6:2)
MOVE WS-COBOL-TS(7:2) TO WS-TIME-STAMP(9:2)
MOVE WS-COBOL-TS(9:2) TO WS-TIME-STAMP(12:2)
MOVE WS-COBOL-TS(11:2) TO WS-TIME-STAMP(15:2)
MOVE WS-COBOL-TS(13:2) TO WS-TIME-STAMP(18:2)
Using the above command we will not be getting the ms part.
Experts please reply whether it's possible to get ms part by any other way?
Regards,
Vivek |
|
Back to top |
|
|
rambabu Currently Banned New User
Joined: 18 Apr 2005 Posts: 67
|
|
|
|
thankx |
|
Back to top |
|
|
Prakash_mainframes
New User
Joined: 26 Feb 2005 Posts: 5 Location: Pune
|
|
|
|
Hello,
I want to get the current timestamp with the nanoseconds also in my cobol program.. Can you tell me how to perform the same ?
Expecting your reply soon.
Cheers
Prakash |
|
Back to top |
|
|
|