<?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 Direct Record/Observation Replacement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Direct-Record-Observation-Replacement/m-p/613556#M179192</link>
    <description>&lt;P&gt;I have a large aircraft/radar/billing database that I am going to need to query. The main index variable is billable_id....it is ALWAYS unique.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now suppose I pull out a subset of the larger data, to correct missing information that I could use later. Is it possible to directly "copy back and overwrite" all of the subset dataset back into the main set? No new variables are added. I know this can be done in multiple steps, I'm just wondering if it can be done in SQL in one step.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Dec 2019 16:25:18 GMT</pubDate>
    <dc:creator>BCNAV</dc:creator>
    <dc:date>2019-12-23T16:25:18Z</dc:date>
    <item>
      <title>Direct Record/Observation Replacement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Direct-Record-Observation-Replacement/m-p/613556#M179192</link>
      <description>&lt;P&gt;I have a large aircraft/radar/billing database that I am going to need to query. The main index variable is billable_id....it is ALWAYS unique.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now suppose I pull out a subset of the larger data, to correct missing information that I could use later. Is it possible to directly "copy back and overwrite" all of the subset dataset back into the main set? No new variables are added. I know this can be done in multiple steps, I'm just wondering if it can be done in SQL in one step.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 16:25:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Direct-Record-Observation-Replacement/m-p/613556#M179192</guid>
      <dc:creator>BCNAV</dc:creator>
      <dc:date>2019-12-23T16:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Record/Observation Replacement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Direct-Record-Observation-Replacement/m-p/613559#M179194</link>
      <description>&lt;P&gt;Do you have write access to the database?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What steps do you need to correct the data?? (Are you using other PROCs than SQL, or DATA steps)?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;What do you mean by "one step"? At a minimum, you'd have to use SQL to extract the data, and another step to write the corrected data back to the database, but this could be a single PROC SQL call with two commands (a command to extract the data and a command to write) is that what you mean by "one step"?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 16:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Direct-Record-Observation-Replacement/m-p/613559#M179194</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-23T16:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Record/Observation Replacement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Direct-Record-Observation-Replacement/m-p/613561#M179195</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/142314"&gt;@BCNAV&lt;/a&gt;&amp;nbsp; It's always good to post what you HAVE and WANT alongside explaining the business logic of your requirement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand you correctly, you basically want to MODIFY your dataset/table as opposed to creating a new temporary/permanent dataset.&amp;nbsp; &lt;STRONG&gt;If yes&lt;/STRONG&gt;, the natural approach would be to use MODIFY statement in Datastep or Proc SQL UPDATE statement to basically update the table in place.&amp;nbsp; Proc SQL UPDATE is indeed common and there are gazillion examples online.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, any ANSI SQL UPDATE works in proc sql for the reason most SQL proprietary products have "update" functionality are consistent to conform to ANSI standards&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 16:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Direct-Record-Observation-Replacement/m-p/613561#M179195</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-23T16:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Record/Observation Replacement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Direct-Record-Observation-Replacement/m-p/613573#M179205</link>
      <description>&lt;P&gt;My SQL update skills are lacking but the DATA step MODIFY or UPDATE look to be likely candidates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;data master;
   update master
          transaction
   ;
   by uniqueid;
run;&lt;/PRE&gt;
&lt;P&gt;Where Transaction would have your corrected data.&lt;/P&gt;
&lt;P&gt;Since BY is used the typical sort requirements are involved.&lt;/P&gt;
&lt;P&gt;By default missing values in the transaction data set do not replace the value in the master data set but an option to force such is available if that is desired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The transaction data set could have multiple values of the ID variable but master can only have it once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Caution:&lt;/P&gt;
&lt;P&gt;Any ID value in transaction not in Master is added to the output.&lt;/P&gt;
&lt;P&gt;Any variable in transaction not in Master is also added to the output.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 17:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Direct-Record-Observation-Replacement/m-p/613573#M179205</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-23T17:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Record/Observation Replacement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Direct-Record-Observation-Replacement/m-p/613606#M179221</link>
      <description>this works!</description>
      <pubDate>Mon, 23 Dec 2019 19:08:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Direct-Record-Observation-Replacement/m-p/613606#M179221</guid>
      <dc:creator>BCNAV</dc:creator>
      <dc:date>2019-12-23T19:08:12Z</dc:date>
    </item>
  </channel>
</rss>

