<?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 Assign values to missing values in between in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Assign-values-to-missing-values-in-between/m-p/757649#M36873</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is desired output I am looking for, in the previous code this is assigning value 999 at all blank records, but I am looking for 999 on those inbetween blank spaces where there is any value before and after the blank records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ex: ID=2, section=c,f,g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this code is assigning values 999 at all blank records. Please suggest something else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 240pt;" border="0" width="320" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;ID&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;Sequence&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;section&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;value&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;desired&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;a&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;b&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;c&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;d&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;e&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;a&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;b&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;c&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;999&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;d&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;e&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;f&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;999&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;7&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;g&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;999&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;h&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;3&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;a&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;3&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;b&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;4&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;a&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;4&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;b&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines dsd dlm=" " truncover;
input ID $ Sequence section $ value;
datalines;
1 1 a 0
1 2 b  
1 3 c 1
1 4 d 0
1 5 e 0
2 1 a 1
2 2 b 1
2 3 c  
2 4 d 2
2 5 e 2
2 6 f  
2 7 g  
2 8 h 0
3 1 a .
3 2 b 1
4 1 a 0
4 2 b
;
run;
data want;
 do until(last.value);
  set have;
  by id value notsorted;
  if first.id then first=1;
  if last.id then last=1;
 end;

  do until(last.value);
  set have;
  by id value notsorted;
  desired=value;
  if not first and not last and missing(value) then desired=999;
  output;
 end;
 drop first last;
 run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jul 2021 11:37:17 GMT</pubDate>
    <dc:creator>bharath86</dc:creator>
    <dc:date>2021-07-28T11:37:17Z</dc:date>
    <item>
      <title>Assign values to missing values in between</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Assign-values-to-missing-values-in-between/m-p/757649#M36873</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is desired output I am looking for, in the previous code this is assigning value 999 at all blank records, but I am looking for 999 on those inbetween blank spaces where there is any value before and after the blank records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ex: ID=2, section=c,f,g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this code is assigning values 999 at all blank records. Please suggest something else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 240pt;" border="0" width="320" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;ID&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;Sequence&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;section&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;value&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;desired&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;a&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;b&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;c&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;d&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;e&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;a&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;b&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;c&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;999&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;d&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;e&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;f&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;999&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;7&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;g&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;999&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;h&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;3&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;a&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;3&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;b&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;4&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;a&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;4&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;b&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines dsd dlm=" " truncover;
input ID $ Sequence section $ value;
datalines;
1 1 a 0
1 2 b  
1 3 c 1
1 4 d 0
1 5 e 0
2 1 a 1
2 2 b 1
2 3 c  
2 4 d 2
2 5 e 2
2 6 f  
2 7 g  
2 8 h 0
3 1 a .
3 2 b 1
4 1 a 0
4 2 b
;
run;
data want;
 do until(last.value);
  set have;
  by id value notsorted;
  if first.id then first=1;
  if last.id then last=1;
 end;

  do until(last.value);
  set have;
  by id value notsorted;
  desired=value;
  if not first and not last and missing(value) then desired=999;
  output;
 end;
 drop first last;
 run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 11:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Assign-values-to-missing-values-in-between/m-p/757649#M36873</guid>
      <dc:creator>bharath86</dc:creator>
      <dc:date>2021-07-28T11:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Assign values to missing values in between</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Assign-values-to-missing-values-in-between/m-p/757653#M36875</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
counter = 0;
do until (last.id);
  set have;
  by id;
  counter + 1;
  if value ne .
  then do;
    lastcount = counter;
    if firstcount = . then firstcount = counter;
  end;
end;
counter = 0;
do until (last.id);
  set have;
  by id;
  counter + 1;
  if value = . and counter gt firstcount and counter lt lastcount
  then desired = 999;
  else desired = value;
  output;
end;
drop counter firstcount lastcount;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Jul 2021 11:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Assign-values-to-missing-values-in-between/m-p/757653#M36875</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-28T11:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Assign values to missing values in between</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Assign-values-to-missing-values-in-between/m-p/757654#M36876</link>
      <description>&lt;P&gt;May I suggest that instead of assigning a number to these, you assign a missing value that has a specific meaning, such as &lt;FONT face="courier new,courier"&gt;.A&lt;/FONT&gt; and so now the other missings can be distinguished from the &lt;FONT face="courier new,courier"&gt;.A&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you assign a number, then any further analysis or reporting (such as computing means or a percent) has to specially handle that number differently than the other numbers; not so if you use &lt;FONT face="courier new,courier"&gt;.A&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 13:41:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Assign-values-to-missing-values-in-between/m-p/757654#M36876</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-28T13:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Assign values to missing values in between</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Assign-values-to-missing-values-in-between/m-p/757659#M36878</link>
      <description>&lt;P&gt;I don't see anything wrong. After running my code. I got this :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where is wrong ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1627473567239.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61937iEF66D91E9E13CD10/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1627473567239.png" alt="Ksharp_0-1627473567239.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 11:59:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Assign-values-to-missing-values-in-between/m-p/757659#M36878</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-07-28T11:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Assign values to missing values in between</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Assign-values-to-missing-values-in-between/m-p/757661#M36879</link>
      <description>&lt;P&gt;PS If you want to treat zero as a "blank value", you need to include that in the conditions.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 12:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Assign-values-to-missing-values-in-between/m-p/757661#M36879</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-28T12:02:03Z</dc:date>
    </item>
  </channel>
</rss>

