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
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
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.