我有一个带有数组的 fcmp 函数,但 IN 运算符似乎不起作用。我究竟做错了什么?
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;
bankHolidays 中的代码dayBefore给出ERROR 79-322: Expecting a (.
帮助!谢谢。