Focal Point
[SOLVED] App Studio 8.0 support DATEDIF function for business day exclude Holiday?

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

July 09, 2014, 03:38 PM
Emily Lee
[SOLVED] App Studio 8.0 support DATEDIF function for business day exclude Holiday?
I currently work with two systems: old system is WF7.7.03 on mainframe with UNIX partition. New system use App Studio 8 connect to WF 8 Window Server.
I need to calculate business day, excluding holidays, for my new report in App Studio 8. I followed WF DeveloperStudio 7.7.03 online help and created a Holiday text file, named as HDAYYR11.ERR. I placed it under ‘My Content’ within App Studio 8, same location as my fex program. I can see this .ERR file within “App Studio” by clicking the “Other files” icon. When I run my fex program, it either give me parsing error or neglect the Holiday file, and give me
(FOC1892) FILE NOT FOUND : HDAYYR11ERRORS *
When I tested same fex program at WF7.7.03 on mainframe UNIX, I did not get parsing error, but still get FILE NOT FOUND error.
Will App Studio 8 support DATEDIF function with Holiday File? Could it be Holiday File location issue? At App Studio 8, both my fex program and HDAYYR11.ERR are located at same location path - under “My Content”. At WF7.7.03 mainframe system (zOs), both my .ERR file and fex program are located at same UNIX app directory. I can’t make it “a member of ERRORS named HDAYxxxx” ( as instructed by the online help) since we don’t use PDS dataset, we use UNIX HFS structure. Please help!!

Here is my code:
SET BUSDAYS = _mtwtf_
SET HDAY= YR11

TABLE FILE FINAL_DATA
SUM
COMPUTE STDT_YYMD/YYMD = FINAL_DATA.SEG01.STDT;
COMPUTE STUS_ENDT_YYMD/YYMD = FINAL_DATA.SEG01.STUS_ENDT;
COMPUTE TOTAL_BDAY/I4 = DATEDIF(STDT_YYMD, STUS_ENDT_YYMD, 'BD');
BY FINAL_ DATA.SEG01.STUS_ENDT
BY FINAL_ DATA.SEG01.STDT
WHERE …….
END

thanks.

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


WebFOCUS 8.2.01 AppStudio
HTML, PDF, Excel
July 10, 2014, 06:40 AM
Alex
Put your file in and application directory that is in the APP PATH on the WF Reporting Server.


WF 7.7.04, WF 8.0.7, Win7, Win8, Linux, UNIX, Excel, PDF
July 10, 2014, 02:19 PM
jgelona
In earlier releases, prior to 7.7, the holiday file had to be in a specific directory. With 8.0 and maybe 7.7 (we skippped 7.7) you can place it where ever you want. I put ours in the baseapp folder and have a FILEDEF to it in the edasprof on the reporting server.

FILEDEF HDAYKIDS DISK baseapp/hdaykids.txt

I am not disputing what Alex said but I believe that when we were testing, without the FILEDEF, the server only looked in the default folder and did not search the application path. Could be wrong, but that is what I remember.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
July 10, 2014, 04:14 PM
Emily Lee
I have asked our Window server Amin put my file at
.../ibi/srv80/wfs/bin/HDAY13YR.ERR
also at APP PATH. But it did not work, I still got "File not found" error.

I will try to use FILEDEF with jgelona's suggestion, and let you know. We can use file name as .txt?? not .ERR? I will try both.

thanks,
Emily


WebFOCUS 8.2.01 AppStudio
HTML, PDF, Excel
July 11, 2014, 09:00 AM
jgelona
Emily, that folder is the default folder.

You also need:

SET HDAY = 13YR

set somewhere.

Since you are Linux (so are we), I suggest that your filename be lower case and the above SET would be

SET HDAY = 13yr


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
July 15, 2014, 09:38 AM
Emily Lee
Thanks to jgelona and all,
It works now with FILEDEF and proper path.

In my WF8 Window environment, I use
FILEDEF HDAY13YR DISK /ibi/apps/dmia/HDAY13YR.ERR
-RUN
SET BUSDAYS = _MTWTF_
SET HDAY= 13YR

In my WF7.7.03 Unix on mainframe, I use
FILEDEF HDAYYR11 DISK /products/WebTst73/ibi/apps/cpmsmi/HDAYYR11.ERR
-RUN

thanks.


WebFOCUS 8.2.01 AppStudio
HTML, PDF, Excel