title: Substring the last digits of a numeric variable in SAS
body: <p>I have a numeric variable in SAS and I am struggling to extract the last digits of it. I tried using <code>substr</code> but it only handles <code>char</code> variables. The variable I have sometimes has 3 or 4 digits.</p>
  
  <p>Example</p>
  
  <pre><code>1234
   237
   754
  9000
  </code></pre>
  
  <p>In these cases I need to extract</p>
  
  <pre><code>34
  37
  54
  00
  </code></pre>
  
  <p>And store them as a new numeric variable. I tried the code bellow in a <code>proc sql</code> statement but it returns and error. Can someone help me?</p>
  
  <pre><code> Var2 =   input(substr(put(var1), 1, length(put(var1))-1), 8.)
  </code></pre>