I am using encode to convert string variables into numeric, e.g. "NA" might get encoded to 0 or leave it blank instead. Would appreciate your help getting the right command for this.

I have the below variable issue!
Code:
tab Dividendyield if missing(real( Dividendyield ))

  Dividend yield  |      Freq.     Percent        Cum.
------------------+-----------------------------------
             n.a. |        180      100.00      100.00
------------------+-----------------------------------
            Total |        180      100.00