BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Nehcour0420
Calcite | Level 5

Hi,

I am wondering if in sas proc sql, the space value (" ") is considered as a NULL value?

Thanks,

Eric

1 ACCEPTED SOLUTION

Accepted Solutions
Howles
Quartz | Level 8

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

View solution in original post

3 REPLIES 3
art297
Opal | Level 21

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.

Howles
Quartz | Level 8

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

PGStats
Opal | Level 21

Windows Office Access (2007) uses a different convention when dealing with Empty and Null strings. In Access, TRUE is represented by -1.:

Capture.PNG

the functions isEmpty and isMissing, although accepted in SQL expressions, are actually VBA functions that do not return anything useful in SQL.

PG

PG

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to connect to databases in SAS Viya

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.

Discussion stats
  • 3 replies
  • 3990 views
  • 0 likes
  • 4 in conversation