LPARAMETERS startdate, enddate LOCAL cycle, tocycle, testdate, ret_val ret_val = 0 tocycle = enddate-startdate FOR cycle = 0 TO tocycle testdate = startdate + cycle IF .NOT. INLIST(DOW(testdate,1), 6, 7) && friday, saturday ret_val = ret_val + 1 ENDIF ENDFOR RETURN ret_val