title: Want to extract the first letter of each word
body: <p>I basically have a variable <code>COUNTRY</code> along with variables <code>SUBJID</code> and <code>TREAT</code> and I want to concatenate it like this <em>ABC002-123 /NZ/ABC</em>. </p>
  
  <p>Suppose if the COUNTRY variable had the value 'New Zealand'. I want to extract the first letter of each word, But I want extract only the first two letters of the value when there is only one word in the COUNTRY variable. I wanted a to know how to simply the below code. If possible in <strong>perl programming</strong>.</p>
  
  <pre><code>If COUNTW(COUNTRY) GT 1 THEN 
    CAT_VAR=
     UPCASE(SUBJID||"/"||CAT(SUBSTR(SCAN(COUNTRY,1,'     '),1,1),
                   SUBSTR(SCAN(COUNTRY,2,' '),1,1))||"/"||TREAT);
  </code></pre>