LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2001, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 29 Jun 2001 08:49:08 -0700
Reply-To:   "Huang, Ya" <ya.huang@AGOURON.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Huang, Ya" <ya.huang@AGOURON.COM>
Subject:   Re: Excluding list of values efficiently?
Comments:   To: "Metz, Seymour" <smetz@NSF.GOV>
Content-Type:   multipart/alternative;

> > The construction NOT(RACFUSER IN (. . .)) applies the NOT > operator; the > construction RACFUSER NOT IN (...) does not, and there is > nothing in the SAS > 8 documentation to indicate whether it is supported. The > issue is not the > choice of ~, ^ or NOT, but rather where it is located and > whether extra > parentheses are required. > > > Shmuel (Seymour J.) Metz >

I agree with you. For me the standard use of NOT (as an operator) should be

NOT (racfuser in (...))

just like "NOT (A AND B)" is OK, but "A NOT AND B" is NOT OK, (A AND NOT B is OK though). So if NOT IN does work, I would consider it a new operator.

I knew I can use NOT IN, but I never bother to check manual, I probably learned it from this list.

Since the discussion for this seems to getting hot, I feel it interesting to search SAS Doc and see if on earth there is any say regarding the use of NOT IN, and here is what I've found in SAS OnlineDoc (CD)

--------------------------- IN Operator

The IN operator, which is a comparison operator, searches for character and numeric values that are equal to one from a list of values. The list of values must be in parentheses, with each character value in quotation marks and separated by either a comma or blank.

For example, suppose you want all sites that are in North Carolina or Texas. You could specify:

where state = 'NC' or state = 'TX'; However, the easier way would be to use the IN operator, which says you want any state in the list:

where state in ('NC','TX');

**** In addition, you can use the NOT logical **** operator to exclude a list. For example, **** where state not in ('CA', 'TN', 'MA');

So SAS did document this operator, at least in V8 Online Doc.

Regards,

Ya Huang


[text/html]


Back to: Top of message | Previous page | Main SAS-L page