BookmarkSubscribeRSS Feed
GGO
Obsidian | Level 7 GGO
Obsidian | Level 7

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.

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 15 replies
  • 3930 views
  • 4 likes
  • 7 in conversation