-1

I have empty rows in SAS after I imported an .xls file.

I'm using the following code but it is not working.

I'm trying to delete all the empty rows.

DATA PROJECT.CLEAN_DATA1; 
set PROJECT.merged_data; 
  if missing(coalesceC(of _character_)) and missing(coalesce(of_numeric_)) then delete; 
run; 

Please help!

Ferrmolina
  • 2,737
  • 2
  • 30
  • 46
user3437212
  • 637
  • 1
  • 10
  • 20
  • 1
    How is it not working? Is it keeping the empty rows? Generating an error? Make sure to have a space between the `of` keyword and the `_numeric_` variable list. Are you sure the character variables are empty? Perhaps they have some non-printing character? – Tom Sep 19 '18 at 03:48
  • Unless you have empty rows throughout your data set that's overkill. You can usually pick a single column and delete based on that. – Reeza Sep 19 '18 at 04:09
  • Possible duplicate of [How to delete blank observations in a data set in SAS](https://stackoverflow.com/questions/17291756/how-to-delete-blank-observations-in-a-data-set-in-sas) – Quentin Sep 19 '18 at 12:29

1 Answers1

1

Note: It was “character” in the original post with out “_”.

_CHARACTER_ is the constant that includes all characters in SAS. Try that instead in the condition statement.

And it is a good programming practice to write global constants in SAS as is. So, the condition is -

missing(coalesceC(of _CHARACTER_)) and missing(coalesce(of _NUMERIC_)) 
Arik
  • 26
  • 2