title: How to identify two rows with same characters at first stream
body: <p>I want to create a indicator variable, "same_first_two_nearby". That indicates that the first two characters of observations are equal to the nearby observations. I try to use the "duplication method", but I fail. Because the method can only "delete" the duplication but not keep.</p>
  
  <pre><code>PROC SORT data=temp NODUPKEY;
   BY customer_IN;
  RUN; 
  </code></pre>
  
  <p>The example of my data is as following.</p>
  
  <pre><code>data temp;
  input  customer_IN $ 1-8 ;
  cards;
  ADJOHN. 
  ADMARY.  
  ADjerry.  
  BWABBY.   
  CFLUCY.   
  CFLINDA.   
  EFLAGNA.  
  KTPAKAO.   
  KTWANDA.    
  ;
  run;
  proc print data=temp;run;
  </code></pre>
  
  <p>I want to generate the results as the following.</p>
  
  <pre><code>customer_IN  same_first_two_nearby
      ADJOHN.                      1
      ADMARY.                      1 
      ADjerry.                     1 
      BWABBY.                      0 
      CFLUCY.                      1 
      CFLINDA.                     1 
      EFLAGNA.                     0 
      KTPAKAO.                     1 
      KTWANDA.                     1 
  </code></pre>
  
  <p>Thanks in advance.</p>