[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Finding out of a table has 0 records

Posted on 2014-04-29
2
Medium Priority
?
298 Views
Last Modified: 2016-02-13
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
Comment
Question by:morinia
2 Comments
 
LVL 35

Assisted Solution

by:Bembi
Bembi earned 1000 total points
ID: 40030790
Select Count (any field) as RecordCount from TableName ???
If RecordCount results to 0, the table is empty.
0
 
LVL 14

Accepted Solution

by:
Aloysius Low earned 1000 total points
ID: 40031014
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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question