title: SAS : How do I find nth instance of a character/group of characters within a string?
body: <p>I'm trying to find a function that will index the nth instance of a character(s).</p>
  
  <p>For example, if I have the string <code>ABABABBABSSSDDEE</code> and I want to find the 3rd instance of <code>A</code>, how do I do that? What if I want to find the 4th instance of <code>AB</code></p>
  
  <p>ABAB<strong>A</strong>BB<strong>AB</strong>SSSDDEE</p>
  
  <pre><code>data HAVE;
     input STRING $;
     datalines;
  ABABABBASSSDDEE
  ;
  RUN;
  </code></pre>