Solved

Finding out of a table has 0 records

Posted on 2014-04-29
2
267 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 250 total points
Comment Utility
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 250 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article describes some very basic things about SQL Server filegroups.
Read about achieving the basic levels of HRIS security in the workplace.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now