<?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 dataset columns based on another dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698570#M213657</link>
    <description>&lt;P&gt;Standard ANSI SQL does this. For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data MASTER; A=0; X=0; Y=0; STATUS='Inactive' ;
data TABLE2; A=0; STATUS2='Active';
run;
proc sql;
  update MASTER
  set X=1,Y=1
  where A in (select unique A from TABLE2 where STATUS2='Active')
    and STATUS='Inactive';  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2020 04:00:37 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-11-13T04:00:37Z</dc:date>
    <item>
      <title>Update dataset columns based on another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698318#M213551</link>
      <description>Hello all,&lt;BR /&gt;I have a master dataset with few hundred columns including columns ID, x ,y and status. I have another dataset table2 that also has columns ID and status2.&lt;BR /&gt;I want to update the column values of x and y on master dataset based on criteria that involves both master and table2 datasets. I am doing this in teradata sql right now.&lt;BR /&gt;&lt;BR /&gt;Update a&lt;BR /&gt;From master a, table2 b&lt;BR /&gt;set x=1,y=1&lt;BR /&gt;where a.status=‘Inactive’&lt;BR /&gt;and b.status2=‘Active’&lt;BR /&gt;&lt;BR /&gt;Can I do the same update with sas datasets?</description>
      <pubDate>Thu, 12 Nov 2020 06:22:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698318#M213551</guid>
      <dc:creator>nickspencer</dc:creator>
      <dc:date>2020-11-12T06:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Update dataset columns based on another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698324#M213555</link>
      <description>&lt;P&gt;I don't see any join criteria here.How is table b used?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 07:31:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698324#M213555</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-12T07:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update dataset columns based on another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698379#M213581</link>
      <description>Chrisnz I missed the join condition on the query. Here is the complete query.&lt;BR /&gt;Update a&lt;BR /&gt;From master a, table2 b&lt;BR /&gt;set x=1,y=1&lt;BR /&gt;where a.ID=b.ID&lt;BR /&gt;and a.status=‘Inactive’&lt;BR /&gt;and b.status2=‘Active’&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Nov 2020 13:40:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698379#M213581</guid>
      <dc:creator>nickspencer</dc:creator>
      <dc:date>2020-11-12T13:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Update dataset columns based on another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698388#M213583</link>
      <description>&lt;P&gt;You can do it with SAS datasets, but if the end result has to be a Teradata table, you best do the update there.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 14:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698388#M213583</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-12T14:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Update dataset columns based on another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698486#M213629</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&lt;BR /&gt;I does not have to be a teradata table. I need the output as a sas dataset.</description>
      <pubDate>Thu, 12 Nov 2020 19:07:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698486#M213629</guid>
      <dc:creator>nickspencer</dc:creator>
      <dc:date>2020-11-12T19:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Update dataset columns based on another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698570#M213657</link>
      <description>&lt;P&gt;Standard ANSI SQL does this. For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data MASTER; A=0; X=0; Y=0; STATUS='Inactive' ;
data TABLE2; A=0; STATUS2='Active';
run;
proc sql;
  update MASTER
  set X=1,Y=1
  where A in (select unique A from TABLE2 where STATUS2='Active')
    and STATUS='Inactive';  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 04:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-dataset-columns-based-on-another-dataset/m-p/698570#M213657</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-13T04:00:37Z</dc:date>
    </item>
  </channel>
</rss>

