Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] How to get Time at nanosecond level

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] How to get Time at nanosecond level
 Login/Join
 
Silver Member
posted
All,

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
 
Posts: 41 | Registered: November 26, 2008Report This Post
Virtuoso
posted Hide Post
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.

nano
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Silver Member
posted Hide Post
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
 
Posts: 41 | Registered: November 26, 2008Report This Post
Expert
posted Hide Post
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Based on documentation, this would supposedly return number of nanoseconds:

-SET &CURR_NANOS = HPART(HGETC(17,'H17'),'nanosecond','I9');
-TYPE &CURR_NANOS


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Silver Member
posted Hide Post
Dan,

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
 
Posts: 41 | Registered: November 26, 2008Report This Post
Virtuoso
posted Hide Post
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
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
The other option is to use the TSCom Id.
-SET &Temp = FGETENV(7,'EDATEMP',80,'A80') ;
-SET &Temp = TRUNCATE(&Temp) ;

-SET &TSCom = EDIT(GETTOK(&Temp,&Temp.LENGTH,-1,'\',8,'A8'),'$$999999') ;
-TYPE &TSCom


The delimiter may have to change depending on the OS.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
quote:
-SET &CURR_NANOS = HPART(HGETC(17,'H17'),'nanosecond','I9');
-TYPE &CURR_NANOS


This will not work unfortunately, only accurate to the nearest tenth in reality. The HGETC 'clock' appears to increment in .015/.016 second steps.

The microsecond part is always 232 and the nanosecond part is always 224.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
I think the nanosecond support depends on the OS.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] How to get Time at nanosecond level

Copyright © 1996-2020 Information Builders