<?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 view the result of a loop in SAS? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-view-the-result-of-a-loop-in-SAS/m-p/740354#M231258</link>
    <description>&lt;P&gt;Here are a few ways, the method depends on what you're trying to do next:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Move the OUTPUT line to within the loop to create an output record for each iteration of the loop&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Use the &lt;A href="https://blogs.sas.com/content/sasdummy/2016/11/30/data-step-debugger-sas-eg/" target="_self"&gt;debugger&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Use a PUT statement in the loop to show variables values&lt;/LI&gt;
&lt;/UL&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;This is my code, it runs successfully; it gives me only a line. How to view the increase year by year:&lt;/P&gt;
&lt;PRE&gt;data salyr;  
input salary year;  
cards;  
134 2019  
run;

data increaseit;
set salyr;
do until (salary gt 1000);
salary = salary + salary * 0.06;
year = year + 1;
end;
output;
Run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Blue Blue&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 May 2021 03:02:03 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-05-11T03:02:03Z</dc:date>
    <item>
      <title>How to view the result of a loop in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-view-the-result-of-a-loop-in-SAS/m-p/740352#M231256</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;This is my code, it runs successfully; it gives me only a line. How to view the increase year by year:&lt;/P&gt;
&lt;PRE&gt;data salyr;  
input salary year;  
cards;  
134 2019  
run;

data increaseit;
set salyr;
do until (salary gt 1000);
salary = salary + salary * 0.06;
year = year + 1;
end;
output;
Run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Blue Blue&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 May 2021 02:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-view-the-result-of-a-loop-in-SAS/m-p/740352#M231256</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-05-11T02:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to view the result of a loop in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-view-the-result-of-a-loop-in-SAS/m-p/740354#M231258</link>
      <description>&lt;P&gt;Here are a few ways, the method depends on what you're trying to do next:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Move the OUTPUT line to within the loop to create an output record for each iteration of the loop&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Use the &lt;A href="https://blogs.sas.com/content/sasdummy/2016/11/30/data-step-debugger-sas-eg/" target="_self"&gt;debugger&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Use a PUT statement in the loop to show variables values&lt;/LI&gt;
&lt;/UL&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;This is my code, it runs successfully; it gives me only a line. How to view the increase year by year:&lt;/P&gt;
&lt;PRE&gt;data salyr;  
input salary year;  
cards;  
134 2019  
run;

data increaseit;
set salyr;
do until (salary gt 1000);
salary = salary + salary * 0.06;
year = year + 1;
end;
output;
Run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Blue Blue&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 03:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-view-the-result-of-a-loop-in-SAS/m-p/740354#M231258</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-05-11T03:02:03Z</dc:date>
    </item>
  </channel>
</rss>

