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

Hi Gurus,

 

When i connect to Database server like Oracle, i know that it treats Null value differently from SAS, Do you think it fixs the problem if i assign every variable (which is in where clause) is  missing  ?

 

Thanks

 

 


Missing.PNG
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Unlike SAS most database system will use a tri-level logic with respect to missing values.  In SAS a boolean test is either true or false. In DBMS the result can be unknown or null which is treated as neither true nor false.

 

For example in SAS a numeric missing value is less than any actual number and you can test for equality between missing values.  So missing values would be included in tests like these:

age < 10
age ne 10
age = baseline_age

But in most DBMS you need to explicitely include the NULL values in your testing.

age < 10 or age is null
age ne 10 or age is null
age = baseline_age or (age is null and baseline_age is null)

 

View solution in original post

3 REPLIES 3
LinusH
Tourmaline | Level 20
It depends on what the problem is that you have, what is your desired outcome?
If you set:
Options sastrace = ',,,d' sastraceloc = saslog nostsuffix;
You can see what Oracle is doing with your query.
Data never sleeps
SASNE
Obsidian | Level 7

Hi LinusH,

 

I want to include those Null value, but when i set

 

select ColA  ColB from table where ColA!=1,

 

then the result exclude all null value, in case i want it

 

 

 

Tom
Super User Tom
Super User

Unlike SAS most database system will use a tri-level logic with respect to missing values.  In SAS a boolean test is either true or false. In DBMS the result can be unknown or null which is treated as neither true nor false.

 

For example in SAS a numeric missing value is less than any actual number and you can test for equality between missing values.  So missing values would be included in tests like these:

age < 10
age ne 10
age = baseline_age

But in most DBMS you need to explicitely include the NULL values in your testing.

age < 10 or age is null
age ne 10 or age is null
age = baseline_age or (age is null and baseline_age is null)

 

sas-innovate-2024.png

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.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1018 views
  • 0 likes
  • 3 in conversation