<?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: Loop in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Loop/m-p/843952#M333646</link>
    <description>&lt;P&gt;Show the code you tried.&lt;/P&gt;
&lt;P&gt;Show the result you want.&lt;/P&gt;
&lt;P&gt;Take the time to convert the data into code that create a dataset so those that want to help don't have to type in your numbers.&lt;/P&gt;
&lt;P&gt;Notice it is not actually any more work than you already did to post the listing of the data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input Customer_num Current_bads Total_bads;
cards;
19 19 41
10 10 31
25 25  6
20  6  0
30  0  0
15  0  0
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 12 Nov 2022 20:31:39 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-11-12T20:31:39Z</dc:date>
    <item>
      <title>Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loop/m-p/843950#M333644</link>
      <description>I want to create a dataset that have three variables(customer_num, total_bads, and current_bads). For every observation I want current_bads =customer_num and total_bads is then deducted by the number of current_bads until total_bads =0&lt;BR /&gt;&lt;BR /&gt;For example(the initial total_bads is 60):&lt;BR /&gt;Customer_num Current_bads Total_bads&lt;BR /&gt;19 19 41&lt;BR /&gt;10 10 31&lt;BR /&gt;25 25 6&lt;BR /&gt;20 6 0&lt;BR /&gt;30 0 0&lt;BR /&gt;15 0 0&lt;BR /&gt;&lt;BR /&gt;I am trying to use loop but my code doesn’t stop when total_bads reaches 0.&lt;BR /&gt;&lt;BR /&gt;Can someone help me with it? Thank you such!</description>
      <pubDate>Sat, 12 Nov 2022 20:04:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loop/m-p/843950#M333644</guid>
      <dc:creator>hunluuu947</dc:creator>
      <dc:date>2022-11-12T20:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loop/m-p/843952#M333646</link>
      <description>&lt;P&gt;Show the code you tried.&lt;/P&gt;
&lt;P&gt;Show the result you want.&lt;/P&gt;
&lt;P&gt;Take the time to convert the data into code that create a dataset so those that want to help don't have to type in your numbers.&lt;/P&gt;
&lt;P&gt;Notice it is not actually any more work than you already did to post the listing of the data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input Customer_num Current_bads Total_bads;
cards;
19 19 41
10 10 31
25 25  6
20  6  0
30  0  0
15  0  0
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 12 Nov 2022 20:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loop/m-p/843952#M333646</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-12T20:31:39Z</dc:date>
    </item>
  </channel>
</rss>

