Hi,
I am wondering if in sas proc sql, the space value (" ") is considered as a NULL value?
Thanks,
Eric
If the evaluation is performed by the native SAS implementation of SQL, a space is considered to be null/missing, and can be compared with other values. The host OS (Windows or Unix or whatever) does not matter.
If the evaluation is done by a third-party DBMS (Oracle, MS Access, etc.),it's usually different, because comparisons involving nulls yield nulls. It should not matter whether the DBMS receives the query via pass-thru or libname engine.
Nehcour0420 wrote:
Hi,
I am wondering if in sas proc sql, the space value (" ") is considered as a NULL value?
Thanks,
Eric
Test it on your own system. I think, at least on Windows, that it is unless you are using a pass thru in which case it would be cross-system dependent.
If the evaluation is performed by the native SAS implementation of SQL, a space is considered to be null/missing, and can be compared with other values. The host OS (Windows or Unix or whatever) does not matter.
If the evaluation is done by a third-party DBMS (Oracle, MS Access, etc.),it's usually different, because comparisons involving nulls yield nulls. It should not matter whether the DBMS receives the query via pass-thru or libname engine.
Nehcour0420 wrote:
Hi,
I am wondering if in sas proc sql, the space value (" ") is considered as a NULL value?
Thanks,
Eric
Windows Office Access (2007) uses a different convention when dealing with Empty and Null strings. In Access, TRUE is represented by -1.:
the functions isEmpty and isMissing, although accepted in SQL expressions, are actually VBA functions that do not return anything useful in SQL.
PG
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.