Focal Point
[SOLVED] holiday file

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7791088713

February 12, 2009, 08:42 AM
Mark1
[SOLVED] holiday file
Hello,
I am trying to make a holiday file for a daydiff function. Looking through the posts here in focal point, I have gotten as far as making my file and putting it in:
ibi\srv76\wfs\bin\HDAYDOFF.ERR

The contents of that file are as follows:
20090101
20090119
20090410
20090525
20090703
20090907
20091126
20091221
20091222
20091223
20091224
20091225

However, when I run this code:
SET HDAY = DOFF
SET BUSDAYS = SMTWTFS
-RUN

TABLE FILE CAR
PRINT
COUNTRY
COMPUTE DAT1/YYMD = 20091201 ;
COMPUTE DAT2/YYMD = 20091231 ;
COMPUTE DTDIFF/I2 = DATEDIF(DAT1, DAT2, 'BD');
END

The output is 30 days difference. It should be 25 since the 21st through the 25th of December is in my holiday file.

Now, when I run this code, just to test to see if WF even recognizes the file:
SET HDAY = DOFF
-RUN

I get this message:
(FOC1892) FILE NOT FOUND : HDAYDOFFERRORS *

Can anyone help me figure out how I can get a holiday file to work? Thank you!

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


Windows version 768
February 12, 2009, 10:33 AM
Francis Mariani
quote:
SET HDAY = DOFF
SET BUSDAYS = SMTWTFS
-RUN


The location and name of your file looks correct, the SET command looks correct - you MAY need a -RUN right after the SET HDAY command for it to be applied before the SET BUSDAYS command.

The following commands lets you know if the SET HDAY command worked:

SET HDAY = DOFF
-RUN

-? SET HDAY &VARHDAY
-RUN

-TYPE &VARHDAY

-? SET HDAY &VARHDAY puts the value of the HDAY setting in a variable called &VARHDAY. If the result of the -TYPE command is blank, then the SET HDAY command did not work.


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
February 12, 2009, 11:01 AM
GamP
Mark,

I ran your exact code on my environment (which today is windows xp based) and there it runs without any problem, and gives me the correct number of days (25). My release level is 767.

It may be that the older release has problems with the file being uppercase.
Try to change the name to all lowercase and see if that helps.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
February 12, 2009, 11:26 AM
Mark1
Thank you for your help. However, I still cannot get WF to recognize the file. When I ran your code, Francis, I got the same error message:
(FOC1892) FILE NOT FOUND : HDAYDOFFERRORS *

Changing to lowercase did not work either. BTW - I have 767 on Windows XP professional. I have not updated my profile, yet.

Is a .err file different from a regular .txt file? I made my holday file using a new text document and saved it with an extension of .err.
Did I do something wrong there?

TomP - can you expand a little bit on what you mean when you say "Search for HOLIDAY FILE".


Windows version 768
February 12, 2009, 11:41 AM
Mark1
One more thing I found out... when I do a search in Windows Explorer for filenames with .err, all of the .err files have a type of "ERR File" except for the one I created has a file type of "Text Document", even though the extension is .err. How can I fix this? Thanks!

Also, all of the other .err files are in srv76\home\nls


Windows version 768
February 12, 2009, 11:43 AM
Francis Mariani
Mark1, the err file is just a text file with an err suffix.

Are you sure the contents of the file are correct?

Are you sure the directory you placed the file in is the same one as being read by the WF server?

It appears the suffix can be lower or upper case, but the file name must be uppercase, and be 8 characters long beginning with 'HDAY'.


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
February 12, 2009, 11:47 AM
Francis Mariani
Correction:

The filename must be five to eight characters long beginning with 'HDAY' in uppercase.


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
February 12, 2009, 11:55 AM
Mark1
I think I fixed it. What I did was that I went into the file location where all of the other .err files were. I copied one and edited it with notepad erasing what was in there and putting in my dates. Then I ran Francis' code again and the result was:
DOFF

Then I ran my original code and got a 25 day difference!!! Yeah!!!!

BTW - the file location that worked for me was:
ibi\srv76\home\nls

Thanks for all of your help!


Windows version 768
February 12, 2009, 11:56 AM
GinnyJakes
This may seems like a stupid question, but are you doing this on the localhost srv76/wfs/bin subdirectory or did you put the file on the 'real' WebFOCUS reporting server bin directory?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
February 12, 2009, 12:06 PM
Francis Mariani
quote:
Are you sure the directory you placed the file in is the same one as being read by the WF server?


This could very well be the reason...


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
February 12, 2009, 02:07 PM
Danny-SRL
According to the manual the holiday file should be placed on the WebFocus server in directory: \ibi\srv76\wfs\bin


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

February 12, 2009, 02:56 PM
Tony A
quote:
all of the .err files have a type of "ERR File" except for the one I created has a file type of "Text Document"
To me, this is the give away statement and I would lay money on the fact that you've file extensions hidden for known file types?

When you saved your file from within your text editor and gave it the filename hdaydoff.err (what you thought was an extension), i would guess that it actually saved the file hdaydoff.err.txt. When you have looked at it in explorer allyou've seen is hdaydoff.err.

WebFOCUS wouldn't have used a file of that name because the extension was wrong, the .err is treated as part of the filename.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
February 12, 2009, 03:29 PM
Mark1
You are probably right, Tony. I have done that before by accident. So, what is the easiest way to create a .err file then? You open a new text document... then what?


Windows version 768
February 12, 2009, 05:16 PM
Tony A
From windows explorer, I usually right click and create new text file and change the name and extension as required. Then I open it with my favorite editor. Each to their own method, but it works for me.

T
February 12, 2009, 08:47 PM
Waz
I gave up with the hidden file extensions long ago, otherwise, you don't realy know what it is or could be.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 13, 2012, 11:06 AM
John_Edwards
Just to update, 7.7 appears to need a FILEDEF for this problem.

 
FILEDEF HDAYDOFF DISK C:\ibi\srv77\wfs-Reporting-Production\bin\HDAYDOFF.ERR
SET HDAY = DOFF
-RUN