[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 &lt;<a \
href="mailto:00000a500572f1ba-dmarc-request@listserv.uga.edu">00000a500572f1ba-dmarc-request@listserv.uga.edu</a>&gt; \
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">&gt; and a.year between \
2005 and 2023 and State=&#39;AZ&#39; 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:&#39;Helvetica \
Neue&#39;,Helvetica,Arial,sans-serif;font-size:13px;color:#26282a">  
                <div>
                    On Wednesday, January 18, 2023 at 11:04:41 AM EST, Tim Berryhill \
&lt;<a href="mailto:000008c2afdd9bfa-dmarc-request@listserv.uga.edu" \
target="_blank">000008c2afdd9bfa-dmarc-request@listserv.uga.edu</a>&gt; 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">&gt; Sorry I messed up during \
copy/paste..<br></div><div dir="ltr">&gt; This is the code I am running and getting \
the error expression using IN…<br></div><div dir="ltr">&gt;<br></div><div \
dir="ltr">&gt;<br></div><div dir="ltr">&gt; proc sql;<br></div><div dir="ltr">&gt; \
select count (a.med)<br></div><div dir="ltr">&gt; from formal as a<br></div><div \
dir="ltr">&gt; join extensn b<br></div><div dir="ltr">&gt; on a.med \
=b.med<br></div><div dir="ltr">&gt; where (a.med   notin (0)<br></div><div \
dir="ltr">&gt; and a.site1 in (51,02,12,16,18,28,29)<br></div><div dir="ltr">&gt; and \
a.year between 2005 and 2023 and State=&#39;AZ&#39; and a.county in (<br></div><div \
dir="ltr">&gt; &#39;900&#39;,&#39;700&#39;,&#39;100&#39;,&#39;400&#39;,&#39;300&#39;))<br></div><div \
dir="ltr">&gt; or ( a.site3=&#39;999&#39; and a.hist &lt; &#39;9590&#39; and \
State=&#39;AZ&#39; and a.year between<br></div><div dir="ltr">&gt; 2005 and \
2023<br></div><div dir="ltr">&gt; and a.med notin (0)   and a.county in \
(&#39;900&#39;,&#39;700&#39;,&#39;100&#39;,&#39;400&#39;,&#39;300&#39;))    \
;<br></div><div dir="ltr">&gt; quit;<br></div><div dir="ltr">&gt; 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