<?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: How to repeat the entire row in a dataset with change in one variable based on a condition in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-entire-row-in-a-dataset-with-change-in-one/m-p/297678#M62547</link>
    <description>&lt;P&gt;Use a Data step with an explicit OUTPUT statement. Make sure to include an else output so that other records are also displayed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If &amp;lt;condition&amp;gt; then do;
    Do base_fund= 'add_silver' , 'add_bronze', ... 'Add_awesome';
         Output;
    End;
End;
Else output;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 12 Sep 2016 06:33:48 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-09-12T06:33:48Z</dc:date>
    <item>
      <title>How to repeat the entire row in a dataset with change in one variable based on a condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-entire-row-in-a-dataset-with-change-in-one/m-p/297665#M62546</link>
      <description>&lt;P&gt;I want to repeat the entore row in a SAS data set based on the following condition :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;If the 'duration' of the fund is lesser then equal to 4 and type of 'base_fund' is Platinum or blank value ( which implies platinum), I need to generate additional 4 rows same as platinum row values, but changing the "base_fund' to these 4 funds 'Add_Silver', 'Silver'. 'Bronze','Add_gold'. These needs to be repeated twice based on type 'RO' and 'OT'. &lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have attached the screen shot on how the raw data looks like and what I need as output for Reg_number : 8765432: &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Data I have:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;IMG title="Want.png" alt="Want.png" src="https://communities.sas.com/t5/image/serverpage/image-id/4891iD9A42EECCEECE1D0/image-size/original?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Data I want &lt;IMG title="Want.png" alt="Want.png" src="https://communities.sas.com/t5/image/serverpage/image-id/4892iC4B8746BBDCF42BD/image-size/original?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I tried using repeat function and SQL, however I was not fully successful, Appreciate your quick help on this.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 05:13:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-entire-row-in-a-dataset-with-change-in-one/m-p/297665#M62546</guid>
      <dc:creator>Prash</dc:creator>
      <dc:date>2016-09-12T05:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to repeat the entire row in a dataset with change in one variable based on a condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-entire-row-in-a-dataset-with-change-in-one/m-p/297678#M62547</link>
      <description>&lt;P&gt;Use a Data step with an explicit OUTPUT statement. Make sure to include an else output so that other records are also displayed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If &amp;lt;condition&amp;gt; then do;
    Do base_fund= 'add_silver' , 'add_bronze', ... 'Add_awesome';
         Output;
    End;
End;
Else output;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Sep 2016 06:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-entire-row-in-a-dataset-with-change-in-one/m-p/297678#M62547</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-12T06:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to repeat the entire row in a dataset with change in one variable based on a condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-entire-row-in-a-dataset-with-change-in-one/m-p/297699#M62556</link>
      <description>&lt;P&gt;If by "repeat" you mean to duplicate a row with changes then the code should be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output; &amp;nbsp;/* save original row */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if &amp;nbsp; &amp;lt;condition&amp;gt; then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;do your changes&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output; &amp;nbsp; &amp;nbsp; /* with the changed data */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 08:33:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-entire-row-in-a-dataset-with-change-in-one/m-p/297699#M62556</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-12T08:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to repeat the entire row in a dataset with change in one variable based on a condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-entire-row-in-a-dataset-with-change-in-one/m-p/297714#M62557</link>
      <description>&lt;P&gt;Data want;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;Output;&lt;/P&gt;
&lt;P&gt;If duration le 4 then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Basefund=’add_silver’;&amp;nbsp;&amp;nbsp; output’&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Basefund=’silver’;&amp;nbsp;&amp;nbsp; output’&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Basefund=’add_gold’;&amp;nbsp;&amp;nbsp; output’&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Basefund=’bronze’;&amp;nbsp;&amp;nbsp; output’&lt;/P&gt;
&lt;P&gt;End;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;JIm&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 11:19:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-repeat-the-entire-row-in-a-dataset-with-change-in-one/m-p/297714#M62557</guid>
      <dc:creator>Jim_G</dc:creator>
      <dc:date>2016-09-12T11:19:09Z</dc:date>
    </item>
  </channel>
</rss>

