Posted By

sarathannapareddy on 08/11/09


sql data tables open variable into macro dictionary null call dataset proc sas sysfunc symput NOBS ATTRN Clause SQLOBSAutomatic

Versions (?)

Finding the number of observations in the Dataset

 / Published in: SAS


There are a number of ways of finding out the number of observations in a SAS data set and, while they are documented in a number of different places, I have decided to collect them together in one place. At the very least, it means that I can find them again.

Read more at:

  1. First up is the most basic and least efficient method: read the whole data set and increment a counter a pick up its last value. The END option allows you to find the last value of count without recourse to FIRST.x/LAST.x logic.
  3. data _null_;
  4. set test end=eof;
  5. count+1;
  6. if eof then call symput("nobs",count);
  7. run;
  9. read more about 5 more diff ways to find number of observation in a dataset....
  10. :

Report this snippet  


RSS Icon Subscribe to comments
Posted By: sarathannapareddy on August 13, 2009

Read more at:

You need to login to post a comment.