title: Extract parts of a string after a key word in SAS EG
body: <p>I am attempting to extract parts of a string with carriage returns based on a keyword in SAS eg. </p>
  
  <pre><code>Str="started manually 23:56:22
  Skipped: obtain name
  Completed: verify dob
  Skipped: ask again
  Skipped: verify address 
  Completed: verify country
  Stopped manually 23:58:55"
  </code></pre>
  
  <p>I am trying to pull out parts of this based on <code>Skipped</code> or <code>Completed</code>.
  So if i ask for Skipped i would want end result to be, including carriage return:</p>
  
  <pre><code>Obtain name
  Ask again
  Verify address
  </code></pre>
  
  <p>I am thinking I would need to loop to find each instance of skipped. I have tried different variations of SCAN,FIND,INDEX,SUBSTR. </p>
  
  <p>I have extracted substring before but only when the string was consistent in character/word position.
  This string will very greatly. Any number of skipped or completed could be present with different start and end wording.
  I am working in SASeg.</p>