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] HDAY File Setup for DATEDIF

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] HDAY File Setup for DATEDIF
 Login/Join
 
Member
posted
Hi All,

I'm having some trouble getting a holiday file working correctly with the DATEDIF function.

I have created a file named HDAYTEST.ERR with the following contents:

20170102
20170529
20170704
20170904
20171123
20171225
20171226
20991225

This file has been placed on our reporting server in this directory: C$\ibi\srv81\wfs\bin\

Here is my test procedure:

-SET &ECHO=ALL;
SET HDAY = TEST;
DEFINE FILE CAR
A/YYMD = '20170101';
B/YYMD = '20170107';
END
TABLE FILE CAR
PRINT A B
COMPUTE DELTA_BD/I3 = DATEDIF(A, B, 'BD');
BY HIGHEST 1 COUNTRY
END
-RUN

When I run this I get a value of 5 instead of 4 for DELTA_BD.
In the source code I found this error:

(FOC209) THE DATA VALUE EXCEEDS ITS LENGTH SPECIFICATION: TEST;

This is the second HDAY file I've tried. The first had the name of the holiday a space after the date.
Trying to avoid bugging our sys admins with changes so if anyone sees an error with what I'm doing I would greatly appreciate it.


Best,

Barron Fuentes

This message has been edited. Last edited by: Tamra,


App Studio 8105; Win 7 x64; HTML, Excel
 
Posts: 8 | Registered: December 14, 2016Report This Post
Expert
posted Hide Post
First thing to try: "SET" commands should not have an ending semi-colon, just "-SET"commands.


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
Also, it seems you can have the holiday date file in a reporting server application folder (that's part of the path), so you won't need to bother the sys admin. You may be able to access the baseapp app folder without the need of the sys admin.

From the doc:
quote:
By default, the holiday file has a file name of the form HDAYxxxx.err and is on your path


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
Member
posted Hide Post
Francis - Thanks for your response.

Here's what I've tried now:

SET HDAY = TEST
DEFINE FILE CAR
A/YYMD = '20170101';
B/YYMD = '20170107';
END
TABLE FILE CAR
PRINT A B
COMPUTE DELTA_BD/I3 = DATEDIF(A, B, 'BD');
BY HIGHEST 1 COUNTRY
END
-RUN

Returns this error:
(FOC1892) FILE NOT FOUND : HDAYTESTERRORS *

I do have access to the baseapp application folder and have dropped the HDAYTEST.ERR file in the directory. However, I still receive the file not found error.


App Studio 8105; Win 7 x64; HTML, Excel
 
Posts: 8 | Registered: December 14, 2016Report This Post
Expert
posted Hide Post
From the doc:
quote:
By default, the holiday file has a file name of the form HDAYxxxx.err


so your file should probably be named HDAYTEST.err.

Other people have had issues with the HDAY file. Have you searched FocalPoint?


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
Member
posted Hide Post
File is already named HDAYTEST.ERR.

Yes I have searched FocalPoint.


App Studio 8105; Win 7 x64; HTML, Excel
 
Posts: 8 | Registered: December 14, 2016Report This Post
Expert
posted Hide Post
quote:
err
Perhaps it's case sensitive - that's why I quoted the documentation.


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
Barron.
You should have a FILEDEF for your holiday file.
Be sure that the holiday file encompasses the dates you use.
Also set the BUSDAY parameter:
  
FILEDEF HDAYTEST DISK C:\ibi\srv81\wfs\HDAYTEST.ERR
SET BUSDAY=SMTWT__
SET HDAY = TEST
DEFINE FILE CAR
A/YYMD = '20170129';
B/YYMD = '20170205';
END
TABLE FILE CAR
PRINT A B
COMPUTE DELTA_BD/I3 = DATEDIF(A, B, 'BD');
BY HIGHEST 1 COUNTRY
END
-RUN


HDAYTEST.ERR
  
20170101 New Year
20170131 Last day of January
20171231 Sylvester


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
Member
posted Hide Post
Thank you for your help Danny.

I'm still not having success.
When I run:
FILEDEF HDAYTEST DISK C:\ibi\srv81\wfs\HDAYTEST.ERR
SET BUSDAY=_MTWTF_
SET HDAY = TEST
DEFINE FILE CAR
A/YYMD = '20170129';
B/YYMD = '20170205';
END
TABLE FILE CAR
PRINT A B
COMPUTE DELTA_BD/I3 = DATEDIF(A, B, 'BD');
BY HIGHEST 1 COUNTRY
END
-RUN  


I get a file not found error:
(FOC1892) FILE NOT FOUND : HDAYTESTERRORS *

Same result with a path of C:\ibi\srv81\wfs\bin\HDAYTEST.ERR. I also added a copy of HDAYTEST.ERR to C:\apps\baseapp\ and used FILEDEF to point it but also received a file not found error.


App Studio 8105; Win 7 x64; HTML, Excel
 
Posts: 8 | Registered: December 14, 2016Report This Post
Expert
posted Hide Post
Are you sure your drive is C and not D?

I created a hdaytest.err file in our baseapp folder and it works with the FILEDEF.




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
It also works with FILEDEF if the file is on the srv folder:

FILEDEF HDAYTEST DISK d:\ibi\srv81\wfs\hdaytest.err
-RUN

So far, it does not work without a FILEDEF.


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,
I seem to recall that if the HDAYxxxx.err file was to be found in the path, FILEDEF wasn't necessary. But this was quite some time ago...

Barron,
Are you sure you put the file on the server? Maybe it is on your machine where you have a copy of DS or AS but you are running against the WebFOCUS server which is on another machine?


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
Guru
posted Hide Post
quote:
hdaytest.err


For more information related to the holiday file please visit Using Standard Date Functions

Click on the link for Specifying Work Days, holiday info regarding FILEDEF etc is also presented.

Thank your for participating in the Focal Point Forum.
Tamra Colangelo
Focal Point Moderator
Information Builders


WebFOCUS 8x - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
 
Posts: 487 | Location: Toronto | Registered: June 23, 2009Report This Post
Member
posted Hide Post
All,

Thanks for your help on this. I couldn't get it working from the C:\ibi\srv81\wfs folder (file not found error still).

I was able to get it working using FILEDEF and corrected an error in my baseapp folder path.

Here's the working code:

FILEDEF HDAYTEST DISK C:\ibi\apps\baseapp\HDAYTEST.ERR
SET BUSDAY=_MTWTF_
SET HDAY = TEST
DEFINE FILE CAR
A/YYMD = '20170101';
B/YYMD = '20170107';
END
TABLE FILE CAR
PRINT A B
COMPUTE DELTA_BD/I3 = DATEDIF(A, B, 'BD');
BY HIGHEST 1 COUNTRY
END
-RUN

This message has been edited. Last edited by: Barron,


App Studio 8105; Win 7 x64; HTML, Excel
 
Posts: 8 | Registered: December 14, 2016Report This Post
Expert
posted Hide Post
Who knows why it's so difficult to get this to work, specially when following the instructions to the letter. Waitaminnit, I know why...


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
  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] HDAY File Setup for DATEDIF

Copyright © 1996-2020 Information Builders