How to detect how many observations in a dataset (or if it is empty), in SAS?

后端 未结 7 1257
慢半拍i
慢半拍i 2020-11-29 04:47

I wonder if there is a way of detecting whether a data set is empty, i.e. it has no observations. Or in another saying, how to get the number of observations in a specific d

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 05:10

    I guess I am trying to reinvent the wheel here with so many answers already. But I do see some other methods trying to count from the actual dataset - this might take a long time for huge datasets. Here is a more efficient method:

    proc sql;
    select nlobs from sashelp.vtable where libname = "library" and memname="dataset";
    quit;
    

提交回复
热议问题