<?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 many-to-one data reshaping and call missing in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/many-to-one-data-reshaping-and-call-missing/m-p/702206#M25878</link>
    <description>&lt;PRE&gt;data one;&lt;BR /&gt;input S_id S_i score;&lt;BR /&gt;cards;&lt;BR /&gt;1 1 98&lt;BR /&gt;1 2 76&lt;BR /&gt;1 3 63&lt;BR /&gt;2 1 96&lt;BR /&gt;2 2 85&lt;BR /&gt;2 3 76&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data score_one;&lt;BR /&gt;set one;&lt;BR /&gt;by S_id S_i;&lt;BR /&gt;array ascore(3);&lt;BR /&gt;retain ascore1-ascore3;&lt;BR /&gt;/*if first.S_id then call missing(of ascore1-ascore3);*/&lt;BR /&gt;ascore(S_i)=score;&lt;BR /&gt;/*output;*/&lt;BR /&gt;if last.S_id then output;&lt;BR /&gt;keep S_id ascore1-ascore3;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;when I work on the reshaping through by statement, it seems the first.s_id does not take an effect when combining with the call missing routine. As shown above, &lt;BR /&gt;when I comments if first.S_id call missing line, the codes can generate the same data set. Call missing should assign empty values for first-id =1, but we do have &lt;BR /&gt;the values for the first line. I use "output" to display the loop. It is a bit confusing about the data assignment. What is the proper understanding?  &lt;/PRE&gt;</description>
    <pubDate>Sat, 28 Nov 2020 17:51:17 GMT</pubDate>
    <dc:creator>anming</dc:creator>
    <dc:date>2020-11-28T17:51:17Z</dc:date>
    <item>
      <title>many-to-one data reshaping and call missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/many-to-one-data-reshaping-and-call-missing/m-p/702206#M25878</link>
      <description>&lt;PRE&gt;data one;&lt;BR /&gt;input S_id S_i score;&lt;BR /&gt;cards;&lt;BR /&gt;1 1 98&lt;BR /&gt;1 2 76&lt;BR /&gt;1 3 63&lt;BR /&gt;2 1 96&lt;BR /&gt;2 2 85&lt;BR /&gt;2 3 76&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data score_one;&lt;BR /&gt;set one;&lt;BR /&gt;by S_id S_i;&lt;BR /&gt;array ascore(3);&lt;BR /&gt;retain ascore1-ascore3;&lt;BR /&gt;/*if first.S_id then call missing(of ascore1-ascore3);*/&lt;BR /&gt;ascore(S_i)=score;&lt;BR /&gt;/*output;*/&lt;BR /&gt;if last.S_id then output;&lt;BR /&gt;keep S_id ascore1-ascore3;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;when I work on the reshaping through by statement, it seems the first.s_id does not take an effect when combining with the call missing routine. As shown above, &lt;BR /&gt;when I comments if first.S_id call missing line, the codes can generate the same data set. Call missing should assign empty values for first-id =1, but we do have &lt;BR /&gt;the values for the first line. I use "output" to display the loop. It is a bit confusing about the data assignment. What is the proper understanding?  &lt;/PRE&gt;</description>
      <pubDate>Sat, 28 Nov 2020 17:51:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/many-to-one-data-reshaping-and-call-missing/m-p/702206#M25878</guid>
      <dc:creator>anming</dc:creator>
      <dc:date>2020-11-28T17:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: many-to-one data reshaping and call missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/many-to-one-data-reshaping-and-call-missing/m-p/702214#M25881</link>
      <description>&lt;P&gt;Since your data causes all elements of the array to be filled in every s_id group, the call missing will not have a noticeable effect. If one of your groups missed one of the values 1,2,3 for s_i, the call missing would be necessary.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2020 18:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/many-to-one-data-reshaping-and-call-missing/m-p/702214#M25881</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-28T18:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: many-to-one data reshaping and call missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/many-to-one-data-reshaping-and-call-missing/m-p/702223#M25882</link>
      <description>&lt;P&gt;WIth a slight modification to your program, you can observe the effect of CALL MISSING:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data score_one before_the_last;
set one;
by S_id S_i;
array ascore(3);
retain ascore1-ascore3;
if first.S_id then call missing(of ascore1-ascore3);
ascore(S_i)=score;
output before_the_last;
if last.S_id then output score_one;
keep S_id ascore1-ascore3;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 28 Nov 2020 22:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/many-to-one-data-reshaping-and-call-missing/m-p/702223#M25882</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-11-28T22:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: many-to-one data reshaping and call missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/many-to-one-data-reshaping-and-call-missing/m-p/702226#M25883</link>
      <description>this is really cool!</description>
      <pubDate>Sat, 28 Nov 2020 22:57:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/many-to-one-data-reshaping-and-call-missing/m-p/702226#M25883</guid>
      <dc:creator>anming</dc:creator>
      <dc:date>2020-11-28T22:57:24Z</dc:date>
    </item>
  </channel>
</rss>

