<?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: update multiple columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/update-multiple-columns/m-p/464506#M285109</link>
    <description>&lt;P&gt;You can by using DO END;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data weight;

  set weight;

     if WeightLoss2&amp;gt;20 then DO;
                           DELETE='Y' ;
                            DEL2='Y';
                          END;

     else DO;
             DELETE='N' ;
             DEL2='N';
           END;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 23 May 2018 18:33:09 GMT</pubDate>
    <dc:creator>SuryaKiran</dc:creator>
    <dc:date>2018-05-23T18:33:09Z</dc:date>
    <item>
      <title>update multiple columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-multiple-columns/m-p/464504#M285108</link>
      <description>&lt;P&gt;i have some code here...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data weight;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input IDNUMBER $ Week1 Week2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WeightLoss2=Week1-Week2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;2477 195 163&lt;/P&gt;&lt;P&gt;2431 220 198&lt;/P&gt;&lt;P&gt;2456 173 155&lt;/P&gt;&lt;P&gt;2412 135 116&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;alter table weight add DELETE char(2), DEL2&amp;nbsp; char(2);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data weight;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set weight;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if WeightLoss2&amp;gt;20 then DELETE='Y';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else DELETE='N';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=weight;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;okay, so this code clearly creates a table and conditionally updates it.&amp;nbsp; notice i create two tables.&amp;nbsp; when i run the update, is it possible to update two columns at once either to the same value or another?&amp;nbsp; so...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data weight;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set weight;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if WeightLoss2&amp;gt;20 then DELETE='Y' and DEL2='Y';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else DELETE='N' and DEL2='N';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 18:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-multiple-columns/m-p/464504#M285108</guid>
      <dc:creator>me55</dc:creator>
      <dc:date>2018-05-23T18:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: update multiple columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-multiple-columns/m-p/464506#M285109</link>
      <description>&lt;P&gt;You can by using DO END;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data weight;

  set weight;

     if WeightLoss2&amp;gt;20 then DO;
                           DELETE='Y' ;
                            DEL2='Y';
                          END;

     else DO;
             DELETE='N' ;
             DEL2='N';
           END;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 May 2018 18:33:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-multiple-columns/m-p/464506#M285109</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-05-23T18:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: update multiple columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-multiple-columns/m-p/464532#M285111</link>
      <description>yeah, right. thanks...</description>
      <pubDate>Wed, 23 May 2018 19:05:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-multiple-columns/m-p/464532#M285111</guid>
      <dc:creator>me55</dc:creator>
      <dc:date>2018-05-23T19:05:12Z</dc:date>
    </item>
  </channel>
</rss>

