title: SAS: Wildcard characters in IF statements
body: <p>I have a dataset with patient diagnosis codes, and I need to use wildcard characters to categorize their diagnoses.</p>
  
  <pre><code>patientID diagnosis cancer age gender 
  1         250.0      0     65    M     
  1         250.00     1     65    M     
  2         250.01     1     23    M     
  2         250.02     0     23    M     
  3         250.11     0     50    F     
  3         250.12     0     50    F
  4.        513.01.    1     34    M
  </code></pre>
  
  <p>Diagnoses with the 5th character as 0 or 2 need to be classified as type 2 diabetes, and those ending in 1 and 3 need to be classified as type 1 diabetes. However, 250.0 only has 4 characters and needs to be classified as type 2. </p>
  
  <p>This in the data step doesn't work</p>
  
  <pre><code>if diagnosis_code ='250.%0' then t2dm = 1;
  if diagnosis_code ='250.%1' then t1dm = 1;
  </code></pre>