An Idea Exchange for SAS software and services

by PROC Star
on ‎11-08-2017 05:31 AM

I don't often react to proposals with "but you can already do it like ... ", but in this case I'm wondering why having %countw would be better than %sysfunc(countw())?  (Other than the fact that I mistype %sysfunc about 30% of the time).


I suppose it would highlight it in the documentation, when someone was browsing for macro functions. Are you thinking there might be an efficiency benefit to having a native macro function?


I haven't been around long enough to know the history.  I assume %sysfunc() was added to the macro language at some point.  Could it be that the functions you listed were around before there was %sysfunc, and now that they gave us %sysfunc, there isn't a need for SAS to develop more macro functions that are translations of data step functions?

by Super User
on ‎11-08-2017 06:55 AM

Key sentence:

(Other than the fact that I mistype %sysfunc about 30% of the time)

The proposed function would reduce complexity in typing and reading code. Given the fact that the macro facility is a pure text processor, having native string handling functions only seems natural. Especially when one thinks that %scan() is already there, and I rarely use scan() in a datastep without countw(), and %scan() without %sysfunc(countw()).

by New Contributor barefootguru
2 weeks ago

It's a bit of a slippery slope… there's a lot of data step functions that could be added to the macro language.


@Quentin is correct:  the existing macro string handling was present before the addition of %sysfunc, and macro and data step were at least on the same playing field for capability.  Then %sysfunc was added and there's been almost no new macro functions added since.


It is unwieldy, particularly when you embed %sysfunc within %sysfunc, but the power's there Cat Wink

Idea Statuses
Top Liked Authors