<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ERROR: Expression using IN has components that are of different data types. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338717#M77189</link>
    <description />
    <pubDate>Tue, 07 Mar 2017 08:57:41 GMT</pubDate>
    <dc:creator>nid197</dc:creator>
    <dc:date>2017-03-07T08:57:41Z</dc:date>
    <item>
      <title>ERROR: Expression using IN has components that are of different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338717#M77189</link>
      <description />
      <pubDate>Tue, 07 Mar 2017 08:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338717#M77189</guid>
      <dc:creator>nid197</dc:creator>
      <dc:date>2017-03-07T08:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Expression using IN has components that are of different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338721#M77190</link>
      <description>&lt;P&gt;The message says it all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get real help, post the log (step and messages), and information about the data involved. Output from proc contents comes to mind.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 09:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338721#M77190</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-07T09:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Expression using IN has components that are of different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338722#M77191</link>
      <description>&lt;P&gt;SAS has two data types : character and numeric.When making a comparison, the variable has to be of the same&lt;/P&gt;
&lt;P&gt;type than your list of values.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 09:04:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338722#M77191</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2017-03-07T09:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Expression using IN has components that are of different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338723#M77192</link>
      <description>&lt;P&gt;&lt;BR /&gt;22 GOPTIONS ACCESSIBLE;&lt;BR /&gt;23 /*%let status_date_start='2016-12-01';&lt;BR /&gt;24 %let status_date_end='2016-12-31';*/&lt;BR /&gt;25&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;26 proc sql;&lt;BR /&gt;27 create table adhoc_wl_new as&lt;BR /&gt;28 select&lt;BR /&gt;29 a.jrn_flag,&lt;BR /&gt;30 a.wr_no,&lt;BR /&gt;31 b.WR_RFA_NO,&lt;BR /&gt;32 a.entry_date,&lt;BR /&gt;33 a.status_date,&lt;BR /&gt;34 a.close_std_date,&lt;BR /&gt;35 a.business_category,&lt;BR /&gt;36 a.place_id,&lt;BR /&gt;37 a.company_code,&lt;BR /&gt;38 a.postal_dist,&lt;BR /&gt;39 a.prime_rfa_no,&lt;BR /&gt;40 a.region_code,&lt;BR /&gt;41 a.operating_district_code,&lt;BR /&gt;42 a.cc_sent,&lt;BR /&gt;43 a.hdis_status_date,&lt;BR /&gt;44 b.previous_wr_no,&lt;BR /&gt;45 b.previous_wr_rfa_no,&lt;BR /&gt;46 b.prev_field_component_vst_seq,&lt;BR /&gt;47 b.ACTN_TYPE_CODE as Action_Type,&lt;BR /&gt;48 b.OBJ_TYPE_CODE as Appliance_Name,&lt;BR /&gt;49 b.APP_CON_TYPE_CODE as LOS,&lt;BR /&gt;50 b.JOB_STATUS_CODE,&lt;BR /&gt;51 c.visit_activity_code,&lt;BR /&gt;52 c.wr_rfa_no,&lt;BR /&gt;53 c.wr_no,&lt;BR /&gt;54 c.product_group_code,&lt;BR /&gt;2 The SAS System 08:21 Tuesday, March 7, 2017&lt;/P&gt;&lt;P&gt;55 c.visit_activity_code,&lt;BR /&gt;56 count(c.acty_cmpnent_vst_status_code) as count_act,&lt;BR /&gt;57 max(c.acty_cmpnent_vst_date) as actvst_dt,&lt;BR /&gt;58 sum(input(c.acv_duration,6.)) as acv_duration&lt;BR /&gt;59&lt;BR /&gt;60 /*SUBSTR(a.status_date,1,10) as newdate*/&lt;BR /&gt;61&lt;BR /&gt;62 from hdp_phc.WMIS_WORK_REQUEST a inner join hdp_phc.WMIS_WR_RFA b&lt;BR /&gt;63 on(a.wr_no=b.wr_no)&lt;BR /&gt;64 and a.jrn_flag = b.jrn_flag&lt;BR /&gt;65 and a.jrn_flag = 'ORIGINAL'&lt;BR /&gt;66&lt;BR /&gt;67 left join hdp_phc.WMIS_ACTIVITY_COMPONENT_VISIT c&lt;BR /&gt;68 on c.wr_no = a.wr_no&lt;BR /&gt;69 and c.WR_RFA_NO = b.WR_RFA_NO&lt;BR /&gt;70 and c.jrn_flag = a.jrn_flag&lt;BR /&gt;71&lt;BR /&gt;72 where a.WR_NO in&lt;BR /&gt;73 ('1300085728','1300001528','1300001828','1300002528','1300002728')&lt;BR /&gt;74 and date(input(status_date,10.)) between '2016-12-01' and '2016-12-31'&lt;BR /&gt;75 /*and date(status_date) between &amp;amp;status_date_start and &amp;amp;status_date_end&lt;BR /&gt;76 /*and newdate between "2016-12-01" and "2016-12-31"*/&lt;BR /&gt;77 /*and a.status_date between "2016-12-01:23:59:59:0"dt and "2016-12-31:23:59:59:0"dt*/&lt;BR /&gt;78&lt;BR /&gt;79 group by 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27;&lt;BR /&gt;WARNING: Function DATE requires at most 0 argument(s). The extra one(s) will be ignored.&lt;BR /&gt;ERROR: Expression using IN has components that are of different data types.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 09:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338723#M77192</guid>
      <dc:creator>nid197</dc:creator>
      <dc:date>2017-03-07T09:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Expression using IN has components that are of different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338726#M77194</link>
      <description>&lt;P&gt;I'm going out on a limb here, but my guess is that wr_no is numeric, which you can't compare to character constants.&lt;/P&gt;
