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     [SOLVED] Convert alpha to use HDIFF

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Convert alpha to use HDIFF
 Login/Join
 
Master
posted
I have a 2 time fields
tm_fd1 usage=p7 actual=p4
tm_fd2 usage=p13.4 actual=p7

So far I have converted these fields from Packed format to ALPHA via:
ADT1/A7 = EDIT(ADM_TIME);
ADT2/A8 = EDIT(ADT1,'$99:99:99');
DST1/A13 = EDIT(TIME_OF_DISCHARGE);
DST2/A8 = EDIT(DST1, '$$$$$$$99:99:99');

I have determined that I need to use HDIFF to
get the diff btwn these times in minutes.

Any ideas on how I could reformat these fields to be used in HDIFF?

Thanks! Sweating

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


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
Tom,
USING FUNCTIONS manual
page 246,then 245
you want to change the date to a smartdate first
then from a smartdate use HDTTM to make it a datetime (page 246)
then use your HDIFF function (page 245)
-s




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Master
posted Hide Post
So far, I have created a time/date stamp field
and tried the hdiff on these new flds.

DEFINE FILE T2ENCNTR
EDIT_ADMT_DATE/A11 = EDIT(ADMIT_DATE);
NEW_ADMT_DATE/A8 = EDIT(EDIT_ADMT_DATE,'$99999999');
DATE_ADMT_DATE/A8YYMD = NEW_ADMT_DATE;
ADM_DATE/YYMD = DATE_ADMT_DATE;
-*
ADTIME1/A7 = EDIT(ADMIT_TIME);
ADTIME2/A8 = EDIT(ADTIME1,'$99:99:99');
XADM_TM/A19 = EDIT(NEW_ADMT_DATE,'9999/99/99') |''| ADTIME2;
-**
EDIT_DSCH_DATE/A11 = EDIT(DISCHARGE_DATE);
NEW_DSCH_DATE/A8 = EDIT(EDIT_DSCH_DATE,'$99999999');
DATE_DIS_DATE/A8YYMD = NEW_DSCH_DATE;
DSCH_DATE/YYMD = DATE_DIS_DATE;
-*
DSTIME1/A13 = EDIT(TIME_OF_DISCHARGE);
DSTIME2/A8 = EDIT(DSTIME1, '$$$$$$$99:99:99');
XDSH_TM/A19 = EDIT(NEW_DSCH_DATE,'9999/99/99') |''| DSTIME2;
-*
-* Calculate Time Diff from Admit to Discharge
TIME_MINUTES/I8 = HDIFF(XDSH_TM,XADM_TM,'MINUTE','D12.2');
END


I have received this error:
(FOC36355) INVALID TYPE OF ARGUMENT #2 FOR USER FUNCTION HDIFF
BYPASSING TO END OF COMMAND

Now, I will goto "USING FUNCTIONS" in manual
and get this fixed. Cool

muchos gracias


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Virtuoso
posted Hide Post
quote:
TIME_MINUTES/I8 = HDIFF(XDSH_TM,XADM_TM,'MINUTE','D12.2');


Tom

change the 'D12.2' to 'TIME_MINUTES'


and buy the book "almost 1001" etc it will help you a lot in calculating with dates and times.




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
Master
posted Hide Post
Thanks Frank,

I did as you suggested,
TIME_MINUTES/I8 = HDIFF(XDSH_TM,XADM_TM,'MINUTE','TIME_MINUTES');
and I got this error.

0 ERROR AT OR NEAR LINE 25 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC36355) INVALID TYPE OF ARGUMENT #4 FOR USER FUNCTION HDIFF
BYPASSING TO END OF COMMAND
0 ERROR AT OR NEAR LINE 38 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: TIME_MINUTES
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT

I am thinking maybe I need to change
XDSH_TM and XADM_TMfrom ALPHA to a
different format to make this work.
???


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Master
posted Hide Post
Problem resolved!

YADM_TM/HYYMDS = HINPUT(19,XADM_TM,17,YADM_TM);
YDSH_TM/HYYMDS = HINPUT(19,XDSH_TM,17,YADM_TM);
and finally,

TIME_MINUTES/I8 = HDIFF(YDSH_TM,YADM_TM,'MINUTE','D12.2');

Thanks All! Wink


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 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     [SOLVED] Convert alpha to use HDIFF

Copyright © 1996-2020 Information Builders