I have an fcmp function with an array, but the IN operator doesn't seem to work. What am I doing wrong?
proc fcmp outlib=mylib.UserFuncLib.dateFuncs;
function previousWorkingDayDate(dateWeekday);
* Not a weekend and not a bank holiday;
dayBefore = intnx('Day',dateWeekday,-1);
* Array of bank holidays, needs to be kept updated;
array bankHolidays[9] / nosymbols
('03Jan2022'd '15Apr2022'd '18Apr2022'd '02May2022'd
'02Jun2022'd '03Jun2022'd '29Aug2022'd '26Dec2022'd
'27Dec2022'd );
do while ((dayBefore in bankHolidays) or weekday(dayBefore) < 2 or weekday(dayBefore) > 6);
dayBefore = intnx('Day',dateWeekday,-1);
end;
return(dayBefore);
endsub;
The code dayBefore in bankHolidays gives ERROR 79-322: Expecting a (.
Help! Thanks.