[prev in list] [next in list] [prev in thread] [next in thread]
List: sas-l
Subject: Re: . ERROR: Expression using IN has components that are of different data
From: fay us <oneandonlyoneworld () GMAIL ! COM>
Date: 2023-01-18 16:43:21
Message-ID: CAGyLb1p-N2un1ubPoqUpyummZ4be-OGF4LEySjc1yVTkewcmqg () mail ! gmail ! com
[Download RAW message or body]
I took care of year and worked!
also changing notin (0) to notin ‘0' worked.
Thanks a lot !!
On Wed, Jan 18, 2023 at 11:36 AM Nat Wooding <
00000a500572f1ba-dmarc-request@listserv.uga.edu> wrote:
> Year is referenced two lines, one of them being
> > and a.year between 2005 and 2023 and State='AZ' and a.county in (
>
> It is being treated as a number but her output indicates that it is stored
> as a character.
>
> On Wednesday, January 18, 2023 at 11:04:41 AM EST, Tim Berryhill <
> 000008c2afdd9bfa-dmarc-request@listserv.uga.edu> wrote:
>
>
> Not obvious to me. Nat may have it. I am pretty sure I use not in (with
> a space) rather than notin, but SAS accepts many things. One way to
> approach a problem like this is to run the query with just part of the
> WHERE clause and see what is the smallest portion which still generates the
> error.
> Happy Hunting
> Tim
> -----Original Message-----
>
> > Sorry I messed up during copy/paste..
> > This is the code I am running and getting the error expression using IN…
> >
> >
> > proc sql;
> > select count (a.med)
> > from formal as a
> > join extensn b
> > on a.med =b.med
> > where (a.med notin (0)
> > and a.site1 in (51,02,12,16,18,28,29)
> > and a.year between 2005 and 2023 and State='AZ' and a.county in (
> > '900','700','100','400','300'))
> > or ( a.site3='999' and a.hist < '9590' and State='AZ' and a.year between
> > 2005 and 2023
> > and a.med notin (0) and a.county in ('900','700','100','400','300')) ;
> > quit;
> > run;
>
>
[Attachment #3 (text/html)]
<div><br></div><div dir="auto">I took care of year and worked!</div><div \
dir="auto">also changing notin (0) to notin ‘0' worked.</div><div dir="auto">Thanks \
a lot !!<br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On \
Wed, Jan 18, 2023 at 11:36 AM Nat Wooding <<a \
href="mailto:00000a500572f1ba-dmarc-request@listserv.uga.edu">00000a500572f1ba-dmarc-request@listserv.uga.edu</a>> \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div \
style="font-family:Helvetica \
Neue,Helvetica,Arial,sans-serif;font-size:13px"><div></div> <div dir="ltr">Year is \
referenced two lines, one of them being</div><div dir="ltr"><span><span \
style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif">> and a.year between \
2005 and 2023 and State='AZ' and a.county in (</span></span><br></div><div \
dir="ltr"><span><span style="font-family:Helvetica \
Neue,Helvetica,Arial,sans-serif"><br></span></span></div><div dir="ltr"><span><span \
style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif">It is being treated as \
a number but her output indicates that it is stored as a \
character.</span></span></div><div><br></div>
</div></div><div><div \
id="m_-4513712368364944563ydpbce57620yahoo_quoted_4462966999">
<div style="font-family:'Helvetica \
Neue',Helvetica,Arial,sans-serif;font-size:13px;color:#26282a">
<div>
On Wednesday, January 18, 2023 at 11:04:41 AM EST, Tim Berryhill \
<<a href="mailto:000008c2afdd9bfa-dmarc-request@listserv.uga.edu" \
target="_blank">000008c2afdd9bfa-dmarc-request@listserv.uga.edu</a>> wrote: \
</div> <div><br></div>
<div><br></div>
<div><div dir="ltr">Not obvious to me. Nat may have it. I am \
pretty sure I use not in (with a space) rather than notin, but SAS accepts many \
things. One way to approach a problem like this is to run the query with just part \
of the WHERE clause and see what is the smallest portion which still generates the \
error.<br></div><div dir="ltr">Happy Hunting<br></div><div \
dir="ltr">Tim<br></div><div dir="ltr">-----Original Message-----<br></div><div \
dir="ltr"><br></div><div dir="ltr">> Sorry I messed up during \
copy/paste..<br></div><div dir="ltr">> This is the code I am running and getting \
the error expression using IN…<br></div><div dir="ltr">><br></div><div \
dir="ltr">><br></div><div dir="ltr">> proc sql;<br></div><div dir="ltr">> \
select count (a.med)<br></div><div dir="ltr">> from formal as a<br></div><div \
dir="ltr">> join extensn b<br></div><div dir="ltr">> on a.med \
=b.med<br></div><div dir="ltr">> where (a.med notin (0)<br></div><div \
dir="ltr">> and a.site1 in (51,02,12,16,18,28,29)<br></div><div dir="ltr">> and \
a.year between 2005 and 2023 and State='AZ' and a.county in (<br></div><div \
dir="ltr">> '900','700','100','400','300'))<br></div><div \
dir="ltr">> or ( a.site3='999' and a.hist < '9590' and \
State='AZ' and a.year between<br></div><div dir="ltr">> 2005 and \
2023<br></div><div dir="ltr">> and a.med notin (0) and a.county in \
('900','700','100','400','300')) \
;<br></div><div dir="ltr">> quit;<br></div><div dir="ltr">> run;<br></div><div \
dir="ltr"><br></div></div> </div>
</div></div></blockquote></div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic