DATA Step, Macro, Functions and more

Include in Set if has Rows

Valued Guide
Posts: 620

Include in Set if has Rows

Is there a way to include a table in a set statement only if it has rows?

Super User
Posts: 10,616

Re: Include in Set if has Rows

Posted in reply to DavidPhillips2

Check nobs for the dataset beforehand (save to a macro variable), and wrap the dataset conditionally in a macro. Use that macro in place of the dataset name in the set statement.

Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation