DATA Step, Macro, Functions and more

SAS set where=?

Accepted Solution Solved
Reply
Contributor
Posts: 38
Accepted Solution

SAS set where=?

Hi,

 

How would I use a set statement with where= options to make a condition of  where is "not equal to" x. More precisely:

 

data file1;

   set libref.file2 (where(var 2 is not equal to 0) keep var1 var2 var3;

run;

 

I know this is basic but would it be something like where(var2=! 0.))

 

Thanks for any help you may give!


Accepted Solutions
Solution
‎05-16-2016 11:59 AM
Respected Advisor
Posts: 3,777

Re: SAS set where=?

The proper syntax is

 

where=(var2 NE 0)

 

or you could use ^= but I like mnemonics.

 

View solution in original post


All Replies
Solution
‎05-16-2016 11:59 AM
Respected Advisor
Posts: 3,777

Re: SAS set where=?

The proper syntax is

 

where=(var2 NE 0)

 

or you could use ^= but I like mnemonics.

 

Contributor
Posts: 38

Re: SAS set where=?

Thanks so much!
☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 366 views
  • 0 likes
  • 2 in conversation