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] Synonym Time Field from DB2 Numeric Field - Closed but Unsolved

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Closed] Synonym Time Field from DB2 Numeric Field - Closed but Unsolved
 Login/Join
 
Silver Member
posted
I have a iSeries (AS/400) DB2 numeric column/field. I would like to use that as a time field in WebFOCUS. The value might be 142632 which would be 2:26:32PM.

What is the best way to set up the field in the Synonym?

TIA

This message has been edited. Last edited by: bbollmann,


Brian Bollmann
Spartan Light Metal Products
WebFocus 7.6.4 / iSeries / WebSphere
 
Posts: 34 | Registered: May 09, 2008Report This Post
Virtuoso
posted Hide Post
Brian

I would suggest a compute.

It can be done in several ways

Convert to alpha and do an edit on that computed field
alphafield=edit(orgfield)
edit(alphafield,'99:99:99')

To get the exact coding I need some manuals, but this gives the direction.
It also depends on the question if you need to display it only as time or if you also want to do calculations with it.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Silver Member
posted Hide Post
Field USER8H_ITR is A6 and contains '150000'

I've tried to set up an HHIS field with the EDIT function as below.

DEFINE USER8H_ITR_DEF/HHIS WITH RCSTSH=EDIT(USER8H_ITR,'99:99:99');
TITLE='In Time,(Rounded)', DESCRIPTION='In Time - Rounded', $

In the GUI Synonym editor, the Expression turns red, and when I run Check, I get:

No HTML Output!
--------------------------------------------------------------------------------
0 ERROR AT OR NEAR LINE 1 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC36346) INCORRECT USE OF DATE-TIME FIELD OR CONSTANT


Brian Bollmann
Spartan Light Metal Products
WebFocus 7.6.4 / iSeries / WebSphere
 
Posts: 34 | Registered: May 09, 2008Report This Post
Virtuoso
posted Hide Post
Brian

This might work, but only to display it as a time.
It will not be a time field this way.

DEFINE USER8H_ITR_DEF/A8 WITH RCSTSH=EDIT(USER8H_ITR,'99:99:99');
TITLE='In Time,(Rounded)', DESCRIPTION='In Time - Rounded', $


There is a way to do this, but you have to wait till I'm back at the office or till someone else is able to help you.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Silver Member
posted Hide Post
Thanks Frank, I had succeeded at creating such a field before I originally posted. Unfortunately, this is Time and Attendance, so I need to subtract time A from time B.


Brian Bollmann
Spartan Light Metal Products
WebFocus 7.6.4 / iSeries / WebSphere
 
Posts: 34 | Registered: May 09, 2008Report This Post
Virtuoso
posted Hide Post
Brian


This might help a bit.

DEFINE FILE CAR
TIME1/A6 WITH COUNTRY=DECODE COUNTRY('ENGLAND' '163045' 'ITALY' '090522' 'FRANCE' '112500' JAPAN '180000' ELSE '210748');
DISPTIME/A8=EDIT(TIME1,'99:99.99');
AHRS/A2=EDIT(TIME1,'99');
AMIN/A2=EDIT(TIME1,'$$99');
ASEC/A2=EDIT(TIME1,'$$$$99');
TIME1SEC/D10=EDIT(AHRS)*3600+EDIT(AMIN)*60+EDIT(ASEC);
END
TABLE FILE CAR
PRINT TIME1 DISPTIME TIME1SEC
COMPUTE ELAPSEDSEC/D10=IF COUNTRY EQ LAST COUNTRY THEN 0 ELSE TIME1SEC-LAST TIME1SEC;
COMPUTE ELAPSEDHOUR/D7.3=ELAPSEDSEC/3600;
COMPUTE EHOUR/I2=ELAPSEDSEC/3600; NOPRINT
COMPUTE EMIN/I2=(ELAPSEDSEC-EHOUR*3600)/60; NOPRINT
COMPUTE ESEC/I2=(ELAPSEDSEC-EHOUR*3600-EMIN*60); NOPRINT
COMPUTE ETIME/A8=EDIT(EHOUR)|':'|EDIT(EMIN)|'.'|EDIT(ESEC);
BY LOWEST TIME1SEC NOPRINT
BY COUNTRY
END



I first converted the alpha time field to an number of seconds since midnight. If you do that with your time fields you can calculate the number of seconds between the two messure points.
The difference is the time in seconds.
the orher calculated fields are only to display it as a time.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 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] Synonym Time Field from DB2 Numeric Field - Closed but Unsolved

Copyright © 1996-2020 Information Builders