@hellohere wrote:
Thanks,
If mvar pre-exists, I assume still work. But anyway, no additional macro variable?!
Macro does not return anything. But much more convenient to "Take" that way , say,
%if %ds_rowct(&dsname.) %then %do;
....
%end;
If not, simply invoke the macro and then evaluate the speific macro variable, BUT
the reality is that too hard to remember all the variables when you are coding with
dozens of macros!!!
You can create macros that only emit PART of a statement. Then you could use the macro as if it was a function, like in your new example. Note that your original question did not state that was your objective.
There are dozens of examples of macros that do that for the example problem of finding the number of observations in a dataset. See for example this one:
https://github.com/sasutils/macros/blob/master/nobs.sas
%if 0<%nobs(&dsname.,mvar=) %then %do;
... View more