Hi nov,
"I am just wondering how the index which indeed is an implicit sort optimizes performance if indeed it is an extra pass."
you are right. it is indeed an extra pass if OP only run this code once. But if OP run this code many times ,it would be efficient .
And for " select count(*) from have ", if OP's dataset is in locale ,then the following code would be efficient.
%let dsid=%sysfunc(open(have));
%let nobs=%sysfunc(attrn(&dsid,nlobs));
%let dsid=%sysfunc(close(&dsid));
%put &nobs ;
P.S. I am not a perfect one, sometimes I would make some stupid errors ,so don't matter my code.
You could do better than me. 🙂
... View more