<?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: Creating a New Variable Based on Old in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-New-Variable-Based-on-Old/m-p/541256#M74121</link>
    <description>&lt;P&gt;This should do the trick:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if upcase(outcome_name) = 'TEST2' then newvar=result;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Mar 2019 22:21:18 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-03-07T22:21:18Z</dc:date>
    <item>
      <title>Creating a New Variable Based on Old</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-New-Variable-Based-on-Old/m-p/541253#M74120</link>
      <description>&lt;P&gt;Hello. &amp;nbsp;I'm new to SAS. &amp;nbsp;I have a seemingly easy question but none of the conventional "create new variables" rules&lt;/P&gt;&lt;P&gt;seem to apply directly. &amp;nbsp;Details below. &amp;nbsp;I created a mini dataset to illustrate. &amp;nbsp;Thank you! Anissa&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First column has different types of tests - text format. &amp;nbsp;Second column has results - numeric. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want a third column with numeric value from column two, but only when column 1 is Test2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;OUTCOME NAME&lt;/TD&gt;&lt;TD&gt;RESULT&lt;/TD&gt;&lt;TD&gt;New Variable with TEST 2 only?&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&gt;&lt;TD&gt;TEST1&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TEST2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TEST3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TEST2&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TEST4&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 07 Mar 2019 22:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-New-Variable-Based-on-Old/m-p/541253#M74120</guid>
      <dc:creator>anissak1</dc:creator>
      <dc:date>2019-03-07T22:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a New Variable Based on Old</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-New-Variable-Based-on-Old/m-p/541256#M74121</link>
      <description>&lt;P&gt;This should do the trick:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if upcase(outcome_name) = 'TEST2' then newvar=result;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Mar 2019 22:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-New-Variable-Based-on-Old/m-p/541256#M74121</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-03-07T22:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a New Variable Based on Old</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-New-Variable-Based-on-Old/m-p/541259#M74122</link>
      <description>&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; want&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; have&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;upcase&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;outcome_name&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'TEST2'&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; newvar&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;result&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 22:48:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-New-Variable-Based-on-Old/m-p/541259#M74122</guid>
      <dc:creator>anissak1</dc:creator>
      <dc:date>2019-03-07T22:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a New Variable Based on Old</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-New-Variable-Based-on-Old/m-p/541265#M74123</link>
      <description>&lt;P&gt;hI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/264621"&gt;@anissak1&lt;/a&gt;&amp;nbsp; &amp;nbsp;Welcome to SAS communities. I am afraid you accidentally marked your thank you comment as the solution. Please switch to the correct solution. Have a good time here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 22:46:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-New-Variable-Based-on-Old/m-p/541265#M74123</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-07T22:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a New Variable Based on Old</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-New-Variable-Based-on-Old/m-p/541270#M74126</link>
      <description>Thank you for letting me know.&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Mar 2019 22:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-New-Variable-Based-on-Old/m-p/541270#M74126</guid>
      <dc:creator>anissak1</dc:creator>
      <dc:date>2019-03-07T22:50:22Z</dc:date>
    </item>
  </channel>
</rss>

