<?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/348869#M80842</link>
    <description>&lt;P&gt;Since "characteristic" seems to be a variable (column) name, you can't add a row "above" it.&lt;/P&gt;
&lt;P&gt;To clarify, post your example data in a data step, or use a sashelp dataset to illustrate your issue.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2017 20:14:16 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-04-10T20:14:16Z</dc:date>
    <item>
      <title>Add observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/348861#M80837</link>
      <description>&lt;P&gt;Hi i want to create observation GENDER in a row above characteristic how do i do that.&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13689i0479142E746A9595/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="234.PNG" title="234.PNG" /&gt;</description>
      <pubDate>Mon, 10 Apr 2017 20:05:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/348861#M80837</guid>
      <dc:creator>aditya1</dc:creator>
      <dc:date>2017-04-10T20:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Add observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/348868#M80841</link>
      <description>&lt;PRE&gt;data want;
   input characteristic $ ;
datalines;
F
M
;
run;&lt;/PRE&gt;
&lt;P&gt;Is this in an existing data set or are you creating set from scratch?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the later then&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 20:12:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/348868#M80841</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-10T20:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Add observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/348869#M80842</link>
      <description>&lt;P&gt;Since "characteristic" seems to be a variable (column) name, you can't add a row "above" it.&lt;/P&gt;
&lt;P&gt;To clarify, post your example data in a data step, or use a sashelp dataset to illustrate your issue.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 20:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/348869#M80842</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-04-10T20:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Add observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/348870#M80843</link>
      <description>&lt;P&gt;You have a dataset so what are you trying to do?&lt;/P&gt;
&lt;P&gt;Customize a report layout is my guess and there are probably better ways to do this - a label for the variable is one way to start off.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 20:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/348870#M80843</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-10T20:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Add observation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/348871#M80844</link>
      <description>&lt;P&gt;Do you want to insert a row or simply rename the variable? If it's the latter, then (assuming you dataset is called have), when opening the dataset simply use something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set have (rename=(characteristic=gender);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, if you really want to insert a row, you may first have to use a length statement (before the set statement) and then include code (after the set statement):&lt;/P&gt;
&lt;PRE&gt;data want;
  length characteristic $6;
  set have;
  if characteristic='F' then do;
    hold=characteristic;
    characteristic='Gender';
    output;
    characteristic=hold;
    output;
  end;
  else output;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 20:18:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-observation/m-p/348871#M80844</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-10T20:18:47Z</dc:date>
    </item>
  </channel>
</rss>

