<?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: Spilt a number into that many number of rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622966#M183300</link>
    <description>&lt;P&gt;This is not the what i wanted. In this the Exposure count stops after 250.&lt;/P&gt;&lt;P&gt;What I want is, for example taking 1st row from the &lt;STRONG&gt;Data Have&lt;/STRONG&gt;, I want 45690 rows, where 1st Column has Name A, then 2nd column is Exposure having value 1(45690 times) and 3rd column as Count, where Count value is 1, but apprears only in the 1st 250 rows and for remaining rows (till row number 45690) has value 0.&lt;/P&gt;&lt;P&gt;I hope I made sense to my problem statement?&lt;/P&gt;</description>
    <pubDate>Fri, 07 Feb 2020 07:53:07 GMT</pubDate>
    <dc:creator>Pumpp</dc:creator>
    <dc:date>2020-02-07T07:53:07Z</dc:date>
    <item>
      <title>Spilt a number into that many number of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622948#M183294</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Below is the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Exposure&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;45690&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;3320&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;12356&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;73987&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;5467&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want is to create a new dataset, where it spilts the exposure value into that many number of rows. For eg, i want to create a table with Name and Exposure as coloums, and create 45690 rows having exposure value of 1 each and Name A for each row, then next i want to have 3320 rows with Exposure value 1 each and Name B for those corresponding values, similarly 12356 rows for Name C and etc.&lt;/P&gt;&lt;P&gt;Can anyone help me with this?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 06:38:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622948#M183294</guid>
      <dc:creator>Pumpp</dc:creator>
      <dc:date>2020-02-07T06:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Spilt a number into that many number of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622949#M183295</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/310998"&gt;@Pumpp&lt;/a&gt;&amp;nbsp;Hi and welcome to the SAS Community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sure thing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Name $ Exposure;
datalines;
A	45690
B	3320
C	12356
D	73987
E	5467
;

data want(drop=_);
   set have(rename=Exposure=_);
   Exposure=1;
   do _N_=1 to _;
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Feb 2020 06:41:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622949#M183295</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-02-07T06:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Spilt a number into that many number of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622950#M183296</link>
      <description>&lt;DIV class="sasError"&gt;Thank you very much. This was of great help.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 07 Feb 2020 07:03:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622950#M183296</guid>
      <dc:creator>Pumpp</dc:creator>
      <dc:date>2020-02-07T07:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Spilt a number into that many number of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622951#M183297</link>
      <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 07:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622951#M183297</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-02-07T07:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Spilt a number into that many number of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622964#M183298</link>
      <description>&lt;P&gt;With regards to the same subject.&lt;/P&gt;&lt;P&gt;Now my data is&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Exposure&lt;/TD&gt;&lt;TD&gt;Count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;45690&lt;/TD&gt;&lt;TD&gt;250&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;3320&lt;/TD&gt;&lt;TD&gt;120&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;12356&lt;/TD&gt;&lt;TD&gt;354&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;73987&lt;/TD&gt;&lt;TD&gt;456&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;5467&lt;/TD&gt;&lt;TD&gt;90&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I want to do the same thing, but 3rd coloum as Count included.&lt;/P&gt;&lt;P&gt;For example, Exposure has 45690 rows with values 1 each and Name A corresponding to that. What i want is a 3rd coloum as Count but only 250 rows having value 1 and remaining rows should have value is 0. Then do the same for Name B, but only 120 rows having count as 1 and remaining counts as 0.&lt;/P&gt;&lt;P&gt;What do I do for this?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 07:38:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622964#M183298</guid>
      <dc:creator>Pumpp</dc:creator>
      <dc:date>2020-02-07T07:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Spilt a number into that many number of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622965#M183299</link>
      <description>&lt;P&gt;Small change&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Name $ Exposure Count;
datalines;
A 45690 250
B 3320  120
C 12356 354
D 73987 456
E 5467  90 
;

data want(drop=_);
   set have(rename=Exposure=_);
   Exposure=1;
   do _N_=1 to _;
      Exposure = _N_ &amp;lt;= Count;
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Feb 2020 07:42:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622965#M183299</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-02-07T07:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Spilt a number into that many number of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622966#M183300</link>
      <description>&lt;P&gt;This is not the what i wanted. In this the Exposure count stops after 250.&lt;/P&gt;&lt;P&gt;What I want is, for example taking 1st row from the &lt;STRONG&gt;Data Have&lt;/STRONG&gt;, I want 45690 rows, where 1st Column has Name A, then 2nd column is Exposure having value 1(45690 times) and 3rd column as Count, where Count value is 1, but apprears only in the 1st 250 rows and for remaining rows (till row number 45690) has value 0.&lt;/P&gt;&lt;P&gt;I hope I made sense to my problem statement?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 07:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622966#M183300</guid>
      <dc:creator>Pumpp</dc:creator>
      <dc:date>2020-02-07T07:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Spilt a number into that many number of rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622986#M183307</link>
      <description>&lt;P&gt;Your answer was actually helpful, I modified the code a bit and got my desired output.&lt;/P&gt;&lt;P&gt;Thankyou.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 09:46:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spilt-a-number-into-that-many-number-of-rows/m-p/622986#M183307</guid>
      <dc:creator>Pumpp</dc:creator>
      <dc:date>2020-02-07T09:46:14Z</dc:date>
    </item>
  </channel>
</rss>

