<?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: Add observation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/686146#M208157</link>
    <description>&lt;P&gt;Output like that&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;3.5&lt;BR /&gt;4&lt;BR /&gt;5&lt;BR /&gt;6&lt;BR /&gt;Like that&lt;/P&gt;</description>
    <pubDate>Wed, 23 Sep 2020 17:30:21 GMT</pubDate>
    <dc:creator>Saleem</dc:creator>
    <dc:date>2020-09-23T17:30:21Z</dc:date>
    <item>
      <title>Add observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/686137#M208154</link>
      <description>&lt;P&gt;Data ds;&lt;BR /&gt;Cards;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;5&lt;BR /&gt;6&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;BR /&gt;How to add new observation in 3.5 in after 3&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 17:29:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/686137#M208154</guid>
      <dc:creator>Saleem</dc:creator>
      <dc:date>2020-09-23T17:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Add observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/686145#M208156</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Method 1:
Data ds;
input x;
Cards;
1
2
3
3.5
4
5
6
;
run;

Method 2:
Data ds;
input x;
Cards;
1
2
3
4
5
6
;

data ds;
done=0;
do until(done);
 set ds end=done;
output;
end;
x=3.5; output;
drop done;
stop;
run;

proc sort; by x;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Sep 2020 17:30:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/686145#M208156</guid>
      <dc:creator>smantha</dc:creator>
      <dc:date>2020-09-23T17:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Add observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/686146#M208157</link>
      <description>&lt;P&gt;Output like that&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;3.5&lt;BR /&gt;4&lt;BR /&gt;5&lt;BR /&gt;6&lt;BR /&gt;Like that&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 17:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/686146#M208157</guid>
      <dc:creator>Saleem</dc:creator>
      <dc:date>2020-09-23T17:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Add observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/686147#M208158</link>
      <description>&lt;P&gt;Please test your code before posting it, and use a descriptive subject line. I edited your subject line&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/348801"&gt;@Saleem&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Data ds;&lt;BR /&gt;Cards;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;5&lt;BR /&gt;6&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;BR /&gt;How to add new observation in 3.5 in after 3&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 17:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/686147#M208158</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-23T17:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Add observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/686149#M208159</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/348801"&gt;@Saleem&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Data ds;&lt;BR /&gt;Cards;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;5&lt;BR /&gt;6&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;BR /&gt;How to add new observation in 3.5 in after 3&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You should provide a generic rule. Is this going to happen every time the value 3 appears or just once? Is the value supposed to be the mean of the current and the following value? Are any other variables going to be involved? If so, where do their values come from (the record with the 3 or somewhere else).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way is to have a data set with just the value of 3.5, append the sets and sort.&lt;/P&gt;
&lt;P&gt;Your data step does not run as expected because there is no INPUT and so no variable is created. I take the liberty of providing a variable.&lt;/P&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;PRE&gt;Data ds;
   input value;
Cards;
1
2
3
4
5
6
;
Run;

data want; 
   set ds;
   output;
   if value=3 then do;
      value=3.5;
      output;
   end;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Sep 2020 17:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/686149#M208159</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-23T17:47:05Z</dc:date>
    </item>
  </channel>
</rss>