&lt;P&gt;For the second error, it seems like you are mixing SAS and non SAS SQL function.&lt;/P&gt;
&lt;P&gt;Date function will give you today's&amp;nbsp;date.&lt;/P&gt;
&lt;P&gt;There are two other ways to accomplish your task in SAS:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Use SAS date constants using the d literal: '01Dec2016'd. The no need to tamper with your date column.&lt;/LI&gt;
&lt;LI&gt;Use put(status_date,yymmdd10.) to make&amp;nbsp;you date column comparable&amp;nbsp;to your date style constants. I would say that this is the least preferable&amp;nbsp;option from a performance perspective at least.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 07 Mar 2017 09:14:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338726#M77194</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-03-07T09:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Expression using IN has components that are of different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338730#M77196</link>
      <description>&lt;P&gt;i had already tried your solution ie.&lt;SPAN&gt; '01Dec2016'd but it is still not working.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and wr_no error has occured just after i had used the date condition earlier it was working fine by extracting the required data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 09:25:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338730#M77196</guid>
      <dc:creator>nid197</dc:creator>
      <dc:date>2017-03-07T09:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Expression using IN has components that are of different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338734#M77198</link>
      <description>&lt;P&gt;It is quite clear from the text you give from the log:&lt;/P&gt;
&lt;P&gt;72 where a.WR_NO in&lt;BR /&gt;73 ('1300085728','1300001528','1300001828','1300002528','1300002728')&lt;BR /&gt;ERROR: Expression using IN has components that are of different data types.&lt;/P&gt;
&lt;P&gt;This error is telling you that the varible - and this might be key as in the select you take C.wr_no - that A.wr_no is numeric and the in list you give is character, therefore it cannot compare. &amp;nbsp;Maye you meant to use c.wr_no for this if that is character, or may you need put(a.wr_no,best.) in().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;74 and date(input(status_date,10.)) between '2016-12-01' and '2016-12-31'&lt;/P&gt;
&lt;P&gt;WARNING: Function DATE requires at most 0 argument(s). The extra one(s) will be ignored.&lt;/P&gt;
&lt;P&gt;The above warning is telling you that SAS has a function called date(), and that that function does not have any parameters - all it does it to return todays date. &amp;nbsp;You are mixing this up with a database function called date() which probably converts text to date values. &amp;nbsp;To do this calculation you need to use SAS functions:&lt;/P&gt;
&lt;P&gt;and input(status_date,yymmdd10.) between '01DEC2016'd and '31DEC2016'd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 09:55:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-Expression-using-IN-has-components-that-are-of-different/m-p/338734#M77198</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-03-07T09:55:02Z</dc:date>
    </item>
  </channel>
</rss>

