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     how to add minutes to start time to get end time?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
how to add minutes to start time to get end time?
 Login/Join
 
Member
posted
I have 3 fields in my input file: srat date, start time, duration (07/01/08, 23:06, 02:08). How do I calculate the 3rd field like edning time: (07/02/08 01:14)?
 
Posts: 8 | Registered: June 03, 2008Report This Post
Virtuoso
posted Hide Post
Do a search on the Forum for HADD.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Expert
posted Hide Post
Convert your input fields to Date-Time and then use Standard Date-Time functions:

-*-- Create the master for TEST -------------------------
APP FI DATAMAST DISK TEST.MAS
-RUN

-WRITE DATAMAST FILE=TEST, SUFFIX=FIX, $
-WRITE DATAMAST SEGNAME=SEG1, SEGTYPE=S0, $
-WRITE DATAMAST   FIELD=START_DT, ALIAS=E01, USAGE=A08, ACTUAL=A08, $
-WRITE DATAMAST   FIELD=FILL1   , ALIAS=E02, USAGE=A01, ACTUAL=A01, $
-WRITE DATAMAST   FIELD=START_TM, ALIAS=E03, USAGE=A05, ACTUAL=A05, $
-WRITE DATAMAST   FIELD=FILL2   , ALIAS=E04, USAGE=A01, ACTUAL=A01, $
-WRITE DATAMAST   FIELD=DURATION, ALIAS=E03, USAGE=A05, ACTUAL=A05, $

-*-- Create the data file for TEST ----------------------
FILEDEF TEST DISK TEST.FTM
-RUN

-WRITE TEST 07/01/08 23:06 02:08

SET DEFCENT = 20
-RUN

DEFINE FILE TEST
START_DT1/A6MDY = EDIT(START_DT,'99$99$99');
START_DT2/MDYY = START_DT1;
START_DT3/A8YYMD = START_DT2;
START_DTTMX/A25 = START_DT3 | ' ' | START_TM | ':00.000';
START_DTTM/HYYMDS = HINPUT(25, START_DTTMX, 8, 'HYYMDS');
DURATION_HH/A2 = EDIT(DURATION,'99$$$');
DURATION_MI/A2 = EDIT(DURATION,'$$$99');
DURATION_MINS/D6 = (EDIT(DURATION_HH) * 60) + EDIT(DURATION_MI);
END_DTTM/HYYMDS = HADD(START_DTTM, 'MINUTE', DURATION_MINS, 8, 'HYYMDS');
END

TABLE FILE TEST
PRINT
START_DT
START_TM
START_DTTM
-*START_DT1
-*START_DT2
-*START_DT3
-*START_DTTMX
DURATION
-*DURATION_HH
-*DURATION_MI
DURATION_MINS
END_DTTM
END
-RUN


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
Member
posted Hide Post
quote:
-*-- Create the master for TEST -------------------------
APP FI DATAMAST DISK TEST.MAS
-RUN

-WRITE DATAMAST FILE=TEST, SUFFIX=FIX, $
-WRITE DATAMAST SEGNAME=SEG1, SEGTYPE=S0, $
-WRITE DATAMAST FIELD=START_DT, ALIAS=E01, USAGE=A08, ACTUAL=A08, $
-WRITE DATAMAST FIELD=FILL1 , ALIAS=E02, USAGE=A01, ACTUAL=A01, $
-WRITE DATAMAST FIELD=START_TM, ALIAS=E03, USAGE=A05, ACTUAL=A05, $
-WRITE DATAMAST FIELD=FILL2 , ALIAS=E04, USAGE=A01, ACTUAL=A01, $
-WRITE DATAMAST FIELD=DURATION, ALIAS=E03, USAGE=A05, ACTUAL=A05, $

-*-- Create the data file for TEST ----------------------
FILEDEF TEST DISK TEST.FTM
-RUN

-WRITE TEST 07/01/08 23:06 02:08

SET DEFCENT = 20
-RUN

DEFINE FILE TEST
START_DT1/A6MDY = EDIT(START_DT,'99$99$99');
START_DT2/MDYY = START_DT1;
START_DT3/A8YYMD = START_DT2;
START_DTTMX/A25 = START_DT3 | ' ' | START_TM | ':00.000';
START_DTTM/HYYMDS = HINPUT(25, START_DTTMX, 8, 'HYYMDS');
DURATION_HH/A2 = EDIT(DURATION,'99$$$');
DURATION_MI/A2 = EDIT(DURATION,'$$$99');
DURATION_MINS/D6 = (EDIT(DURATION_HH) * 60) + EDIT(DURATION_MI);
END_DTTM/HYYMDS = HADD(START_DTTM, 'MINUTE', DURATION_MINS, 8, 'HYYMDS');
END

TABLE FILE TEST
PRINT
START_DT
START_TM
START_DTTM
-*START_DT1
-*START_DT2
-*START_DT3
-*START_DTTMX
DURATION
-*DURATION_HH
-*DURATION_MI
DURATION_MINS
END_DTTM
END
-RUN
 
Posts: 8 | Registered: June 03, 2008Report This Post
Member
posted Hide Post
Thanks very much!
 
Posts: 8 | Registered: June 03, 2008Report 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     how to add minutes to start time to get end time?

Copyright © 1996-2020 Information Builders