<?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: problem in merging two files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/problem-in-merging-two-files/m-p/571163#M161112</link>
    <description>&lt;P&gt;The variable year is character in one of your data sets and numeric in the other. Convert it to numeric in the data set where it is character before you merge.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use PROC CONTENTS to identify&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2019 07:30:04 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-07-04T07:30:04Z</dc:date>
    <item>
      <title>problem in merging two files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-in-merging-two-files/m-p/571162#M161111</link>
      <description>&lt;P&gt;i have to merge two files by two variables company and year. when i tried it in SAS, it was not successful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;then i created a new variable by combining the values of both company and year and naming it has "compyear".&lt;/P&gt;&lt;P&gt;it worked for one time. next time, when it tried the same procedure, I am facing the following problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;209 data master_fil4;&lt;BR /&gt;210 merge Master_file_latest&amp;nbsp; &amp;nbsp; &amp;nbsp;Ta__new; by compyear;&lt;BR /&gt;ERROR: Variable year has been defined as both character and numeric.&lt;BR /&gt;211 run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am not using variable 'year' in merging the files, i am using only 'compyear'&lt;/P&gt;&lt;P&gt;kindly help me in solving this problem.&lt;/P&gt;&lt;P&gt;thanks in advance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 07:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-in-merging-two-files/m-p/571162#M161111</guid>
      <dc:creator>srikanthyadav44</dc:creator>
      <dc:date>2019-07-04T07:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: problem in merging two files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-in-merging-two-files/m-p/571163#M161112</link>
      <description>&lt;P&gt;The variable year is character in one of your data sets and numeric in the other. Convert it to numeric in the data set where it is character before you merge.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use PROC CONTENTS to identify&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 07:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-in-merging-two-files/m-p/571163#M161112</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-07-04T07:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: problem in merging two files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/problem-in-merging-two-files/m-p/571164#M161113</link>
      <description>&lt;P&gt;Maxim 3: &lt;STRONG&gt;Know Your Data&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Before merging, make sure that the only variable(s) present in both (or all, if you merge more than two) datasets are those in the by statement.&lt;/P&gt;
&lt;P&gt;Having others in common leads to largely unpredictable results and is therefore a BAD THING.&lt;/P&gt;
&lt;P&gt;Use keep= or drop= dataset options to exclude variables you do not want, or use a rename= dataset option for renaming, so the variables can exist in parallel in the body of the data step, where you can decide what to do with the values.&lt;/P&gt;
&lt;P&gt;Also have an eye on the relationship with regards to the by variables. Data step merge is not good for many-to-many relationships, it's best for one-to-one or one-to-many.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 07:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/problem-in-merging-two-files/m-p/571164#M161113</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-04T07:36:01Z</dc:date>
    </item>
  </channel>
</rss>

