Open In App

SAS | Delete Empty Rows

Generally, when we import data from external sources such as Excel/CSV files, it loads additional rows that are totally blank. Sometimes empty values in the database also affect the desired output so it’s necessary to check missing cases and perform operations accordingly

Example:
Input: The sample dataset looks like below have four variables – 1 character and 3 numeric. It would be used further in the example to demonstrate how to remove empty rows.



Name Phys Chem Maths
Shubhash 70 68 66
Samar 55 85
Ashutosh 54 78 89
Varun 50 96 85
Pratiksha 68 93

Create a SAS dataset
The below defined code is a sample dataset to perform delete empty operation.




data outdata;
LENGTH name $12.;
input name $ phys chem maths ;
infile datalines missover;
datalines;Shubhash 70 68 66
    samar 55 . 85 
    ashutosh 54 78 89 
    varun 50 96 85 
    pratiksha . 68 93 
;run;

Output:




Article Tags :