<?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: data merge question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838829#M331670</link>
    <description>&lt;P&gt;In the SQL procedure, you can use functions in the ON clause of a JOIN, so you can do the conversion there "on the fly".&lt;/P&gt;
&lt;P&gt;For a data step MERGE, you need to first run a conversion step before you sort and merge.&lt;/P&gt;
&lt;P&gt;How you do that depends on how the data is stored as character. I recommend to convert the numbers to character, as key values are always better stored as character.&lt;/P&gt;</description>
    <pubDate>Sat, 15 Oct 2022 17:29:33 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-10-15T17:29:33Z</dc:date>
    <item>
      <title>data merge question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838773#M331643</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i have this 2 data sets to merge one full and only&amp;nbsp; 'common'&amp;nbsp; records from another data set.&lt;/P&gt;&lt;P&gt;i have used :&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; merge1;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;merge&lt;/SPAN&gt; FY1.H181 (&lt;SPAN class=""&gt;in&lt;/SPAN&gt;=x) MCF.H180 (&lt;SPAN class=""&gt;in&lt;/SPAN&gt;=y);&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;by&lt;/SPAN&gt; duid;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt; (x=&lt;SPAN class=""&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I did this after sorting using proc sort.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;it gives me an error&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;"&lt;/SPAN&gt;Variable DUID has been defined as both character and numeric"&lt;/P&gt;&lt;P class=""&gt;but that variable has only numeric in the dataset.&lt;/P&gt;&lt;P class=""&gt;can you please help me resolve thsi.&lt;/P&gt;&lt;P class=""&gt;thanks&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2022 04:04:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838773#M331643</guid>
      <dc:creator>stellapersis7</dc:creator>
      <dc:date>2022-10-15T04:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: data merge question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838776#M331646</link>
      <description>&lt;P&gt;What the log says: duid is character in one dataset, and numeric in the other.&lt;/P&gt;
&lt;P&gt;Run PROC CONTENTS for each dataset and look at the output.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2022 04:53:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838776#M331646</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-10-15T04:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: data merge question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838825#M331666</link>
      <description>&lt;P&gt;HI thank you,&lt;/P&gt;&lt;P&gt;I did contents and yes, it has both charater and numeric like "prstx15".&lt;/P&gt;&lt;P&gt;now, how do i merge both datasets when it gives this error?&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2022 16:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838825#M331666</guid>
      <dc:creator>stellapersis7</dc:creator>
      <dc:date>2022-10-15T16:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: data merge question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838826#M331667</link>
      <description>HI thank you,&lt;BR /&gt;I did contents and yes, it has both charater and numeric&lt;BR /&gt;now, how do i merge both datasets when it gives this error?&lt;BR /&gt;thanks in advance</description>
      <pubDate>Sat, 15 Oct 2022 16:09:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838826#M331667</guid>
      <dc:creator>stellapersis7</dc:creator>
      <dc:date>2022-10-15T16:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: data merge question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838827#M331668</link>
      <description>&lt;P&gt;You need to make duid the same type in both datasets. Either make them both numeric or both character.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2022 16:41:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838827#M331668</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2022-10-15T16:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: data merge question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838829#M331670</link>
      <description>&lt;P&gt;In the SQL procedure, you can use functions in the ON clause of a JOIN, so you can do the conversion there "on the fly".&lt;/P&gt;
&lt;P&gt;For a data step MERGE, you need to first run a conversion step before you sort and merge.&lt;/P&gt;
&lt;P&gt;How you do that depends on how the data is stored as character. I recommend to convert the numbers to character, as key values are always better stored as character.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2022 17:29:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-merge-question/m-p/838829#M331670</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-10-15T17:29:33Z</dc:date>
    </item>
  </channel>
</rss>

