I have a series of variables with dates in string format, including a mis of M/DD/YY, MM-DD-YY, MM/DD/YYYY, MM/YYYY, and Y).
I want to find the number of values with missing or incomplete dates for each variable, so that I can create a frequency table or bar graph.

My first thought was to create a new var whose value is equal to the number of missing values with egen
Code:
egen datebcdxmis = count(datebcdx) if datebcdx == "" | length(datebcdx) < 6 | (length(datebcdx) <= 7 & substr(datebcdx,-5,1) == "/" & substr(datebcdx,-3,1) != "/")
but count doesn't include missing values.

I tried inverting the command above to count the number of non-missing/incomplete dates:
Code:
egen vmis = count(datebcdx) if !(datebcdx == "" | length(datebcdx) < 6 | (length(datebcdx) <= 7 & substr(datebcdx,-5,1) == "/" & substr(datebcdx,-3,1) != "/"))
but I'm not sure how to subtract the result from the total number of values per variable.

What's the simplest way to approach this?
Once I figure it out, I'll need to put it in a loop.

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str10(datebcdx datecnsdx) str8 datelmddx
"08/2007"    "1/29/08"  ""       
" 9/28/2008" ""         ""       
"  7/4/2009" "6/30/09"  "6/30/09"
"2006"       "9/1/09"   "9/1/09" 
" 10/3/2009" "10/3/09"  "10/3/09"
" 8/14/2006" "9/2/2006" ""       
" 8/30/2006" "8/31/10"  ""       
" 3/12/2011" "3/12/11"  ""       
" 3/30/2011" "3-30-11"  "3-30-11"
"07/2009"    ""         ""       
end