<?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: Help with SAS code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-code/m-p/815293#M321801</link>
    <description>&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
    <pubDate>Thu, 26 May 2022 17:57:26 GMT</pubDate>
    <dc:creator>ugly_duck_ling</dc:creator>
    <dc:date>2022-05-26T17:57:26Z</dc:date>
    <item>
      <title>Help with SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-code/m-p/815014#M321713</link>
      <description>&lt;P&gt;I have a dataset that I am required to tell SAS to output the number of observations that are dictated by the "count" variable.&lt;/P&gt;&lt;P&gt;The dataset is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data one;&lt;BR /&gt;input type $ count;&lt;BR /&gt;datalines;&lt;BR /&gt;1 2&lt;BR /&gt;2 2&lt;BR /&gt;3 1&lt;BR /&gt;4 5&lt;BR /&gt;5 3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code for that was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data two;&lt;BR /&gt;set one;&lt;BR /&gt;do i= 1 to 5;&lt;BR /&gt;if i gt count then delete;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above code is satisfactory, yet I am wondering if could re-write the code and get the same result by starting my code with the following do loop:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do i= 1 to N /* where N is a variable */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me with that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 13:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-code/m-p/815014#M321713</guid>
      <dc:creator>ugly_duck_ling</dc:creator>
      <dc:date>2022-05-25T13:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help with SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-code/m-p/815252#M321794</link>
      <description>&lt;P&gt;Is this what you mean?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
	input type $ count;
datalines;
1 2
2 2
3 1
4 5
5 3
;
run;

 
 

data two;
	set one;
	do i= 1 to count;
		output;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 16:19:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-code/m-p/815252#M321794</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-05-26T16:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help with SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-code/m-p/815293#M321801</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 17:57:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-SAS-code/m-p/815293#M321801</guid>
      <dc:creator>ugly_duck_ling</dc:creator>
      <dc:date>2022-05-26T17:57:26Z</dc:date>
    </item>
  </channel>
</rss>

