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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] HDAY with DATEMOV(date, 'PBD')

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] HDAY with DATEMOV(date, 'PBD')
 Login/Join
 
Silver Member
posted
Hi to all,

i have issue with HDAY and Prior business day.
it means if the as of date is 20140102/yyyymmdd
and the holiday is 20140101 so the prior business day should be 20131231. but i am getting 19001231 which is default date instead of 20131231. if as of date is 20140104 and my holiday list is 20140103 then i will get the corect prior business day 20140102. just the issue is with the first of January. my code is as the following
  
-SET &EdaConfPath = FGETENV(7,EDACONF,256,'A256');
-SET &EdaConfPath = TRUNCATE(&EdaConfPath);
-SET &EdaBin = &EdaConfPath |'\bin\';
-RUN

FILEDEF HDAY2000 DISK &&LOCATION|HOLIDAYS.TXT
-RUN
STATE &&LOCATION|HOLIDAYS.TXT
-RUN
-IF &RETCODE NE 0 GOTO NOHOLFIL;
WINNT COPY &&LOCATION|HOLIDAYS.TXT &EdaBin|HDAY2000.ERR
-RUN
SET HDAY = 2000
-RUN
-NOHOLFIL
SET BUSDAYS = _MTWTF_
-RUN

and the defination of Prior business day is:
ASOFDATE/YYMD  = '20140102';
PBD/YYMD       = DATEMOV(ASOFDATE, 'PBD');


how to get the prior business day for the starting year (20131231)?
Thanks,

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


WebFOCUS 7.67 & WebFOCUS 80 windows
 
Posts: 45 | Location: Kabul, Afghanistan | Registered: August 07, 2011Report This Post
Virtuoso
posted Hide Post
How is ASOFDATE declared, and how is its value assigned to it?
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Silver Member
posted Hide Post
j.gross,

ASOFDATE/YYMD = '20140102';


WebFOCUS 7.67 & WebFOCUS 80 windows
 
Posts: 45 | Location: Kabul, Afghanistan | Registered: August 07, 2011Report This Post
Silver Member
posted Hide Post
thanks,

today i could solve the issue. it means the issue was with holidays.txt.

when i add the 20130101 as holiday in my holidays.txt then able to get the prior business day (20131231) for as of 20140102.

thanks Smiler


WebFOCUS 7.67 & WebFOCUS 80 windows
 
Posts: 45 | Location: Kabul, Afghanistan | Registered: August 07, 2011Report This Post
Guru
posted Hide Post
A somewhat annoying limitation to the Holidays file is that you must have at least on entry for every year that you might check a date against. Otherwise you recieve a Zero value.

This is documented but very east to miss - from the Function Manaul on "specifying Holidays"

quote:
Each year for which data exists must be included. Calling a date function with a date
value outside the range of the holiday file returns a zero for business day requests


Cheers

Stu


WebFOCUS 8.2.03 (8.2.06 in testing)
 
Posts: 253 | Location: Melbourne, Australia | Registered: February 07, 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     [SOLVED] HDAY with DATEMOV(date, 'PBD')

Copyright © 1996-2020 Information Builders