<?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: How to create values for groups?? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-values-for-groups/m-p/448877#M112914</link>
    <description>&lt;P&gt;Not sure, if i understand what you need to do.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You want to create the variable FinalValue.&lt;/LI&gt;
&lt;LI&gt;FinalValue is set per index to Value of the observation having Indicator = 1&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Right? If yes: why is FinalValue=0 in line 4? It should be 7.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;3 0  4   &lt;STRONG&gt;&lt;FONT color="#FF9900"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there exactly one observation with having Indicator = 1 for each Index? If yes, try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Index Indicator value;
datalines;

1 0 5
1 1 21
2 1 0
3 0 4
3 1 7
3 0 8
3 0 2
4 1 1
4 0 4
;
run;

data want;
   merge have have(rename=(Indicator=Flag value=FinalValue) where=(Flag = 1));
   by Index;

   drop Flag;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Mar 2018 07:30:26 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2018-03-27T07:30:26Z</dc:date>
    <item>
      <title>How to create values for groups??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-values-for-groups/m-p/448857#M112906</link>
      <description>&lt;P&gt;I have an informational index with the initial 3 sections. How would I get the fourth sections in view of the pointers? For instance, for the file, when the pointer =1, the esteem is 21, so I put 21 is the last esteems in all lines for file 1. Could anyone suggest the procedure to Base SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data test;
input Index Indicator value FinalValue;
datalines;

1 0  5   21
1 1  21  21
2 1  0   0
3 0  4   0
3 1  7   7
3 0  8   7
3 0  2   7
4 1  1   1
4 0  4   1
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 05:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-values-for-groups/m-p/448857#M112906</guid>
      <dc:creator>isabeljason</dc:creator>
      <dc:date>2018-03-27T05:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create values for groups??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-values-for-groups/m-p/448861#M112908</link>
      <description>&lt;P&gt;Assuming data is sorted and you want the last given FinalValue then:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;

&amp;nbsp;set have;

&amp;nbsp; by Index;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if last.index;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 05:55:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-values-for-groups/m-p/448861#M112908</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-03-27T05:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to create values for groups??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-values-for-groups/m-p/448863#M112910</link>
      <description>&lt;P&gt;Thanks for the reply. Will try and let you know the details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 05:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-values-for-groups/m-p/448863#M112910</guid>
      <dc:creator>isabeljason</dc:creator>
      <dc:date>2018-03-27T05:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create values for groups??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-values-for-groups/m-p/448877#M112914</link>
      <description>&lt;P&gt;Not sure, if i understand what you need to do.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You want to create the variable FinalValue.&lt;/LI&gt;
&lt;LI&gt;FinalValue is set per index to Value of the observation having Indicator = 1&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Right? If yes: why is FinalValue=0 in line 4? It should be 7.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;3 0  4   &lt;STRONG&gt;&lt;FONT color="#FF9900"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there exactly one observation with having Indicator = 1 for each Index? If yes, try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Index Indicator value;
datalines;

1 0 5
1 1 21
2 1 0
3 0 4
3 1 7
3 0 8
3 0 2
4 1 1
4 0 4
;
run;

data want;
   merge have have(rename=(Indicator=Flag value=FinalValue) where=(Flag = 1));
   by Index;

   drop Flag;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 07:30:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-values-for-groups/m-p/448877#M112914</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-03-27T07:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create values for groups??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-values-for-groups/m-p/449014#M112953</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/200306"&gt;@isabeljason&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I have an informational index with the initial 3 sections. How would I get the fourth sections in view of the pointers? For instance, for the file, when the pointer =1, the esteem is 21, so I put 21 is the last esteems in all lines for file 1. Could anyone suggest the procedure to Base SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;data test;
input Index Indicator value FinalValue;
datalines;

1 0  5   21
1 1  21  21
2 1  0   0
3 0  4   0
3 1  7   7
3 0  8   7
3 0  2   7
4 1  1   1
4 0  4   1
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your variables are &lt;STRONG&gt;Index Indicator value FinalValue&lt;/STRONG&gt; but you address your values as esteem, "section"&amp;nbsp;and possibly "pointers". It will help everyone to address things in terms of the variable names, or change the variable names to reflect the words you use. Also "initial 3 sections" isn't clear unless you mean "first three values for the variable Index".&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 15:17:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-values-for-groups/m-p/449014#M112953</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-27T15:17:46Z</dc:date>
    </item>
  </channel>
</rss>

