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.
I have a field that shows time in seconds. Is there a way to convert this field to hh:mm:ss plus also add a negative sign where needed. Ex -00:02:00 = 2 minutes late on a shift.
Thanks, I tried your ex. but still did not get correct results. For ex., one of the records has -60.00 seconds for the time value. I got 00:00:00 instead of getting -00:01:00.
This works for positive numbers, I'm still trying to work out negative numbers.
DEFINE FILE CAR
NBR_SECONDS/D8 =
IF COUNTRY EQ 'ENGLAND' THEN -60 ELSE
IF COUNTRY EQ 'FRANCE' THEN 456666 ELSE
IF COUNTRY EQ 'ITALY' THEN 127 ELSE
IF COUNTRY EQ 'W GERMANY' THEN 180 ELSE
IF COUNTRY EQ 'JAPAN' THEN -1 ELSE 481;
CURR_DATE/HHIS = HINPUT(14, '&YYMD.000000', 8, 'HYYMDS');
POS_DATE/HHIS = IF NBR_SECONDS GE 0 THEN HADD(CURR_DATE, 'SECOND', NBR_SECONDS, 8, 'HYYMDS') ELSE CURR_DATE;
END
-RUN
TABLE FILE CAR
PRINT
NBR_SECONDS
POS_DATE
BY COUNTRY
END
-RUN
Just for clarification, the only way to display what you want is in string format. There is no concept of negative time (only in the Twilight Zone) so any timestamp format would not work - it can't display -60 seconds. A combination of Prarie's code and Tom's addition for the negative will be what you're looking for. You'll first have to make seconds positive then add the negative after making calculations.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007