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] Date / Time values as Local or Global variables

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Date / Time values as Local or Global variables
 Login/Join
 
Member
posted
Hello all - I am hoping for help with a coding issue as unfortunately searching through both documentation and Focal Point has not provided quite the answer I am looking for. I have date/time values I would like to use as variables either from inside the fex or as an include. I have reviewed info on -WRITE, -READ, -SET, etc. but it is critical these variables be date/time values... The code below shows the date/times used, following that is the resulting values.

These values need to be used both in multiple "where" statements as well as on the report. Any thoughts? (Thank you!)

SET HOLDLIST=PRINTONLY
SET ASNAMES=ON
-*
DEFINE FILE CAR
CDTETIM/HYYMDm = HGETC(10, 'HYYMDm');
PRE_MONTH/HYYMDm = HADD(CDTETIM, 'MONTH', -1, 10, 'HYYMDm');
TRAN_DATE/YYMD = HDATE(PRE_MONTH, 'YYMD');
DATE_BOM/YYMD = DATEMOV(TRAN_DATE, 'BOM');
DTETIM_BOM/HYYMDm = HDTTM(DATE_BOM, 10, 'HYYMDm');
-*
DATE_EOMA/YYMD = DATEMOV(TRAN_DATE, 'EOM');
DTETIM_EOMB/HYYMDm = HDTTM(DATE_EOMA, 10, 'HYYMDm');
DTETIM_EOMD/HYYMDm = HADD(DTETIM_EOMB, 'DD', 1, 10, 'HYYMDm');
DTETIM_EOM/HYYMDm = HADD(DTETIM_EOMD, 'MC', -1, 10, 'HYYMDm');
RPTMNTH/Mtr = DATE_BOM;
END
TABLE FILE CAR
PRINT
RPTMNTH AS 'REPORT_MONTH'
CDTETIM AS 'REPORT_TIME'
DTETIM_BOM AS 'MNTH_BEGIN'
DTETIM_EOM AS 'MNTH_END'
'CAR.CARREC.MODEL' NOPRINT
WHERE RECORDLIMIT EQ 1
ON TABLE NOTOTAL
END

REPORT_MONTH REPORT_TIME MNTH_BEGIN MNTH_END
November 2013/12/27 16:21:32.055036 2013/11/01 00:00:00.000000 2013/11/30 23:59:59.999999

This message has been edited. Last edited by: <Kathryn Henning>,


Production: WebFocus 8.0.09 Test: WebFocus 8.0.09 Windows, Z-Linux, and ZOS.
all output
Focus - 7.2.7
 
Posts: 12 | Registered: July 21, 2010Report This Post
Virtuoso
posted Hide Post
You could use:
-SET &Current_dt = HCNVRT(HGETC(10,'HYYMDm'),'(HYYMDm)',27,'A27');
-SET &Pre_Month  = HCNVRT(HADD(HGETC(10,'HYYMDm'),'mm',-1,10,'HYYMDm'),'(HMT)',10,'A10');
-SET &Pre_bom_dt = HCNVRT(HDTTM(DATEMOV(HDATE(HADD(HGETC(10,'HYYMDs'),'mm',-1,10,'HYYMDm'),'YYMD'),'BOM'),10,'HYYMDm'),'(HYYMDm)',27,'A27');
-SET &Pre_eom_dt = HCNVRT(HADD(HDTTM(DATEMOV(HDATE(HADD(HGETC(10,'HYYMDs'),'mm',-1,10,'HYYMDm'),'YYMD'),'EOM'),10,HYYMDm),'mc',86399999999,10,'HYYMDm'),'(HYYMDm)',27,'A27');
-TYPE now - &Current_dt
-TYPE previous month - &Pre_Month
-TYPE previous bom - &Pre_bom_dt
-TYPE previous eom - &Pre_eom_dt
in a focexec as a -INCLUDE


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Member
posted Hide Post
Hello Alan,
That worked! Thank you very much!

-TYPE now - 2013/12/29 22:51:28.809706
now - 2013/12/29 22:51:28.809706
-TYPE previous month - November
previous month - November
-TYPE previous bom - 2013/11/01 00:00:00.000000
previous bom - 2013/11/01 00:00:00.000000
-TYPE previous eom - 2013/11/30 23:59:59.999999
previous eom - 2013/11/30 23:59:59.999999


Production: WebFocus 8.0.09 Test: WebFocus 8.0.09 Windows, Z-Linux, and ZOS.
all output
Focus - 7.2.7
 
Posts: 12 | Registered: July 21, 2010Report 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] Date / Time values as Local or Global variables

Copyright © 1996-2020 Information Builders