• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 301
  • Last Modified:

Finding out of a table has 0 records

Experts,

I have a macro in SAS that is looping through a dataset and creating a table by extracting records from another dataset.

Is there a way to check to see while processing if the table  being created has no records?
0
morinia
Asked:
morinia
2 Solutions
 
BembiCEOCommented:
Select Count (any field) as RecordCount from TableName ???
If RecordCount results to 0, the table is empty.
0
 
Aloysius LowCommented:
If you are asking about the table being created, then no, not until it has been created or you make a query using the same conditions first which would be a waste of time to execute the same conditions and even joins first..
If you are asking about the source table, then you could a count first described above..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now