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] calculate monthend dates between two selected dates

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] calculate monthend dates between two selected dates
 Login/Join
 
Member
posted
Hi

I would like to know the easy way to calculate month end dates between two calendar dates without using loop.

example : if I select March 1, 2017 and July 4,2017

I need month end dates for March - July 2017.

This message has been edited. Last edited by: FP Mod Chuck,


8.0.2 , Windows
 
Posts: 2 | Registered: May 01, 2018Report This Post
Virtuoso
posted Hide Post
Look up DATEMOV and EOM in the Doc.

https://webfocusinfocenter.inf...g/source/datemov.htm


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
Here's an example that might help ...

-* SET CURRENT DATE
-SET &CUR_YYMD  = &YYMD;
-*-SET &CUR_YYMD  = 20180120;
-*
-* SET MONTH DATES
-SET &BCM_YYMD  = DATECVT(DATEMOV(DATECVT(&CUR_YYMD, 'I8YYMD', 'YYMD'), 'BOM'),'YYMD', 'I8YYMD');
-SET &ECM_YYMD  = DATECVT(DATEMOV(DATECVT(&CUR_YYMD, 'I8YYMD', 'YYMD'), 'EOM'),'YYMD', 'I8YYMD');
-*
-TYPE ------------------------------------------------
-TYPE CURRENT DATE           (CUR_YYMD) ----- &CUR_YYMD
-TYPE ------------------------------------------------
-TYPE BEGIN CURRENT  MONTH   (BCM_YYMD) ----- &BCM_YYMD
-TYPE END   CURRENT  MONTH   (ECM_YYMD) ----- &ECM_YYMD
-TYPE ------------------------------------------------
-*
-* SET OTHER DATE FORMATS
-SET &CUR_DTE1 = EDIT(DATECVT(&CUR_YYMD,'I8YYMD','A8MDYY'),'99/99/9999');
-SET &CUR_DTE2 = DATETRAN(DATECVT(&CUR_YYMD, 'I8YYMD', 'MDYY'), '(MDYY)', '(trD)', 'EN', 20, 'A20') ;
-SET &CUR_MTH1 = DATETRAN(DATECVT(&CUR_YYMD, 'I8YYMD', 'MYY'), '(MYY)', '(tr)', 'EN', 20, 'A20') ;
-*
-TYPE --- OTHER CURRENT DATES
-TYPE ------------------------------------------------
-TYPE CUR_DTE1 ---- &CUR_DTE1
-TYPE CUR_DTE2 ---- &CUR_DTE2
-TYPE -------------
-TYPE CUR_MTH1 ---- &CUR_MTH1
-TYPE ------------------------------------------------


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Platinum Member
posted Hide Post
Try running the following code in your environment. Maybe this is what you are looking for.

-DEFAULT &StartDate = 'March 1, 2017';
-DEFAULT &EndinDate = 'July 4,2017';
 TABLE FILE syscolum
 PRINT NAME NOPRINT
 COMPUTE Inc/I11        = Inc + 1;
 COMPUTE StartYYMD/YYMD = '&StartDate';
 COMPUTE StartYYM/YYM   = StartYYMD;
 COMPUTE MonthYYM/YYM   = StartYYM + Inc - 1;
 COMPUTE MonthYYMD/YYMD = DTADD(StartYYMD, MONTH, Inc - 1);
 COMPUTE MonthEOM/YYMD  = DATEMOV(MonthYYMD, 'EOM');
 COMPUTE Endin/YYMD     = '&EndinDate';
 COMPUTE EndinYYM/YYM   = Endin;
 WHERE TOTAL MonthYYM - EndinYYM LE 0; 
 ON TABLE HOLD AS eom 
 END
 TABLE FILE eom
 SUM MonthEOM AS 'DTE'
 ACROSS Inc
 ON TABLE SET ASNAMES ON
 ON TABLE HOLD AS eomdates 
 END
-RUN
-READFILE eomdates
-? &DTE


WebFOCUS 8.2.06
 
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 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] calculate monthend dates between two selected dates

Copyright © 1996-2020 Information Builders