How to treat database null in SAS

LuckyLucks
LuckyLucks used Ask the Experts™
on
Hi I am writing a PROC SQL query to that works with a db2 database. I need to know what the db2 equivalent of null should be in my where clause. I have both character and numeric fields.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
here's my guess based on my workings on SAS, as i've not used db2 with SAS before:
if you are not using sql pass-through facility, for numerics, NULL would be . (a dot) and for strings "" (a pair of quotation marks, double or single does not matter)

Author

Commented:
I was able to use IS NULL as well in PROC SQL. Is this correct?
yes you could too but i'm not sure about the result.
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Author

Commented:
Instead of NULL would be . (a dot) and for strings "" , can I simply use IS MISSING. That is allowed in PROC SQL as well.
Commented:
IS NULL  (and IS NOT NULL) is the appropriate method for specifying NULL predicates.

http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp

Author

Commented:
gmarino, I am accessing DB2 through PROC SQL - I am assuming your answer is relevant to DB2 SQL queries?

Commented:
EXAMPLES OF SQL WHERE CLAUSES
The WHERE clause in SAS SQL procedure supports many standard comparison, special and logical operators, such as EQ, NE, GT, LE, LT, BETWEEN … AND, IN, IS NULL, LIKE, CONTAINS, EXISTS, AND, OR, NOT … etc.

Taken from:
http://www2.sas.com/proceedings/sugi31/171-31.pdf
have you tried running the query? is the result not something that you are expecting?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial