<?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 vs proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125131#M260149</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@scott :&amp;nbsp;&amp;nbsp; i believe a little modification will do my need . not as per the missing value , lookin on taking the update from slave dataset or new dataset values to the master dataset . Thanks &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Sep 2013 09:13:28 GMT</pubDate>
    <dc:creator>sugeshnambiar</dc:creator>
    <dc:date>2013-09-02T09:13:28Z</dc:date>
    <item>
      <title>update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125120#M260138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the scenario&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;main_data&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="width: 100%; border: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;P&gt;&lt;STRONG&gt;my_value&lt;/STRONG&gt;&lt;/P&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;new_data&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="50" style="width: 762px; height: 52px; border: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;my_value&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;80&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;update via data step&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;data main_data;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;update main_data new_data;&lt;/P&gt;&lt;P&gt;by name;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output :&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="width: 100%; border: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;my_value&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;80&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;STRONG&gt;update via proc sql&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;update main_data&lt;/P&gt;&lt;P&gt;set my_value=(select my_value from new_data where main_data.name=new_data.name)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="width: 100%; border: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;my_value&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;80&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;80&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both the above update doesnt yeild the same result !!! y are'nt they both same ????????&lt;/P&gt;&lt;P&gt;I want the output as the &lt;STRONG&gt;proc sql&lt;/STRONG&gt; way,how do i achieve this thru data step ???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 12:10:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125120#M260138</guid>
      <dc:creator>sugeshnambiar</dc:creator>
      <dc:date>2013-08-29T12:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125121#M260139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;If the Duplicates Value are in your master dataset then you need to execute your trnsaction dataset multiple times to apply the updates for all the observations in your master dataset...For that i have used SAS index to search for observation and execute the transaction dataset in such a way that updates will apply to all the observations of master dataset...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;Make sure that duplicates values are in MASTER DATASET not in TRANSACTION DATASET...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;index&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; new_data(name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; want(drop = ori_val);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(totobs);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; main_data(rename = (my_value = ori_val)) nobs = totobs;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; new_data key = name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; _iorc_ NE &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_value = my_value;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;-Urvish&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 13:27:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125121#M260139</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-08-29T13:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125122#M260140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it becomes a problem when updating&amp;nbsp; more columns.&lt;/P&gt;&lt;P&gt;data step update is capable of only one to one update.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 13:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125122#M260140</guid>
      <dc:creator>sugeshnambiar</dc:creator>
      <dc:date>2013-08-29T13:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125123#M260141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The simple answer is that the UPDATE clause in PROC SQL has nothing to do with the UPDATE statement of a DATA step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The UPDATE statement for a DATA step is intended to apply transactions to a master dataset.&amp;nbsp; In some ways it is a legacy from before there were transactional database systems and changes to the data needed to be keyed into a file and applied to that database.&amp;nbsp; I data step using UPDATE will build a whole new dataset.&amp;nbsp; Transaction records can include new id values that will result in additional records in the output dataset than were in the original master dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The UPDATE statement in PROC SQL will modify existing records within an existing dataset.&amp;nbsp; The MODIFY statement in a data step is most similar to this functionality.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 13:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125123#M260141</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-08-29T13:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125124#M260142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You want the MERGE statement and not the UPDATE statement to do what you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;* update via data step ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data main_data;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;MERGE&lt;/STRONG&gt; main_data new_data;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;by name;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 14:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125124#M260142</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-08-29T14:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125125#M260143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom :&amp;nbsp;&amp;nbsp; merge and update yields the same output. That wud not be of much help here:smileyconfused:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 14:12:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125125#M260143</guid>
      <dc:creator>sugeshnambiar</dc:creator>
      <dc:date>2013-08-29T14:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125126#M260144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because the variable you are adding already exists on the master data set.&amp;nbsp; So you need to do the trick with renaming the transaction variable(s).&amp;nbsp; But the merge statement is closer to update statement in SQL because it does not have all of the additional features of the UPDATE statement, such as not updating when the value in the transaction dataset is missing or allowing for multiple transaction records to be applied to the same master record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data main_data;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;MERGE&lt;/STRONG&gt; main_data new_data(rename=(my_value1=xxx my_value2=yyy) in=in_transaction) ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;by name;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if in_transaction then do; my_value1 = xxx ; my_value2=yyy; end;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;drop xxx yyy;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 14:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125126#M260144</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-08-29T14:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125127#M260145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Well there're so many ways of playing with in SAS Datastep...so it will be good if you post how your transaction and master dataset looks like...&lt;/P&gt;&lt;P&gt;The code i have posted, it works if you want to have update on single variable...&lt;/P&gt;&lt;P&gt;In case of more variables, you only need to add them in RENAME = dataset option and let the update will occure for all the observations...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As you said datastep update is capable of one to one update only...it is very true as per the SAS Documentation...However, it is also mentioned that if your master dataset is having duplicate values you can use this kind of tecniques...There is always limitation of any SAS Statements,options,functions,etc...So i think we should use all together, rather than stuck on only UPDATE statement, in such a way that we will have our desired output...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The all you need is like you only need to rename the variables if there is more than one variables...See the following code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;index&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; new_data(name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; want(drop = ori_val ori_val1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(totobs);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; main_data(rename = (my_value = ori_val my_value1 = ori_val1)) nobs = totobs;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; new_data key = name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; _iorc_ NE &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_value = my_value;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_value1 = my_value1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Urvish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2013 16:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125127#M260145</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-08-29T16:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125128#M260146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward, see the following data structure where your master dataset contains consecutive duplicates as well as non matching values compare to your transaction dataset...&lt;/P&gt;&lt;P&gt;Neither the techniques posted above can achive the desired output of applying each update for each duplicates in master dataset...Not even UPDATE statement of PROC SQL posted in your first question will work here...So dont stuck on only one SAS techniques...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the following modified code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/*===================================================*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/* Master Data contains consecutive duplicate values */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/*===================================================*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data &lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;master;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;input &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;name $ value;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;cards4&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffc0; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;A 10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffc0; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;A 20&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffc0; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;B 30&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffc0; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;D 40&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffc0; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;A 30&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffc0; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;D 20&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;;;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/*============================================================*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/* Transaction Data contains the values to be updated&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/* with some new values which are not there in master dataset */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/*============================================================*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data &lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;trans;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;input &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;name $ value;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;cards4&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffc0; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;A 80&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffc0; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;C 30&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffc0; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;D 50&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;;;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/*==============================================================*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/* Data Step won't work to apply the update for each duplicates */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/* in master dataset, niether the COALESCE will work for this&amp;nbsp;&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/* kind of situation, all we need to use CASE expression to&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/* apply correspondence update in master dataset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;/*==============================================================*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;proc &lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;create &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; want(drop = value rename = (value1 = value)) &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="color: #575757; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;select &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;coalesce(a.name,b.name) &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; name,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;when&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; a.value NE b.value &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;then &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;b.value&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;else &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;a.value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="color: #575757; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;end &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;as &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;value,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;when&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; calculated value = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;.&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; a.value&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;else &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;calculated value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;as &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;value1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;from &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;master &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; a&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;full &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;join&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="color: #575757; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;trans &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; b&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;on &lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;a.name = b.name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;order&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;by&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; -Urvish&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Sep 2013 05:55:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125128#M260146</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-09-01T05:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125129#M260147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OP, I have replicated Tom's method and it results in exactly what you are after.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WANT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; MERGE MASTER&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRANS (RENAME = (VALUE = NEWVALUE));&lt;/P&gt;&lt;P&gt;&amp;nbsp; BY NAME;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF MISSING(NEWVALUE) THEN NEWVALUE = VALUE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP VALUE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; RENAME NEWVALUE = VALUE;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What seems to be the problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2013 02:16:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125129#M260147</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-09-02T02:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125130#M260148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to be careful with the requirements of your situation if you want to start using COALESCE() function or testing if the new value is missing.&amp;nbsp; If that is your technique then it cannot handle updates that are intended to convert an existing non-missing value to a missing value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2013 04:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125130#M260148</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-09-02T04:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125131#M260149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@scott :&amp;nbsp;&amp;nbsp; i believe a little modification will do my need . not as per the missing value , lookin on taking the update from slave dataset or new dataset values to the master dataset . Thanks &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2013 09:13:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125131#M260149</guid>
      <dc:creator>sugeshnambiar</dc:creator>
      <dc:date>2013-09-02T09:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125132#M260150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks @&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1705" data-externalid="" data-presence="null" data-userid="2503" data-username="UrvishShah" href="https://communities.sas.com/people/UrvishShah" id="jive-250378600566038895803"&gt;UrvishShah&lt;/A&gt; &lt;/STRONG&gt; @ tom&amp;nbsp; @ scott . its been nice to see differnt ways&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2013 09:15:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/125132#M260150</guid>
      <dc:creator>sugeshnambiar</dc:creator>
      <dc:date>2013-09-02T09:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: update vs proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/607337#M260151</link>
      <description>&lt;P&gt;what method did you end up using? Can you post your final solution?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 13:42:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-vs-proc-sql/m-p/607337#M260151</guid>
      <dc:creator>r0oki3</dc:creator>
      <dc:date>2019-11-26T13:42:50Z</dc:date>
    </item>
  </channel>
</rss>

