<?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: do loops or do until with the by statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/328051#M62449</link>
    <description>&lt;P&gt;BY processing usually means there is something special done with each level or group, or combination of levels, of the By variable(s).&lt;/P&gt;
&lt;P&gt;You do not show anything that is dependent on a group of values.&lt;/P&gt;
&lt;P&gt;I could add a by statement to the datastep but it wouldn't add any value. If you wanted to know something like the order number within the&amp;nbsp;account value then that could use by processing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is something else other than the data shown and the rule&amp;nbsp; and desired results then there may be some value to adding by group processing.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2017 15:54:06 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-01-27T15:54:06Z</dc:date>
    <item>
      <title>do loops or do until with the by statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/327873#M62421</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with some accounts and every account may have more than one observation in the data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming a scenarion, if one of the account has 10 observations and every observation has a different stat_code which is one of the variables along with stat_dt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i want to do is to go through the first entry till the last entry of the duplicate accounts and then apply a condition&amp;nbsp;&lt;/P&gt;&lt;P&gt;on stat_code, something like if substr(stat_code, 4,1) = 'S' and every time it finds that between the first and the last observation, it outputs that entry into a seperate dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will appreciate some direction and help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--Tej&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 22:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/327873#M62421</guid>
      <dc:creator>BhararaTej</dc:creator>
      <dc:date>2017-01-26T22:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: do loops or do until with the by statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/327881#M62422</link>
      <description>&lt;P&gt;Please provide sample (in machine readable format) input and expected output data, for us to work on.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 22:42:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/327881#M62422</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-01-26T22:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: do loops or do until with the by statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/327882#M62423</link>
      <description>&lt;P&gt;I don't see anything to indicate the need for something besides a simple filter.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS loops through each one in the dataset by default, and you can implement BY group processing if it's needed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the tutorial here in how to filter&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/training/tutorial/studio/filter-tables.html" target="_blank"&gt;http://support.sas.com/training/tutorial/studio/filter-tables.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 22:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/327882#M62423</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-26T22:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: do loops or do until with the by statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/327905#M62428</link>
      <description>&lt;P&gt;Here is a sample input. I want to go through each and every account as you see there are duplicate and search for where substr(status_code,4,1) = 'L' and where ever it finds that it outputs that record.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Account&lt;/TD&gt;&lt;TD&gt;Status Code&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11112&lt;/TD&gt;&lt;TD&gt;XYZS&lt;/TD&gt;&lt;TD&gt;10th Jan 2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11112&lt;/TD&gt;&lt;TD&gt;HGJL&lt;/TD&gt;&lt;TD&gt;11th Jan 2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11112&lt;/TD&gt;&lt;TD&gt;FTYJ&lt;/TD&gt;&lt;TD&gt;12th Jan 2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11112&lt;/TD&gt;&lt;TD&gt;LKIL&lt;/TD&gt;&lt;TD&gt;13th Jan 2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;234322&lt;/TD&gt;&lt;TD&gt;PLKS&lt;/TD&gt;&lt;TD&gt;6th June 2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;234322&lt;/TD&gt;&lt;TD&gt;RTYZ&lt;/TD&gt;&lt;TD&gt;7th June 2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;234322&lt;/TD&gt;&lt;TD&gt;KJLL&lt;/TD&gt;&lt;TD&gt;8th June 2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;234322&lt;/TD&gt;&lt;TD&gt;IUYL&lt;/TD&gt;&lt;TD&gt;9th June 2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;234322&lt;/TD&gt;&lt;TD&gt;RTYZ&lt;/TD&gt;&lt;TD&gt;10th June 2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;234322&lt;/TD&gt;&lt;TD&gt;RTYZ&lt;/TD&gt;&lt;TD&gt;11th June 2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;234322&lt;/TD&gt;&lt;TD&gt;RTYZ&lt;/TD&gt;&lt;TD&gt;12th June 2016&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output should look like below as it output recoed whereever it finds that string&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;11112&lt;/TD&gt;&lt;TD&gt;HGJL&lt;/TD&gt;&lt;TD&gt;11th Jan 2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11112&lt;/TD&gt;&lt;TD&gt;LKIL&lt;/TD&gt;&lt;TD&gt;13th Jan 2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;234322&lt;/TD&gt;&lt;TD&gt;KJLL&lt;/TD&gt;&lt;TD&gt;8th June 2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;234322&lt;/TD&gt;&lt;TD&gt;IUYL&lt;/TD&gt;&lt;TD&gt;9th June 2016&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 27 Jan 2017 01:15:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/327905#M62428</guid>
      <dc:creator>BhararaTej</dc:creator>
      <dc:date>2017-01-27T01:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: do loops or do until with the by statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/327906#M62429</link>
      <description>&lt;P&gt;Did you try anything? This should be really straight forward, especially after the video example.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 01:20:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/327906#M62429</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-27T01:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: do loops or do until with the by statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/327959#M62436</link>
      <description>I know i can do the where clause but I am also looking to figure out a way to do this by "by processing"</description>
      <pubDate>Fri, 27 Jan 2017 09:48:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/327959#M62436</guid>
      <dc:creator>BhararaTej</dc:creator>
      <dc:date>2017-01-27T09:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: do loops or do until with the by statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/328051#M62449</link>
      <description>&lt;P&gt;BY processing usually means there is something special done with each level or group, or combination of levels, of the By variable(s).&lt;/P&gt;
&lt;P&gt;You do not show anything that is dependent on a group of values.&lt;/P&gt;
&lt;P&gt;I could add a by statement to the datastep but it wouldn't add any value. If you wanted to know something like the order number within the&amp;nbsp;account value then that could use by processing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is something else other than the data shown and the rule&amp;nbsp; and desired results then there may be some value to adding by group processing.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 15:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-loops-or-do-until-with-the-by-statement/m-p/328051#M62449</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-27T15:54:06Z</dc:date>
    </item>
  </channel>
</rss>

