<?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: replicate value (easy question) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/replicate-value-easy-question/m-p/231008#M54553</link>
    <description>&lt;P&gt;Here is a solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input n field$;&lt;BR /&gt;cards ;&lt;BR /&gt;1 y12&lt;BR /&gt;2 .&lt;BR /&gt;3 .&lt;BR /&gt;4 b98&lt;BR /&gt;5 .&lt;BR /&gt;6 .&lt;BR /&gt;7 .&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;retain field2;&lt;BR /&gt;if not missing(field) then field2 = field;&lt;BR /&gt;if missing(field) then field = field2;&lt;BR /&gt;drop field2;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Oct 2015 17:43:37 GMT</pubDate>
    <dc:creator>Steelers_In_DC</dc:creator>
    <dc:date>2015-10-21T17:43:37Z</dc:date>
    <item>
      <title>replicate value (easy question)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/replicate-value-easy-question/m-p/231001#M54550</link>
      <description>&lt;P&gt;i need to replicate the value of the previos line&amp;nbsp;(_n_ - 1) to line (_n_), could anyone code it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ex.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have ;&lt;BR /&gt;input n field $;&lt;BR /&gt;cards ;&lt;BR /&gt;1 y12&lt;BR /&gt;2 .&lt;BR /&gt;3 .&lt;BR /&gt;4 b98&lt;BR /&gt;5 .&lt;BR /&gt;6 .&lt;BR /&gt;7 .&lt;BR /&gt;;&lt;BR /&gt;run ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;n field&lt;BR /&gt;1 y12&lt;BR /&gt;2 y12&lt;BR /&gt;3 h12&lt;BR /&gt;4 b98&lt;BR /&gt;5 b98&lt;BR /&gt;6 b98&lt;BR /&gt;7 b98&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please, consider that this table (have)&amp;nbsp;cannot be ordered&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 17:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/replicate-value-easy-question/m-p/231001#M54550</guid>
      <dc:creator>Augusto</dc:creator>
      <dc:date>2015-10-21T17:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: replicate value (easy question)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/replicate-value-easy-question/m-p/231004#M54551</link>
      <description>&lt;P&gt;Simple retain statement would work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	retain field1;
	if not missing(field) then field1=field;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 17:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/replicate-value-easy-question/m-p/231004#M54551</guid>
      <dc:creator>ndp</dc:creator>
      <dc:date>2015-10-21T17:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: replicate value (easy question)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/replicate-value-easy-question/m-p/231007#M54552</link>
      <description>&lt;P&gt;&lt;BR /&gt;data want;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;set have;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;retain prevField;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if field ne "" then prevField = field;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if field = "" then field = prevField;&lt;BR /&gt;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 17:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/replicate-value-easy-question/m-p/231007#M54552</guid>
      <dc:creator>dsbihill</dc:creator>
      <dc:date>2015-10-21T17:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: replicate value (easy question)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/replicate-value-easy-question/m-p/231008#M54553</link>
      <description>&lt;P&gt;Here is a solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input n field$;&lt;BR /&gt;cards ;&lt;BR /&gt;1 y12&lt;BR /&gt;2 .&lt;BR /&gt;3 .&lt;BR /&gt;4 b98&lt;BR /&gt;5 .&lt;BR /&gt;6 .&lt;BR /&gt;7 .&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;retain field2;&lt;BR /&gt;if not missing(field) then field2 = field;&lt;BR /&gt;if missing(field) then field = field2;&lt;BR /&gt;drop field2;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 17:43:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/replicate-value-easy-question/m-p/231008#M54553</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-10-21T17:43:37Z</dc:date>
    </item>
  </channel>
</rss>

