Programming the statistical procedures from SAS

Where statement in proc means

Accepted Solution Solved
Reply
Contributor
Posts: 69
Accepted Solution

Where statement in proc means

Hello,

 

I have the following code:

proc means data=sasuser.sasfile010916 mean median std min max;
where firmdefi=1 and firmdefi=2;
var equity TAssets Sales;
class firmdefi;
run;

 

The log indicate NOTE: No observations were selected from data set SASUSER.SASFILE010916.

 

There is data that relate to firmdefi 1 or 2 and I do not understand what is my mistake?

 

Thanks for any help!!!


Accepted Solutions
Solution
‎03-29-2017 02:36 AM
Respected Advisor
Posts: 4,757

Re: Where statement in proc means

Logically, it is not possible for FIRMDEFI to equal 1 and 2 at the same time.  Instead of using AND, your WHERE statement could switch to OR.  Alternatively:

 

where firmdefi in (1, 2);

View solution in original post


All Replies
Solution
‎03-29-2017 02:36 AM
Respected Advisor
Posts: 4,757

Re: Where statement in proc means

Logically, it is not possible for FIRMDEFI to equal 1 and 2 at the same time.  Instead of using AND, your WHERE statement could switch to OR.  Alternatively:

 

where firmdefi in (1, 2);

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 94 views
  • 1 like
  • 2 in conversation