<?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 Re: want to merge the two datas by year but error says they are different data types. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191273#M48159</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the annual reportdate is annual reportdate. i think the issue is the data type. do u know how i can check them and also align them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Apr 2014 03:01:55 GMT</pubDate>
    <dc:creator>aarony</dc:creator>
    <dc:date>2014-04-24T03:01:55Z</dc:date>
    <item>
      <title>want to merge the two datas by year but error says they are different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191271#M48157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;743&amp;nbsp; proc sql;&lt;/P&gt;&lt;P&gt;744&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table cshk14 as&lt;/P&gt;&lt;P&gt;745&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select a.*, b.*&lt;/P&gt;&lt;P&gt;746&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from cshk13 as a, hk21 as b&lt;/P&gt;&lt;P&gt;747&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where a.isin = b.isin and a.year = b.annualreportdate;&lt;/P&gt;&lt;P&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/P&gt;&lt;P&gt;748&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it seems year in a and annualreportdate in b are different data types. how can i fix this? thank you!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 02:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191271#M48157</guid>
      <dc:creator>aarony</dc:creator>
      <dc:date>2014-04-24T02:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: want to merge the two datas by year but error says they are different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191272#M48158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both comparisons use the equal operator.&amp;nbsp; Review your data and discover the data types of isin in both datasets, as well as year and annualreportdate.&amp;nbsp; Also, while it may not have shown up as an error you received, look at annualreportdate to see if it is a date or a year.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 02:56:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191272#M48158</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-04-24T02:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: want to merge the two datas by year but error says they are different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191273#M48159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the annual reportdate is annual reportdate. i think the issue is the data type. do u know how i can check them and also align them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 03:01:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191273#M48159</guid>
      <dc:creator>aarony</dc:creator>
      <dc:date>2014-04-24T03:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: want to merge the two datas by year but error says they are different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191274#M48160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would start by running proc contents on both files. e.g.,&lt;/P&gt;&lt;P&gt;proc contents data=&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;cshk13&lt;/SPAN&gt;; run;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;proc contents data=&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;hk21&lt;/SPAN&gt;; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 03:13:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191274#M48160</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-04-24T03:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: want to merge the two datas by year but error says they are different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191275#M48161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you arthur for your kind reply.&lt;/P&gt;&lt;P&gt;this is what i get.&lt;/P&gt;&lt;P&gt;&amp;nbsp; AnnualReportDate&amp;nbsp;&amp;nbsp;&amp;nbsp; Char&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp; $12.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $12.&lt;/P&gt;&lt;P&gt;&amp;nbsp; year&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am a begginer user in sas (only 1+week of experience) and do not know how to mitigate this issue. could you let me know? thanks much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 03:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191275#M48161</guid>
      <dc:creator>aarony</dc:creator>
      <dc:date>2014-04-24T03:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: want to merge the two datas by year but error says they are different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191276#M48162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will have to look at the first 10 or so records to see what AnnualReportDate looks like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd run something like the following and let us (the forum) see the result&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;proc print data=hk21 (obs=10);&lt;/P&gt;&lt;P&gt;&amp;nbsp; var AnnualReportDate;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 11:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191276#M48162</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-04-24T11:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: want to merge the two datas by year but error says they are different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191277#M48163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seeing the results of the proc print will be most valuable, but in all likelihood you will need to extract the year from Annual Report Date.&amp;nbsp; Assuming that the annual report date values looks something like 25NOV2013 then I would do something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attrib Report_Year length=8;&lt;/P&gt;&lt;P&gt;AnnualReportDate = right(AnnualReportDate);&lt;/P&gt;&lt;P&gt;Report_Year = substr(AnnualReportDate,9,4);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 16:31:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191277#M48163</guid>
      <dc:creator>djmangen</dc:creator>
      <dc:date>2014-04-24T16:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: want to merge the two datas by year but error says they are different data types.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191278#M48164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm going to wait making any suggestion until aarony shows us what the data look like.&amp;nbsp; Given that it is a 12 character field I wouldn't assume to know what it looks like.&amp;nbsp; And aarony will need to convert it into a number and will be able to do it all within the original proc sql call.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 16:43:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/want-to-merge-the-two-datas-by-year-but-error-says-they-are/m-p/191278#M48164</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-04-24T16:43:16Z</dc:date>
    </item>
  </channel>
</rss>

