<?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: call missing in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140546#M37569</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My question is also the same:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which lines of code is merging the right-hand dataset on only once even if there are duplicates of CODE on the left????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Nov 2013 21:46:10 GMT</pubDate>
    <dc:creator>robertrao</dc:creator>
    <dc:date>2013-11-12T21:46:10Z</dc:date>
    <item>
      <title>call missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140541#M37564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;I have two datasets like shown&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;i want to merge them by code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;i have the code which produces the desired output&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;can someone explain to me why the code has output prior to the call missing?????and why is the output statement at all necessary???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;why is the data from the second dataset not repeated for all values of code from the first???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 10pt; font-family: Courier New;"&gt; TEMP2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp; CODE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LAB&lt;/P&gt;&lt;P&gt;102&amp;nbsp; 45.77&amp;nbsp;&amp;nbsp;&amp;nbsp; LAB1&lt;/P&gt;&lt;P&gt;102&amp;nbsp; 45.77&amp;nbsp;&amp;nbsp; LAB2&lt;/P&gt;&lt;P&gt;102&amp;nbsp; 45.77&amp;nbsp;&amp;nbsp; LAB3&lt;/P&gt;&lt;P&gt;103&amp;nbsp; 45.88&amp;nbsp;&amp;nbsp; LAB1&lt;/P&gt;&lt;P&gt;103&amp;nbsp; 45.88&amp;nbsp; LAB2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WANT1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;CODE&amp;nbsp; COUNT&amp;nbsp; VALUE1&amp;nbsp;&amp;nbsp; VALUE2&lt;/P&gt;&lt;P&gt;45.77&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 84&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 45.39&lt;/P&gt;&lt;P&gt;45.88&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50.00&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WANT2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp; CODE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LAB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT&amp;nbsp; VALUE1&amp;nbsp;&amp;nbsp; VALUE2&lt;/P&gt;&lt;P&gt;102 45.77&amp;nbsp;&amp;nbsp;&amp;nbsp; LAB1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&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; 84&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 45.39&lt;/P&gt;&lt;P&gt;102&amp;nbsp; 45.77&amp;nbsp;&amp;nbsp; LAB2&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;102&amp;nbsp; 45.77&amp;nbsp;&amp;nbsp; LAB3&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;103&amp;nbsp; 45.88&amp;nbsp;&amp;nbsp; LAB1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&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; 19&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50.00&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;103&amp;nbsp; 45.88&amp;nbsp; LAB2&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CODE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;data want2;&lt;/P&gt;&lt;P&gt; merge temp2 want1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by CODE;&lt;/P&gt;&lt;P&gt; output;&lt;/P&gt;&lt;P&gt; call missing(of _all_);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 21:01:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140541#M37564</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-11-12T21:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: call missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140542#M37565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thwe simplest way is to try running the data step without the output, and then without the call missing.&lt;/P&gt;&lt;P&gt;What you will see is that because of repeated values of Code in temp2, the input from want1 will stay in the PDV, and merged into the repeated rows of temp2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 21:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140542#M37565</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-11-12T21:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: call missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140543#M37566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I couldn't explain why something was there without knowing who put it there and why &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;P&gt;&lt;/P&gt;&lt;P&gt;I would guess it's because the merge was specifically written to have the desired effect, namely, to merge the right-hand dataset on only once even if there are duplicates of CODE.&amp;nbsp; Take away the call missing and the output, and you get it merged to all same-values of CODE, if that's your desire.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason it might be there is related to the way MERGE works.&amp;nbsp; MERGE identifies the first matching observation on the left with the observation on the right, and appends the right dataset's values.&amp;nbsp; Then it goes on through both datasets until it finds the next matching set of observations - it doesn't keep merging on the right-side dataset's values for the same value of CODE.&amp;nbsp; The reason the effect is (normally) to do so, is a function of how variables that come in on a MERGE/SET/UPDATE statement work.&amp;nbsp; They are automatically not set to missing (ie, RETAINed).&amp;nbsp; So the MERGE basically just outputs all of the left-side dataset rows, and they all keep the right-side dataset's values.&amp;nbsp; Nothing is set to missing until you pass a by group boundary (where, if a right-hand observation is missing, missing values are appended).&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 21:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140543#M37566</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-11-12T21:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: call missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140544#M37567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for the reply..&lt;/P&gt;&lt;P&gt;I dint undertand it well enough&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 21:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140544#M37567</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-11-12T21:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: call missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140545#M37568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My desire is to have it the way I had it in WANT2&lt;/P&gt;&lt;P&gt;But i dint understand the code??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 21:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140545#M37568</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-11-12T21:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: call missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140546#M37569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My question is also the same:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which lines of code is merging the right-hand dataset on only once even if there are duplicates of CODE on the left????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 21:46:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140546#M37569</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-11-12T21:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: call missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140547#M37570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was the second half of my answer.&amp;nbsp; In brief, the CALL MISSING is setting the values back to missing, and since MERGE doesn't actually read in the values from the right-hand dataset again, it won't retain the values if they're set to missing.&amp;nbsp; Read a detailed explanation of the PDV and merge statement if you want to understand better, or turn on the data step debugger and run it both ways.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 21:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140547#M37570</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-11-12T21:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: call missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140548#M37571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK.&lt;/P&gt;&lt;P&gt;If i understand the merge correctly&lt;/P&gt;&lt;P&gt;in a many to one merge the right side values are RETAINEd for all the records on the left by the variable we are merging with????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 22:06:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140548#M37571</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-11-12T22:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: call missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140549#M37572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's the gist of it, yes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 22:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/call-missing/m-p/140549#M37572</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-11-12T22:12:13Z</dc:date>
    </item>
  </channel>
</rss>

