Help using Base SAS procedures

How to differentiate a column value is a null or blank?

Reply
N/A
Posts: 0

How to differentiate a column value is a null or blank?

Hi guys,

If I have a column that accept null value, how can I check whether the column is a null or is a blank(' ')?

Is there a function for it?

Thanks

Yours Sincerely,
helphelp
Super User
Posts: 5,427

Re: How to differentiate a column value is a null or blank?

Posted in reply to deleted_user
I assume this is a char column.
In SAS, blank means MISSING (aka NULL), which is different compared to how most RDBMS work. If your data does not reside in SAS table, you could might use SQL pass-thru to accomplish this.
/Linus
Data never sleeps
Contributor
Posts: 20

Re: How to differentiate a column value is a null or blank?

Posted in reply to deleted_user
There is also a MISSING() function in the datastep. It accepts both numeric and character variables. They syntax to check whether a variable called VAR1 has a missing value would be:

if missing(VAR1) then ...
SAS Super FREQ
Posts: 8,864

Re: How to differentiate a column value is a null or blank?

Hi:
This documentation topic contains some useful information. Partly it depends on whether you are accessing relational database data or other data and what -exactly- NULL means in that data format.

http://support.sas.com/documentation/cdl/en/acreldb/61890/HTML/default/a001924296.htm

cynthia
Ask a Question
Discussion stats
  • 3 replies
  • 126 views
  • 0 likes
  • 4 in conversation