title: DFSORT selecting duplicates when looking for only the first duplicate
body: <p>The below JCL should select the first duplicate of each record, keeping them in the same order because of "OPTION COPY" and only with the 'NETWORK' at byte 4 length 7 and '.' at byte 59 length 1, excluding records with 'TOTAL' at byte 3 length 5 and 'GRAND' at byte 3 length 5. </p>
  
  <p>It shows any record with 'NETWORK' at byte 4 length 7</p>
  
  <pre><code>//SORT EXEC PGM=ICETOOL
  //TOOLMSG DD SYSOUT=*
  //DFSMSG DD SYSOUT=*
  //IN DD DISP=SHR,DSN=INPUT.FILE
  //T1       DD DSN=&amp;&amp;T1,DISP=(MOD,PASS),SPACE=(TRK,(5,5))
  //OUT DD SYSOUT=*
  //OUTFIL DD SYSOUT=*
  //TOOLIN   DD *
  * DROP EVERYTHING WE DON'T WANT
    SELECT FROM(IN)  TO(OUT) ON(1,134,CH) USING(CTL1) FIRST
  /*
  //CTL1CNTL DD *
    OPTION COPY
    INCLUDE COND=((4,7,CH,EQ,C'NETWORK',OR,
                   59,1,CH,EQ,C'.'),AND,
                   (3,5,CH,NE,C'TOTAL',AND,
                    3,5,CH,NE,C'GRAND'))
  /*
  </code></pre>
  
  <p>If I change it the conditions for only 'NETWORK' at byte 4 length 7 it only shows 1 record, which is what I expect. The input is the same each time.</p>
  
  <pre><code>//CTL1CNTL DD *
    OPTION COPY
    INCLUDE COND=((4,7,CH,EQ,C'NETWORK'))
  /*
  </code></pre>
  
  <p>I can't figure out what the difference is that causes the other conditions to change it so it has duplicates</p>
  
  <p>2 of the comments have suggested that the issue is with the include conditions.</p>
  
  <p>I have tried the below, the first select is doing what I was doing original and the second SELECT is without the include conditions because they have already happened in the first select. There are still duplicate records with NETWORK at byte 4 length 7. The rest of the record with NETWORK are the exact same so there should only be 1.</p>
  
  <pre><code>//TOOLIN   DD *
  * DROP EVERYTHING WE DON'T WANT
    SELECT FROM(IN)  TO(T1) ON(1,133,CH) USING(CTL1) FIRST
    SELECT FROM(T1)  TO(OUT) ON(1,133,CH) USING(CTL2) FIRST
  /*
  //CTL1CNTL DD *
    OPTION COPY
      INCLUDE COND=((4,7,CH,EQ,C'NETWORK',OR,
                     59,1,CH,EQ,C'.'),AND,
                     (3,5,CH,NE,C'TOTAL',AND,
                      3,5,CH,NE,C'GRAND'))
  /*
  //CTL2CNTL DD *
    OPTION COPY
  /*
  </code></pre>