SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

setting a table conditional on string variable

Accepted Solution Solved
Reply
Super Contributor
Posts: 441
Accepted Solution

setting a table conditional on string variable

hi,

suppose I have the following table:

sectorcompany
Aaa
Bbb
Ccc
Ddd

I want to set the table but drop all the entries where the sector is either A or B and get the following:

sectorcompany
Ccc
Ddd

It is probably a simple task but when I run the following code I still can't get the answer:

data table;

set table;

if sector ne  "A" or sector ne  "B" ;

run;

Thank you!


Accepted Solutions
Solution
‎05-15-2015 11:29 AM
Super User
Posts: 10,041

Re: setting a table conditional on string variable

If I was right.

if sector ne  "A" and sector ne  "B" ;



if sector  not in  ('A' 'B')  ;



View solution in original post


All Replies
Solution
‎05-15-2015 11:29 AM
Super User
Posts: 10,041

Re: setting a table conditional on string variable

If I was right.

if sector ne  "A" and sector ne  "B" ;



if sector  not in  ('A' 'B')  ;



🔒 This topic is solved and locked.

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

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