Solved

Finding out of a table has 0 records

Posted on 2014-04-29
2
272 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
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 250 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This article describes some very basic things about SQL Server filegroups.
Creating and Managing Databases with phpMyAdmin in cPanel.
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…

919 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

21 Experts available now in Live!

Get 1:1 Help Now