Help using Base SAS procedures

Not include?

Accepted Solution Solved
Reply
Contributor
Posts: 58
Accepted Solution

Not include?

So this might be a simple and basic question, but I can't find an answer from searching online

if Var1 in (1 2 3) then var2=1;

so in the code above the IN is include. But is there one that is "not include"?  Typically I would not use this on a if statement, but more of a where statement when running a proc freq for example. I know I can do Var1 NE 0 AND VAR1 NE 4 for example, but wondering if there is a way to list it like I did above


Accepted Solutions
Solution
‎10-30-2013 02:24 PM
Super Contributor
Posts: 282

Re: Not include?

Hi,

Have you tried:

data _null_;

  var1=5;

  if var1 not in (1 2 3) then var2=1;

  put var2=;

run;

Regards,

Amir.

View solution in original post


All Replies
Solution
‎10-30-2013 02:24 PM
Super Contributor
Posts: 282

Re: Not include?

Hi,

Have you tried:

data _null_;

  var1=5;

  if var1 not in (1 2 3) then var2=1;

  put var2=;

run;

Regards,

Amir.

☑ This topic is SOLVED.

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

Discussion stats
  • 1 reply
  • 171 views
  • 0 likes
  • 2 in conversation