<?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: Create a new variable keeping values from 2 different variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-keeping-values-from-2-different-variables/m-p/526480#M73540</link>
    <description>&lt;P&gt;To do this in a SQL query, use a case expression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case when survey_year=5 then mean(A) else mean(B) end as yearMean&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 11 Jan 2019 20:23:12 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2019-01-11T20:23:12Z</dc:date>
    <item>
      <title>Create a new variable keeping values from 2 different variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-keeping-values-from-2-different-variables/m-p/526405#M73537</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have var A and Var B and using those two I would like to create a combine variable using the value for either A or B depending on the survey year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, if survey year=5 then combine variable= values in variable A&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if survey year 6 then combine variable= values in variable B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help in advance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 16:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-keeping-values-from-2-different-variables/m-p/526405#M73537</guid>
      <dc:creator>epi101</dc:creator>
      <dc:date>2019-01-11T16:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new variable keeping values from 2 different variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-keeping-values-from-2-different-variables/m-p/526471#M73539</link>
      <description>When you say combine, do you mean concatenate?  Are the current values text or numeric?&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Jan 2019 20:07:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-keeping-values-from-2-different-variables/m-p/526471#M73539</guid>
      <dc:creator>RyanK</dc:creator>
      <dc:date>2019-01-11T20:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new variable keeping values from 2 different variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-keeping-values-from-2-different-variables/m-p/526480#M73540</link>
      <description>&lt;P&gt;To do this in a SQL query, use a case expression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case when survey_year=5 then mean(A) else mean(B) end as yearMean&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Jan 2019 20:23:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-keeping-values-from-2-different-variables/m-p/526480#M73540</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-01-11T20:23:12Z</dc:date>
    </item>
  </channel>
</rss>

