<?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 Could you please help me understand how the code runs in background? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Could-you-please-help-me-understand-how-the-code-runs-in/m-p/630565#M20830</link>
    <description>&lt;P&gt;I am trying to understand how the code runs in the loop to generate the desired outcome:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Zero_Returns; *calculating number of incidents of zero returns everyday;
set HUF;			*and number of zero returns in each of those incidents;
by Date Return notsorted;

if first.Date then Incident_No= 0;
if first.Return then Consecutive_Zero= 1;
else Consecutive_Zero+1;
if last.Return;
if Return= 0;
Incident_No+1;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Mar 2020 03:05:16 GMT</pubDate>
    <dc:creator>d6k5d3</dc:creator>
    <dc:date>2020-03-09T03:05:16Z</dc:date>
    <item>
      <title>Could you please help me understand how the code runs in background?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Could-you-please-help-me-understand-how-the-code-runs-in/m-p/630565#M20830</link>
      <description>&lt;P&gt;I am trying to understand how the code runs in the loop to generate the desired outcome:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Zero_Returns; *calculating number of incidents of zero returns everyday;
set HUF;			*and number of zero returns in each of those incidents;
by Date Return notsorted;

if first.Date then Incident_No= 0;
if first.Return then Consecutive_Zero= 1;
else Consecutive_Zero+1;
if last.Return;
if Return= 0;
Incident_No+1;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Mar 2020 03:05:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Could-you-please-help-me-understand-how-the-code-runs-in/m-p/630565#M20830</guid>
      <dc:creator>d6k5d3</dc:creator>
      <dc:date>2020-03-09T03:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Could you please help me understand how the code runs in background?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Could-you-please-help-me-understand-how-the-code-runs-in/m-p/630574#M20832</link>
      <description>&lt;P&gt;Please provide, in the form of a sas DATA step, a sample of your data.&amp;nbsp;&amp;nbsp; And an example of what you expect the output to look like.&amp;nbsp; Your question has too many ambiguities for me to feel I understand it properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Help us help you.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 04:38:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Could-you-please-help-me-understand-how-the-code-runs-in/m-p/630574#M20832</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-03-09T04:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Could you please help me understand how the code runs in background?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Could-you-please-help-me-understand-how-the-code-runs-in/m-p/630575#M20833</link>
      <description>&lt;P&gt;Same logic just not using sub-setting IF. Does this make it better understandable for you?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/** 
calculating number of incidents of zero returns everyday
and number of zero returns in each of those incidents 
**/
data Zero_Returns;
  set HUF;
  by Date Return notsorted;
  if first.Date then Incident_No= 0;
  if first.Return then Consecutive_Zero= 1;
  else Consecutive_Zero+1;
  if last.Return and Return= 0 then
    do;
      Incident_No+1;
      output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 04:46:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Could-you-please-help-me-understand-how-the-code-runs-in/m-p/630575#M20833</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-09T04:46:52Z</dc:date>
    </item>
  </channel>
</rss>

