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] Business days Function - TWO DIFFERENT WORK DAYS IN SAME FEX

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Business days Function - TWO DIFFERENT WORK DAYS IN SAME FEX
 Login/Join
 
Platinum Member
posted
Hi
I have a function that gives me work days when there are 6 work days (m-sat) . Worked fine. But Now I need to add 3 Work days (m-w-f) for of the locations..

I duplicated the function with setting business days different , but it gives me only work days based on 6 days a week. For example, November 2013, it gives 21 days for both functions..

Can anyone see what the problem is here.. I looked at it and can't figure out, why it is taking 6 work days and not 3 Work day week..
here is the code

Thanks
  
-*-******************************************************************************
-*-* Find mon-sat days in a month - (6 days a week)
-*-******************************************************************************
SET BUSDAYS = _MTWTFS;
DEFINE FUNCTION WD_MON6 (year/I4,month/I2)
6this_iyym/I6YYM = (year*100)+month;
6bom_yymd/YYMD = 6this_iyym;
WD_MON6/I2 = DATEDIF(6bom_yymd,DATEMOV(6bom_yymd,'EOM')+1,'BD');
END
-RUN
-*-******************************************************************************
-*-* Find mon-WED-FRI days in a month - (3 days a week)
-*-******************************************************************************
SET BUSDAYS = _M_W_F_;
DEFINE FUNCTION WD_MON3 (year/I4,month/I2)
3this_iyym/I6YYM = (year*100)+month;
3bom_yymd/YYMD = 3this_iyym;
WD_MON3/I2 = DATEDIF(3bom_yymd,DATEMOV(3bom_yymd,'EOM')+1,'BD');
END
-RUN

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


Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 )
SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2
WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
 
Posts: 134 | Location: USA | Registered: August 21, 2008Report This Post
Expert
posted Hide Post
The code you shared with us DEFINES the functions.

You need to set the business days (SET BUSDAYS = _M_W_F_) just before you CALL the function.


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
Platinum Member
posted Hide Post
Thanks Francis
I have the SET BUSDAYS = _M_W_F_ before each function starts.. (see previous code here) then I have my source file Defined
in the Define then I figure out week days based on the location, if the Location has 3 days, use the WD_MON3 function and if the location has 6 days, use the WD_MON6 function
See sample below
  
DEFINE FILE LOCTABLE 
WEEKDAYS1/I2 = IF LOCWD EQ 3 THEN WD_MON3(GLYR1,GL_MTH1) ELSE
               IF LOCWD EQ 6 THEN WD_MON6(GLYR1,GL_MTH1) ELSE 0;
END


Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 )
SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2
WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
 
Posts: 134 | Location: USA | Registered: August 21, 2008Report This Post
Platinum Member
posted Hide Post
I will have to separate my defines, hold and then join to get what I need..

Thanks


Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 )
SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2
WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
 
Posts: 134 | Location: USA | Registered: August 21, 2008Report This Post
Platinum Member
posted Hide Post
Remove the semi-colon at the end of your set -- I didn't test but maybe your BUSDAYS aren't really being set due to the semi-colon.
SET commands don't get semi-colons
-SET commands get semi-colons.


WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
 
Posts: 149 | Location: Dallas, TX | Registered: June 08, 2007Report This Post
Platinum Member
posted Hide Post
Thanks Linus
I had tried that, but as I indicated above, I got it done, keeping it separate

Thanks


Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 )
SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2
WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
 
Posts: 134 | Location: USA | Registered: August 21, 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     [SOLVED] Business days Function - TWO DIFFERENT WORK DAYS IN SAME FEX

Copyright © 1996-2020 Information Builders