SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
padmanabh
Calcite | Level 5

Hi,

I want to create a validation summary report for a table or a csv file. I have a sql table with x columns and the x columns has y no of records. The validations include lookups,missing values, duplicates and invalid values.

e.g. name1

       numeric1

      date1

     name2

The data I have taken from sql which is imported using the proc import data= option.

Now, I would like to have a report with each column against which the number of invalid records. On top of the report the overall no of records provided and the table name or csv filename.

I am using the sas university edition to do this. 

Could anyone please guide on how do I do this, I am pretty new to sas and can do the basics

3 REPLIES 3
smantha
Lapis Lazuli | Level 10

There is no single step that will give you this answer. You have to define what lookups and invalids mean. Other wise the closest that comes to the description you have is

proc summary data=inputdata  missing no print;
class _character_;
output out=summary(drop=_:) n= nmiss= max= min=/autoname;
run;

proc summary data=inputdata  missing no print;
class _numeric_;
output out=summary(drop=_:) n= nmiss= max= min=/autoname;
run;

However the output itself can be little confusing. IF you are familiar with macros you can do the above for each variable by placing them in a macro loop.

andreas_lds
Jade | Level 19

Please post example data in usable form and show what you expect as output.

 

padmanabh
Calcite | Level 5
Table_NameCust_Name     
No of Records200     
       
       
ColumnsTotal_RecordsMissing_ValuesDuplicatesInvalid_ValuesLookups 
Name_character2000312 
Age_numeric1991503  
       
       

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 740 views
  • 0 likes
  • 3 in conversation