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     Test if the actual date is a business day

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Test if the actual date is a business day
 Login/Join
 
Virtuoso
posted
I need to test in DM if the actual date is a business day.

-SET &INPDATE='20080126';
-SET &LBD=DATECVT((DATEMOV((DATECVT(&INPDATE.EVAL,'I8YYMD','YYMD')),'PBD')),'YYMD','I8YYMD');
-SET &NBD=DATECVT((DATEMOV((DATECVT(&LBD.EVAL,'I8YYMD','YYMD')),'NBD')),'YYMD','I8YYMD');
-IF &NBD EQ &INPDATE THEN GOTO ITISBUSINESS;
-GOTO NOBUSINESS
....


But this looks a bit complex, can it be easier?




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

If you simply need to know what day of the week today is, try using the system date variable &DATEW. It will give you a number, 1=Monday, 2=Tuesday, etc. If you need to know the business day based on the holiday file, then I image using functions is the way to go.


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
Expert
posted Hide Post
&DATEwr gives you 'Thursday'.
&DATEWR gives you 'THURSDAY'.


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
Virtuoso
posted Hide Post
Francis

What I need this for is a report that should be send by ReportCaster only on the First Business Day of the actual month.


I have put this piece of script in the report.
I scheduled the report for a sequence of 5 days to be sure it is created on the first business day.

If the scheduler start on the 2 of the month the program also tests if the previous BD is in the same month and then you may assume the report was already created.




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
Try this:
-SET &INPDATE='20080126';
-SET &LBD=DATECVT(DATEADD(DATECVT(&INPDATE.EVAL,'I8YYMD','YYMD'),BD',0),'YYMD','I8YYMD');
-TYPE &INPDATE &LBD

If the dates are equal the &INPDATE is a business day.

I had another thread discussing the DATEADD function. I finally found in the documentation (reading very carefully), where it states that when using the week day or business day options if the input date is not a week day or business day, the input date is adjusted to the next week day or business day before adding or subtracting. It also takes into account the holiday file if you are using one.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Master
posted Hide Post
If you aren't using the Holiday file, I would recommend you try that. Another alternative is to build a calendar file with the first workday of the month in it, but that requires more manual intervention.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
JG

I will try that next BD it is one line less so it should be faster....

Thanks for the remark




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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Test if the actual date is a business day

Copyright © 1996-2020 Information Builders