<?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: Merge 2 variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348224#M273389</link>
    <description>&lt;P&gt;if the 'number' is null and 'work' has variable, add that variable to the 'number' by 'id'. Is that clear?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2017 17:37:07 GMT</pubDate>
    <dc:creator>user24</dc:creator>
    <dc:date>2017-04-07T17:37:07Z</dc:date>
    <item>
      <title>Merge 2 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348217#M273387</link>
      <description>&lt;P&gt;How can i merge 2 variable if the one ofthem is null&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id &amp;nbsp; &amp;nbsp;work &amp;nbsp; number&lt;/P&gt;
&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;8 &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1-2&lt;/P&gt;
&lt;P&gt;9 &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2-5&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i want to change as if the number is null merge with 'work'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id &amp;nbsp; &amp;nbsp;work &amp;nbsp; number&lt;/P&gt;
&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;8 &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1-2&lt;/P&gt;
&lt;P&gt;9 &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2-5&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 17:22:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348217#M273387</guid>
      <dc:creator>user24</dc:creator>
      <dc:date>2017-04-07T17:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Merge 2 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348221#M273388</link>
      <description>&lt;P&gt;Do you have any code that you're currently trying? It's not clear to me if you want to merge on all three variables or just the first two and you want to figure out how to deal with third.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 17:33:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348221#M273388</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-04-07T17:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Merge 2 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348224#M273389</link>
      <description>&lt;P&gt;if the 'number' is null and 'work' has variable, add that variable to the 'number' by 'id'. Is that clear?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 17:37:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348224#M273389</guid>
      <dc:creator>user24</dc:creator>
      <dc:date>2017-04-07T17:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Merge 2 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348228#M273390</link>
      <description>&lt;P&gt;Not entirely, but I can be&amp;nbsp;a bit daft. But from what I understand, you could try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if not missing(work) then number = coalescec(number, '0');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 17:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348228#M273390</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-04-07T17:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Merge 2 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348230#M273391</link>
      <description>&lt;P&gt;Or if you mean that you want to populate 'number' with 'work,' you could do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;number = coalescec(number, work);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure about what the variable types are, though.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 17:48:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348230#M273391</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-04-07T17:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Merge 2 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348234#M273392</link>
      <description>&lt;P&gt;I have chracter variable. Also you can think like its left join . i only want to take if the work has variable and number doesn;t have variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id &amp;nbsp; &amp;nbsp;work &amp;nbsp; number&lt;/P&gt;
&lt;P&gt;11 &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;12 &amp;nbsp;&lt;/P&gt;
&lt;P&gt;13 &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;15 &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1-2&lt;/P&gt;
&lt;P&gt;16 &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2-3&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So i have the table without red variables. I want the table with red variables&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 17:55:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348234#M273392</guid>
      <dc:creator>user24</dc:creator>
      <dc:date>2017-04-07T17:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Merge 2 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348240#M273393</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines dsd;
input id work $ number $;
datalines;
11, 2,       
12, ,   
13, 3,
15, 1, 1-2
16, 2, 2-3&amp;nbsp;
;

data want;
    set have;
    number = coalescec(number, work);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 18:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348240#M273393</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-04-07T18:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Merge 2 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348272#M273394</link>
      <description>&lt;P&gt;Isn't this simply:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if number = ' ' then number = work;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 19:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-2-variables/m-p/348272#M273394</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-07T19:15:15Z</dc:date>
    </item>
  </channel>
</rss>

