title: How to get the difference of two variables, when there are missing values?
body: <p>I have two variables <code>A</code> &amp; <code>B</code>, and I want to get <code>A - B</code> for a new variable called <code>C</code>. For that I used <code>generate C = A - B</code>. But it gives some missing values in <code>C</code>, when either <code>A</code> or <code>B</code> contains missing values.</p>
  
  <p>For example, if <code>A</code> is 5000 while <code>B</code> is missing, it gives missing for <code>C</code>, even though I want <code>C</code> as 5000.</p>
  
  <p>So I want to consider those missing values as zeros &amp; get the answer. How can I do it in Stata?</p>