0

I need to identify if a dataset has no observations so I can create an IF statement later to ignore it. Any ideas??

Open to proc SQL, but I don't understand it.

pakalla
  • 163
  • 4
  • 10
  • 1
    Have you checked this answer: http://stackoverflow.com/questions/5658994/how-to-detect-how-many-observations-in-a-dataset-or-if-it-is-empty-in-sas?rq=1 – catquas Jul 29 '14 at 00:59

1 Answers1

1

If a dataset has 0 observations, a set statement will not run. So, what I do is to create a macrovariable that is set only if the SET statement has been run, like this: %let doesItExist=NO; data _null_; set theDataset; call symput("doesItExist","YES"); stop; run; %put &doesItExist;

Stig Eide
  • 1,052
  • 7
  • 14