Have tried searching and for the life of me I can't determine how to get the time at a nano-second level. Need this as we have a servlet which during a single session may be called multiple times within a minute with different inputs. Regular hold files appear to be fine of course, but we have a part of this that has to use -WRITE commands, and that file needs to be unique, to avoid conflicting processes writing to the same file.This message has been edited. Last edited by: Kerry,
WF 7.6.4 Windows XP and UNIX
September 21, 2012, 02:49 PM
Prarie
Acording to this document you can convert with a lengh of 12 and it will include nanoseconds. Don't know if this will work in your case.
I want to do this against current time, so how do I get the current time (including nano-seconds)
WF 7.6.4 Windows XP and UNIX
September 21, 2012, 04:38 PM
Francis Mariani
Unfortunately, though you can get the Date-Time with nano seconds, the nano seconds are zero:
TABLE FILE CAR
PRINT
COUNTRY NOPRINT
COMPUTE CURRDTTM/HYYMDn = HGETC(12, 'HYYMDn');
WHERE RECORDLIMIT EQ 1
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS H001 FORMAT ALPHA
END
-RUN
-READ H001 &CURRDTTM.A23.
-SET &CURRDTTM= EDIT(&CURRDTTM,'9999/99/99 99:99:99.99999999');
-TYPE &CURRDTTM
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 21, 2012, 04:50 PM
Dan Satchell
Based on documentation, this would supposedly return number of nanoseconds:
Thanks for getting me on the right track, and Francis thanks for pointing out that nanos come back as 0. I can use microseconds along with a random number to virtually guarantee that I won't have a repeated "key" during the same timeframe.
Thanks Again for your help
WF 7.6.4 Windows XP and UNIX
September 23, 2012, 10:37 AM
j.gross
DWM:
Last time I experimented, it appeared that WF used current time to the *second* as the random-number-generator seed. If that is so, you'll gain nothing (in terms of uniqueness) from appending a "random" value to the ms-granular time