Good discussion - sorry I missed this one before starting a new one. I'm now convinced that %SYSFUNC() needs to see something between the open/close parens of the DATA STEP function. A NULL STRING, alone, will not get passed the ERROR of missing arguments.
This is a pity, since this in not intuitive in the macro (text generation) world, at least for me, and leads to inconsistency based on number of arguments passed to the DATA STEP function:
- ONE argument - %SYSFUNC() will not support a minimal null string. EG, the %sysfunc(countw()) examples.
- Just give %SYSFUNC() a little assistance in recognizing the null string, and you're back in business. EG, the %sysfunc(countw(%str())) examples. The null string argument is still valid. You just kinda need to force %SYSFUNC() to acknowledge it. This, to me, is not intuitive.
- TWO or more arguments - %SYSFUNC() does fine with multiple null strings, since the comma, itself, provides that assist for recognizing null arguments. They were and remain valid. They're just easier for %SYSFUNC() to recognize when that comma is there. Again - not intuitive to me.
I would much rather have %SYSFUNC() recognize the open/close parens of the DATA STEP function as argument delimiters, in addition to the comma for multiple arguments, of course. Then it would not fail, in the absence of that awkward %str() assist, to recognize a single null argument.
Nice discussion.