<?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: Inserting multiple blank rows into a table or dataset on a condition in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362357#M274826</link>
    <description>&lt;P&gt;What's the logic here? Are you trying to create a continous dataset with all months for all years?&lt;/P&gt;
&lt;P&gt;If so, search for PRELOADFMT on here and you'll find the best solutions on how to include the missing data you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FYI In the future please post your data as text, especially if you want code. I'm not typing out your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/130900"&gt;@Akarsh91&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Dear People,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to know how can I insert multiple blank rows into a sas table &amp;nbsp;based on a condition. I have the following:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9112i8448C74B7EF68044/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Capture1.PNG" title="Capture1.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to do the following:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the month is equal to 1 then I want to insert 11 blank rows after the row where month is equal to 1. If the month is 8 for example then I want to insert 4 blank rows after the row where month is equal to 4 and so on such that the total doesn't exceed 12 months. I am not able to figure out what code to use in order to accomplish this task. Could anyone please help me by providing a code &amp;nbsp;that could accomplish the above task? If you need more information, please ask. Would appreciate your help. I am using sas version 9.4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Akarsh&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 28 May 2017 20:41:36 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-05-28T20:41:36Z</dc:date>
    <item>
      <title>Inserting multiple blank rows into a table or dataset on a condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362347#M274824</link>
      <description>&lt;P&gt;Dear People,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know how can I insert multiple blank rows into a sas table &amp;nbsp;based on a condition. I have the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9112i8448C74B7EF68044/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Capture1.PNG" title="Capture1.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to do the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the month is equal to 1 then I want to insert 11 blank rows after the row where month is equal to 1. If the month is 8 for example then I want to insert 4 blank rows after the row where month is equal to 4 and so on such that the total doesn't exceed 12 months. I am not able to figure out what code to use in order to accomplish this task. Could anyone please help me by providing a code &amp;nbsp;that could accomplish the above task? If you need more information, please ask. Would appreciate your help. I am using sas version 9.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;Akarsh&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2017 19:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362347#M274824</guid>
      <dc:creator>Akarsh91</dc:creator>
      <dc:date>2017-05-28T19:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting multiple blank rows into a table or dataset on a condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362353#M274825</link>
      <description>&lt;P&gt;You can create a nwe dataset by:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 set have;
       array all_n _numeric_;
       output;
       if month &amp;lt; 12 then
         do i=month +1 to 12; 
              call missing(all_n:);
              month = i;  /* all missing except month ? */
              output; 
        end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 May 2017 20:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362353#M274825</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-05-28T20:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting multiple blank rows into a table or dataset on a condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362357#M274826</link>
      <description>&lt;P&gt;What's the logic here? Are you trying to create a continous dataset with all months for all years?&lt;/P&gt;
&lt;P&gt;If so, search for PRELOADFMT on here and you'll find the best solutions on how to include the missing data you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FYI In the future please post your data as text, especially if you want code. I'm not typing out your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/130900"&gt;@Akarsh91&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Dear People,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to know how can I insert multiple blank rows into a sas table &amp;nbsp;based on a condition. I have the following:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9112i8448C74B7EF68044/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Capture1.PNG" title="Capture1.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to do the following:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the month is equal to 1 then I want to insert 11 blank rows after the row where month is equal to 1. If the month is 8 for example then I want to insert 4 blank rows after the row where month is equal to 4 and so on such that the total doesn't exceed 12 months. I am not able to figure out what code to use in order to accomplish this task. Could anyone please help me by providing a code &amp;nbsp;that could accomplish the above task? If you need more information, please ask. Would appreciate your help. I am using sas version 9.4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Akarsh&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2017 20:41:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362357#M274826</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-28T20:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting multiple blank rows into a table or dataset on a condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362361#M274827</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What the OP has is apparently a list of PERMNO's (stock id's) with data for the last month the given stock is&amp;nbsp;publically listed on a major american stock exchange.&amp;nbsp; The "Names Date" is the delisting date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suppose that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/130900"&gt;@Akarsh91&lt;/a&gt;&amp;nbsp;wants to create complete calendar year history for the delisted stocks - possibly to have all stocks with the same set of records, even if some records are dummy records.&amp;nbsp;&amp;nbsp; Presumarby he/she already has monthly stock data preceding the delisting events.&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2017 21:07:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362361#M274827</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-05-28T21:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting multiple blank rows into a table or dataset on a condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362364#M274828</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes. I have Permno's and the stocks are delisted on the date that is mentioned. My main goal however is to replace the returns of with corresponding size decile returns (which I have) until the end of the year. For instance, the average size decile return is 0.02. The stock gets delisted on february 1984. From march 1984 to december 1984 the stock will be assigned the return of 0.02. The stock won't be taken into consideration after 1984. To accomplish this, i thought to &amp;nbsp;put empty rows as mentioned above in my original post and then replace the returns with the corresponding size decile returns. If you think there are more better or optimal ways to accomplish this task, please help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;Akarsh&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2017 21:26:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362364#M274828</guid>
      <dc:creator>Akarsh91</dc:creator>
      <dc:date>2017-05-28T21:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting multiple blank rows into a table or dataset on a condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362365#M274829</link>
      <description>&lt;P&gt;Create the dataset with the dates and values you want and insert those (via proc append) and the sort to get your desired order.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2017 21:32:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inserting-multiple-blank-rows-into-a-table-or-dataset-on-a/m-p/362365#M274829</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-28T21:32:34Z</dc:date>
    </item>
  </channel>
</rss>

