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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3487 views
  • 0 likes
  • 4 in conversation