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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1220 views
  • 1 like
  • 2 in conversation