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

Hello,

 

I created a PROC SQL code below.  I  found out that the result came out with missing data, I have restrict the Status=4, I don't understand why 'status=.' is still showing even though I have put 'Status=4 and Status ^=.'

 

So the strange thing is at the first beginning, I only put 'Status=4', then I found 'Status=.' was showing in the result.

Then I put 'Status=4 and Status ^=.',  I still found 'Status=.' was showing in the result.

 

Really beats me!

 

proc sql;
	create table want as
 	select site, id, CultureDate,AdmitDate,VisitDate,Culture
 	from have
 	where Status = 4 and Status ^=. and Culture = 1 and VisitDate ne . and AdmitDate ne .
			and CultureDate ne . and CultureDate ^= '01Jan8888'd 
			and ((CultureDate lt VisitDate) or (CultureDate gt AdmitDate+3))
 	order by site, id;
quit;
1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @ybz12003,

 

How did you determine the value of STATUS for an observation in dataset WANT, given that STATUS is not among the variables listed in your SELECT statement and hence will not be contained in WANT?

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hello @ybz12003,

 

How did you determine the value of STATUS for an observation in dataset WANT, given that STATUS is not among the variables listed in your SELECT statement and hence will not be contained in WANT?

ybz12003
Rhodochrosite | Level 12

LOL!  Thank you so much!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 762 views
  • 1 like
  • 2 in conversation