<?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: conditionally adding part of an entry in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/conditionally-adding-part-of-an-entry/m-p/274670#M54850</link>
    <description>&lt;P&gt;Just to confirm the logic is keeping the first records value and filling down?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use BY group processing with a RETAIN statement to keep the value. This creates a new variable with the values you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data want;
Set have;
By id;
Retain h_new;

If first.id then h_new = h;

Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Jun 2016 14:01:07 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-06-02T14:01:07Z</dc:date>
    <item>
      <title>conditionally adding part of an entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/conditionally-adding-part-of-an-entry/m-p/274659#M54847</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;my data file is like this:&lt;/P&gt;&lt;P&gt;id &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; h&lt;/P&gt;&lt;P&gt;bv01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lg0012&lt;/P&gt;&lt;P&gt;bv01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lg001 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;bv01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lg001&lt;/P&gt;&lt;P&gt;bv14 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hk031&lt;/P&gt;&lt;P&gt;bv14 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hk03&lt;/P&gt;&lt;P&gt;bv50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 78412&lt;/P&gt;&lt;P&gt;bv50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 784&lt;/P&gt;&lt;P&gt;bv50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 784&lt;/P&gt;&lt;P&gt;bv50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 784&lt;/P&gt;&lt;P&gt;ect....&lt;/P&gt;&lt;P&gt;what i want:&lt;/P&gt;&lt;P&gt;id &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; h&lt;/P&gt;&lt;P&gt;bv01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lg0012&lt;/P&gt;&lt;P&gt;bv01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lg0012 * &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;bv01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lg0012 *&lt;/P&gt;&lt;P&gt;bv14 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hk031 &amp;nbsp;&lt;/P&gt;&lt;P&gt;bv14 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hk031 &amp;nbsp;*&lt;/P&gt;&lt;P&gt;bv50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 78412&lt;/P&gt;&lt;P&gt;bv50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 78412 &amp;nbsp;*&lt;/P&gt;&lt;P&gt;bv50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 78412 &amp;nbsp;*&lt;/P&gt;&lt;P&gt;bv50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 78412 &amp;nbsp;*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;help me please;&amp;nbsp;thank you, first.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 13:28:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/conditionally-adding-part-of-an-entry/m-p/274659#M54847</guid>
      <dc:creator>soumri</dc:creator>
      <dc:date>2016-06-02T13:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: conditionally adding part of an entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/conditionally-adding-part-of-an-entry/m-p/274670#M54850</link>
      <description>&lt;P&gt;Just to confirm the logic is keeping the first records value and filling down?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use BY group processing with a RETAIN statement to keep the value. This creates a new variable with the values you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data want;
Set have;
By id;
Retain h_new;

If first.id then h_new = h;

Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Jun 2016 14:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/conditionally-adding-part-of-an-entry/m-p/274670#M54850</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-02T14:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: conditionally adding part of an entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/conditionally-adding-part-of-an-entry/m-p/274682#M54858</link>
      <description>&lt;P&gt;very nice;&amp;nbsp;I tried things much more complicated.&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 14:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/conditionally-adding-part-of-an-entry/m-p/274682#M54858</guid>
      <dc:creator>soumri</dc:creator>
      <dc:date>2016-06-02T14:16:31Z</dc:date>
    </item>
  </channel>
</rss>

