<?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 check the sequence of occurrence in a list in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-the-sequence-of-occurrence-in-a-list/m-p/291918#M19926</link>
    <description>&lt;P&gt;Well, I think it's possible, but it's complicated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Using Query Builder, select everything from your table. Create a new advanced expression, and make the expression&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; monotonic()&lt;/P&gt;
&lt;P&gt;This is an unsupported function that will add the row number to the record. Let's call it SeqNo for the rest of this example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Do the following for both streams, Auto and Housing:&lt;/P&gt;
&lt;P&gt;2.1 Select only the records for Auto&lt;/P&gt;
&lt;P&gt;2.2 For this table, do a summarized query, keeping CustNo, the min of SeqNo, and the max of SeqNo.&lt;/P&gt;
&lt;P&gt;2.3 Do the same two steps for Housing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Create a new query on the result of 2.2, and do a full outer join to the result of 2.3, joining on CustNo. This should give you a dataset with the CustNo, min and max of SeqNo for Auto, and min and max of SeqNo for Housing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. With this, create a query. Create your variables Auto_then_Housing and Housing_then_Auto as advanced expressions, where you'll use a Case function to compare the variables. For Auto_then_Housing I used this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;CASE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;WHEN&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; (t1.MIN_of_SeqNo_Auto &amp;lt; t1.MAX_of_SeqNo_Housing) &amp;amp; ^missing(t1.MIN_of_SeqNo_Auto)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;THEN&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ELSE&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;END&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000" face="arial,helvetica,sans-serif" size="2"&gt;&lt;FONT size="2"&gt;&lt;FONT size="2"&gt;and for Housing_then_Auto&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;CASE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;WHEN&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; (t1.MIN_of_SeqNo_Housing &amp;lt; t1.MAX_of_SeqNo_Auto) &amp;amp; ^missing(t1.MIN_of_SeqNo_Housing)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;THEN&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ELSE&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;END&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Aug 2016 14:46:24 GMT</pubDate>
    <dc:creator>TomKari</dc:creator>
    <dc:date>2016-08-16T14:46:24Z</dc:date>
    <item>
      <title>How to check the sequence of occurrence in a list</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-the-sequence-of-occurrence-in-a-list/m-p/291153#M19865</link>
      <description>&lt;P&gt;&lt;FONT color="#333333"&gt;Hi everyone.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;I have the following list:&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;&lt;BR /&gt;CustNo. &amp;nbsp; &amp;nbsp; &amp;nbsp; LoanType&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Auto&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Housing&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;002 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Housing&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;002 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Auto&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Auto&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Housing&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Auto&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;004 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Housing&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;004 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Auto&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;004 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Housing&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;005 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Auto&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;005 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Auto&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;005 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Housing&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;006 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Housing&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;006 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Auto&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;006 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Auto&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;Expected Output:&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;CustNo. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AutoThenHousing? HousingThenAuto?&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;001 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;002 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;004 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;005 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;006 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;As you can see, I want to check the order of loan availment (i.e. auto first then housing? or housing first then auto?) Take note also that there are cases wherein a customer availed multiple loans like 003 and 004. For these customers, both categories are true.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#333333"&gt;Hope you can guide me on how to implement this in EG.Thanks.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 06:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-the-sequence-of-occurrence-in-a-list/m-p/291153#M19865</guid>
      <dc:creator>avalanche</dc:creator>
      <dc:date>2016-08-12T06:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the sequence of occurrence in a list</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-the-sequence-of-occurrence-in-a-list/m-p/291614#M19887</link>
      <description>&lt;P&gt;Are you comfortable running some code in a code window, or do you need to completely use the EG tasks to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2016 21:43:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-the-sequence-of-occurrence-in-a-list/m-p/291614#M19887</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2016-08-14T21:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the sequence of occurrence in a list</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-the-sequence-of-occurrence-in-a-list/m-p/291618#M19888</link>
      <description>Hi Tom. I would prefer to use EG please. Thanks.</description>
      <pubDate>Mon, 15 Aug 2016 00:01:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-the-sequence-of-occurrence-in-a-list/m-p/291618#M19888</guid>
      <dc:creator>avalanche</dc:creator>
      <dc:date>2016-08-15T00:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the sequence of occurrence in a list</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-the-sequence-of-occurrence-in-a-list/m-p/291637#M19889</link>
      <description>Since it seems that the sort order is important to your expected results you want a variable to keep track on the original order. Like a date or an automatically incremental loan no.&lt;BR /&gt;If that's not available to you create it as a first step in your project by calling the monotonic() function in the Query builder.&lt;BR /&gt;For you inquiry itself, it's kinda row oriented problem. So SQL based Query Builder isn't fit for the task. So my guess you need a data step program solve this. It would probably involve stuff like RETAIN, BY, first./last.- logic and explicit OUTPUT. If these are not familiar to you consider to taking the free online training SAS Programming.</description>
      <pubDate>Mon, 15 Aug 2016 04:04:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-the-sequence-of-occurrence-in-a-list/m-p/291637#M19889</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-08-15T04:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to check the sequence of occurrence in a list</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-the-sequence-of-occurrence-in-a-list/m-p/291918#M19926</link>
      <description>&lt;P&gt;Well, I think it's possible, but it's complicated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Using Query Builder, select everything from your table. Create a new advanced expression, and make the expression&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; monotonic()&lt;/P&gt;
&lt;P&gt;This is an unsupported function that will add the row number to the record. Let's call it SeqNo for the rest of this example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Do the following for both streams, Auto and Housing:&lt;/P&gt;
&lt;P&gt;2.1 Select only the records for Auto&lt;/P&gt;
&lt;P&gt;2.2 For this table, do a summarized query, keeping CustNo, the min of SeqNo, and the max of SeqNo.&lt;/P&gt;
&lt;P&gt;2.3 Do the same two steps for Housing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Create a new query on the result of 2.2, and do a full outer join to the result of 2.3, joining on CustNo. This should give you a dataset with the CustNo, min and max of SeqNo for Auto, and min and max of SeqNo for Housing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. With this, create a query. Create your variables Auto_then_Housing and Housing_then_Auto as advanced expressions, where you'll use a Case function to compare the variables. For Auto_then_Housing I used this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;CASE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;WHEN&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; (t1.MIN_of_SeqNo_Auto &amp;lt; t1.MAX_of_SeqNo_Housing) &amp;amp; ^missing(t1.MIN_of_SeqNo_Auto)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;THEN&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ELSE&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;END&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000" face="arial,helvetica,sans-serif" size="2"&gt;&lt;FONT size="2"&gt;&lt;FONT size="2"&gt;and for Housing_then_Auto&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;CASE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;WHEN&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; (t1.MIN_of_SeqNo_Housing &amp;lt; t1.MAX_of_SeqNo_Auto) &amp;amp; ^missing(t1.MIN_of_SeqNo_Housing)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;THEN&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ELSE&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;END&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 14:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-check-the-sequence-of-occurrence-in-a-list/m-p/291918#M19926</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2016-08-16T14:46:24Z</dc:date>
    </item>
  </channel>
</rss>

