Focal Point
[SOLVED] DATEADD suddenly stopped working

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

September 17, 2014, 02:42 PM
Norb Eckert
[SOLVED] DATEADD suddenly stopped working
Hi All,

Can anyone tell me why the following code suddenly doesn't provide the correct date? This just started to fail two days ago but prior to that it's been working for months.

SET BUSDAYS = _MTWTF_
-RUN
-SET &DTPREV = DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'BD',-1),'YYMD','I8YYMD');
-TYPE &DTPREV

&DTPREV should be 20140916 and instead it's 19001231. WTH!!!

Any ideas or alternatives? This is from WebFOCUS 7.6.9.

Thanks,

Norb

This message has been edited. Last edited by: Norb Eckert,


prod:7.6.9, win2k3 mre, caster, bid, devstudio 7.6.9
September 17, 2014, 03:06 PM
Norb Eckert
Well I added a line for the holiday file and now it's working correctly.

SET HDAY = SBLC

So I guess that everywhere I have a BUSDAYS command I will need to add an HDAY command as well. I don't understand why this is necessary since I would expect the DATEADD function to work with or without the holiday file being specified.

Thanks,

Norb


prod:7.6.9, win2k3 mre, caster, bid, devstudio 7.6.9
September 18, 2014, 09:02 AM
jgelona
Just put the SET HDAY in the server profile. Also, I think that to use 'BD' the holiday file is required.

"...When using the business day unit, DATEADD uses the BUSDAYS parameter setting and holiday file ..."


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
September 18, 2014, 10:05 AM
RRKen
maybe a custom holiday file ran out? Might be located here:
ibi/srv769/wfs/bin/hday??.err


8.2.03 AIX Client Windows Tomcat
DB2, Terradata, SQL, Oracle