| Date: | Wed, 18 Jul 2007 14:30:02 -0400 |
| Reply-To: | Sigurd Hermansen <HERMANS1@WESTAT.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Sigurd Hermansen <HERMANS1@WESTAT.COM> |
| Subject: | Re: Proc Sql.. want to use or.. but doens't work! |
|
| In-Reply-To: | <200707180304.l6I0usOX025614@mailgw.cc.uga.edu> |
| Content-Type: | text/plain; charset="us-ascii" |
J:
Let me add a few comments to the good advice that you have already
received. Missing and NULL values in SAS cause the same mischief that
they cause elsewhere in the database programming world. Repeating groups
of variables and other sins in the normalized database religion create
missing and NULL values as placeholders. In my opinion, too much time
goes into managing them.
In SAS SQL and most other flavors, the logical expression 'var IS NULL'
evaluates as TRUE when var has a missing or null value and 'NOT var IS
NULL' has the opposite value for the same value of variable var. This
form of logical expression evaluates different data types equally well.
Of course beware of comparisons of NULL values in SQL. var=var evaluates
to NULL when var IS NULL, not TRUE. var^=var also evaluates to NULL when
var IS NULL, not to FALSE as you might expect. This trinary logic has
its uses and pitfalls.
S
-----Original Message-----
From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu]
On Behalf Of J
Sent: Tuesday, July 17, 2007 11:04 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Proc Sql.. want to use or.. but doens't work!
I want to use the following proc sql
libname mylib '\\somedirectory\folder\';
proc sql;
create table mylib.output as
select * from mylib.dataset
where variable1 = '.'
or variable2 = '.'
or variable3 ='.';
quit;
Is there anything I can do where I can create a dataset w/ or operators?
|