<?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  variables from save file to new variable and include in same file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406663#M99049</link>
    <description>&lt;P&gt;Thanks for the quickk reply. Using the following code it does not seem to merge.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;set have;&lt;BR /&gt;merge var1 var2 var3;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How does the merge happen and where does it go? This should be a trivial operation. I need to merge/combine multiple variables of the same format and equal length for vbar plotting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I'm not clear on why the CAT's need to be used..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2017 17:45:03 GMT</pubDate>
    <dc:creator>capam</dc:creator>
    <dc:date>2017-10-23T17:45:03Z</dc:date>
    <item>
      <title>merge  variables from save file to new variable and include in same file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406639#M99035</link>
      <description>&lt;P&gt;I'm attemptine to merge several variables together and create a new merged variable for plotting. The&amp;nbsp; simple concept is below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;merge varr1 var2 ... into varnew;&lt;/P&gt;&lt;P&gt;run';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=have;&lt;/P&gt;&lt;P&gt;vbar varnew;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 17:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406639#M99035</guid>
      <dc:creator>capam</dc:creator>
      <dc:date>2017-10-23T17:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: merge  variables from save file to new variable and include in same file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406640#M99036</link>
      <description>&lt;P&gt;The var1 var2 etc have the same format and length.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 17:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406640#M99036</guid>
      <dc:creator>capam</dc:creator>
      <dc:date>2017-10-23T17:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: merge  variables from save file to new variable and include in same file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406644#M99039</link>
      <description>&lt;P&gt;merging data sets uses a MERGE statement.&amp;nbsp;&lt;BR /&gt;If you're trying to combine variables use a CAT type formula.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CATX() will concatenate variables with a delimiter, CATT() is another option.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 17:10:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406644#M99039</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-23T17:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: merge  variables from save file to new variable and include in same file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406663#M99049</link>
      <description>&lt;P&gt;Thanks for the quickk reply. Using the following code it does not seem to merge.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;set have;&lt;BR /&gt;merge var1 var2 var3;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How does the merge happen and where does it go? This should be a trivial operation. I need to merge/combine multiple variables of the same format and equal length for vbar plotting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I'm not clear on why the CAT's need to be used..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 17:45:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406663#M99049</guid>
      <dc:creator>capam</dc:creator>
      <dc:date>2017-10-23T17:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: merge  variables from save file to new variable and include in same file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406670#M99053</link>
      <description>&lt;P&gt;Also, is merge the proper approach to this problem?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 18:04:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406670#M99053</guid>
      <dc:creator>capam</dc:creator>
      <dc:date>2017-10-23T18:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: merge  variables from save file to new variable and include in same file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406672#M99054</link>
      <description>&lt;P&gt;It is trivial, I don't think you understand the MERGE statement. It's intended to merge DATA SETS not variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post sample data if you need further assistance. CAT will combine variables into a single variable, which is what you seem to want. But it may not be the case, which is why you need to post data if you need further help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;new_variable= catt(var1, var2, var3);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Oct 2017 18:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406672#M99054</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-23T18:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: merge  variables from save file to new variable and include in same file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406676#M99056</link>
      <description>&lt;P&gt;The input columns look like the below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR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&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this is clearer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 18:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406676#M99056</guid>
      <dc:creator>capam</dc:creator>
      <dc:date>2017-10-23T18:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: merge  variables from save file to new variable and include in same file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406686#M99059</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;New_Var = CoalesceC(var1, var2, var3);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Oct 2017 18:32:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-variables-from-save-file-to-new-variable-and-include-in/m-p/406686#M99059</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-23T18:32:47Z</dc:date>
    </item>
  </channel>
</rss>

