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     Date manipulation (date +3 Business days)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Date manipulation (date +3 Business days)
 Login/Join
 
Silver Member
posted
Hi,

I've been trying to follow the instructions on this site to create a holiday file, but I can't seem to get it to work properly. The main difference is that we have a table that contains the holidays and will get updated as the dates change, so I'm trying to make use of that. Here is my code:

SET PAGE-NUM = OFF
SET BUSDAYS = _MTWTF_
-*
-SET &ECHO=ALL;
ENGINE SQLSYB SET DEFAULT_CONNECTION SYBX
SQL SQLSYB PREPARE SQLHLDYDATES FOR
select hldy_date 'HOLIDAY_DATE'
from reference..holiday
where typ = 'BANK' and grp_name = '#FED'
END
-*
APP FI HDAYSWAP DISK hdayswap.err
-*
TABLE FILE SQLHLDYDATES
PRINT HOLIDAY_DATE AS ''
BY HOLIDAY_DATE NOPRINT
ON TABLE HOLD AS HDAYSWAP FORMAT ALPHA
END
-RUN
-*
SET HDAY = swap
-*
DEFINE FILE CAR
TEMP_DATE/A14 = EDIT('05/22/2008', '$$$$$$9999') || EDIT('05/22/2008', '99') || EDIT('05/22/2008', '$$$99') ||('000000');
DAT2/HYYMDs = HINPUT(14, TEMP_DATE, 8, 'HYYMDs');
DAT3/MDYY = HDATE(DAT2, 'MDYY');
NEW_SETTLE_DATE/MDYY = DATEADD(DAT3, 'BD', 3);
END
TABLE FILE CAR
PRINT CAR NEW_SETTLE_DATE TEMP_DATE DAT2 DAT3
END
-RUN

When I run this I get (FOC1892) FILE NOT FOUND : HDAYswapERRORS *
I also tried
APP FI HDAYSWAP DISK wfs\bin\hdayswap.err
No luck, same error...

Has anyone created a holiday file this was, is it even possible?

Thank you for your help.
Luminita


7.6.6 on AIX platform
Output: variety (Excel, HTML and PDF)
 
Posts: 33 | Location: New Hampshire | Registered: October 17, 2007Report This Post
Virtuoso
posted Hide Post
I know there has been an 8 character limit on hold files..but don't know which release it changed..I'd try changing that.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Silver Member
posted Hide Post
Nope, that didn't help...


7.6.6 on AIX platform
Output: variety (Excel, HTML and PDF)
 
Posts: 33 | Location: New Hampshire | Registered: October 17, 2007Report This Post
Expert
posted Hide Post
The holiday file MUST be located in a specific directory for this to work. This is not documented, but Frank Dutch helped recently:

Holiday File Location

On my server, this worked:

FILEDEF HDAYTEST DISK C:/ibi/srv76/wfs/bin/HDAYTEST.ERR

or

APP FI HDAYSWAP DISK C:/ibi/srv76/wfs/bin/hdayswap.err


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
Silver Member
posted Hide Post
C:/ibi/srv76/wfs/bin/HDAYTEST.ERR doesn't work either. Maybe I should mention I'm running this in MRE, not on my local server.

I'll keep playing with it...
L-


7.6.6 on AIX platform
Output: variety (Excel, HTML and PDF)
 
Posts: 33 | Location: New Hampshire | Registered: October 17, 2007Report This Post
Virtuoso
posted Hide Post
Did you do what Tom suggested above and make sure you really had data in the hold file?


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Virtuoso
posted Hide Post
Luminita,

In your fex you should have, for example:
SET HDAY=YR04

You should also have a SET BUSDAY command. for example, because or work week is from Sunday to Thursday, we use:
SET BUSDAY=SMTWT__

The file name MUST be HDAYYR04.err and it must be in the /ibi/srvnn/wfs/bin directory

In the file the dates must have a yyyymmdd format, with one date per line, followed by at least 1 space after which anything else is a comment, e.g. "New Year"


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Silver Member
posted Hide Post
Hi,

Hope you guys had a good long weekend!

Yes, I have data in the hold file and it looks something like this:
20080101
20080121
20080218
20080526
20080704
20080901
20081013
20081111
20081127
20081225

I changed the location where the err file is:

APP FI HDAYSWAP DISK /ibi/srv71/wfs/bin/hdayswap.err

I also made sure that I have these 2 lines as suggested:
SET BUSDAYS = _MTWTF_
SET HDAY = swap

Now I get an error when I do the TABLE HOLD:

TABLE FILE SQLHLDY
PRINT HOLIDAY_DATE AS ''
BY HOLIDAY_DATE NOPRINT
ON TABLE HOLD AS HDAYSWAP FORMAT ALPHA
END

0 ERROR AT OR NEAR LINE 23 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC36219) AN ERROR OCCURED WHEN OPENING FILE: HDAYSWAP

Thank you all for helping me with this. It should be a simple issue, but it's turning into a nightmare...

Luminita


7.6.6 on AIX platform
Output: variety (Excel, HTML and PDF)
 
Posts: 33 | Location: New Hampshire | Registered: October 17, 2007Report This Post
Expert
posted Hide Post
This suggests that the file is in the correct directory, but doesn't have the right permissions.


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
Luminita,

Why are you writing to your holiday file?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Silver Member
posted Hide Post
Hi Daniel,

What I was trying to do is make use of an existent table and create the holiday file using that table. My thought was that since this table will get updated every year with the proper holidays that our company uses, then I don't have to worry about making the changes myself and risk being out of sink. But it might be that my thinking was wrong and that I cannot create a holiday file that way.

Thanks,
Luminita


7.6.6 on AIX platform
Output: variety (Excel, HTML and PDF)
 
Posts: 33 | Location: New Hampshire | Registered: October 17, 2007Report This Post
Expert
posted Hide Post
Luminata,

Have you taken a look at the permissions of the file you created? The file probably doesn't have Group Read permission because you created it with your User ID.


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

This looks like a straight forward task, but you also have to consider that these dates change, Christmas is always Dec 25, but the holiday will be Dec 24 if the 25 is a Saturday and the 26th if it falls on a Sunday, ditto for New Year's and July 4th. Labor day is the first Monday in Sept, Thanksgiving is the 4th Thursday. The Monday holiday bill makes MLK Day and Pres. Day, Memorial Day, etc float. Good luck incorporating all the rules in your program.


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
Silver Member
posted Hide Post
Hi guys,

Thank you all for helping me, I managed to get this working. My problem was the path to the server, I changed it and then my date calculations worked great.

APP FI HDAYSWAP DISK /servername/ibi/srv71/wfs/bin/hdayswap.err

Pat, as for figuring out all the dates changes, that's why I wanted to use this existent table, to save myself some work :-) That table is maintained and always current, and I can just get the data and use it. Why reinvent the wheel, right?

Thanks again!
Luminita


7.6.6 on AIX platform
Output: variety (Excel, HTML and PDF)
 
Posts: 33 | Location: New Hampshire | Registered: October 17, 2007Report This Post
Master
posted Hide Post
I guess I didn't read you initial post closely enough, I thought you were trying to create a program to update that table.


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

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Date manipulation (date +3 Business days)

Copyright © 1996-2020 Information Builders