Yes, a trading date calendar would be great. But which exchange(s)? NYSE? LSE? Bourse? etc. Or maybe you would want global trading dates covering multiple exchanges?
And how far back should the calendars go? All the normal sas calendar intervals can be relied on to accurately go back to the start of the Gregorian calendar (October 1582). But each exchange would have a unique "birthdate", so there would be no common starting date. Maybe such a function would only accept dates after 01jan1900. But then there are younger exchanges to be accommodated.
Also, and likely more problematic: Normal SAS calendar intervals can be relied on for accurate future dates and intervals, but we don't know the future calendars of stock markets. Not only do exchanges change their calendars by policy, they can also miss dates through unanticipated events. On 9/11/2001 NYSE was closed early, and was closed all day on Tuesday 9/12 through Friday 9/15.
Of course, you might restrict such functions to reject arguments with future dates. But that would not help when running such a function on 9/17/2001 (the NYSE reopen date). It would regard the prior trading date as 9/15. After all we don't update pre-compiled sas functions on a daily basis.
And as to speed: sas calendar functions using normal intervals ('day','week','weekday',etc.) are all algorithm based. While functions using holidays, (or trading days) have to be based on a date-list instead of an algorithm. I don't think we'll ever get functions using trading-day intervals to be as fast as regular calendar units.
Edited note: In so far as holiday assignments are rule-based and not idiosyncratic from year to year, you might be able to improve speed. But holidays - like trading days - can change over time.
... View more