<?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: Repeat the values based on number in the variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Repeat-the-values-based-on-number-in-the-variable/m-p/794453#M254743</link>
    <description>&lt;P&gt;Do this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Num;
datalines;
1
2
3
;

data want;
   set have;
   do _N_ = 1 to Num;
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 04 Feb 2022 11:35:21 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2022-02-04T11:35:21Z</dc:date>
    <item>
      <title>Repeat the values based on number in the variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeat-the-values-based-on-number-in-the-variable/m-p/794451#M254741</link>
      <description>&lt;P&gt;I've a variable called 'num' and it has some unique values. Now I want to repeat values in the same variable based on the value. If it is 2, then I want the value 2 to be displayed 2 times. If it is 3, then I want the value 3 to be displayed 3 times in the same variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;E.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Input Dataset:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Num&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Desired dataset:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Num&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;P&gt;3&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 11:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeat-the-values-based-on-number-in-the-variable/m-p/794451#M254741</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2022-02-04T11:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Repeat the values based on number in the variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeat-the-values-based-on-number-in-the-variable/m-p/794453#M254743</link>
      <description>&lt;P&gt;Do this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Num;
datalines;
1
2
3
;

data want;
   set have;
   do _N_ = 1 to Num;
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Feb 2022 11:35:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeat-the-values-based-on-number-in-the-variable/m-p/794453#M254743</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-02-04T11:35:21Z</dc:date>
    </item>
  </channel>
</rss>

