Dear Stata Members
I have an issue which I know is the most answered questions in this form, I tried using some past posts but to no avail. My issue is reproduced. Incorp is the variable from which I need to extract year


Code:
describe incorp

Variable      Storage   Display    Value
    name         type    format    label      Variable label
------------------------------------------------------------------------------------------------------------------
incorp          str9    %9s
.

Code:
list incorp in 1/40

     +-----------+
     |    incorp |
     |-----------|
  1. |           |
  2. |           |
  3. |           |
  4. |           |
  5. |           |
     |-----------|
  6. |           |
  7. |           |
  8. |           |
  9. |           |
 10. |           |
     |-----------|
 11. |           |
 12. |           |
 13. |           |
 14. |           |
 15. |           |
     |-----------|
 16. |           |
 17. |           |
 18. |           |
 19. |           |
 20. |           |
     |-----------|
 21. |           |
 22. |           |
 23. | 05-May-86 |
 24. | 05-May-86 |
 25. | 05-May-86 |
     |-----------|
 26. | 05-May-86 |
 27. | 05-May-86 |
 28. | 05-May-86 |
 29. | 05-May-86 |
 30. | 05-May-86 |
     |-----------|
 31. | 05-May-86 |
 32. | 05-May-86 |
 33. | 05-May-86 |
 34. | 05-May-86 |
 35. | 05-May-86 |
     |-----------|
 36. | 05-May-86 |
 37. | 05-May-86 |
 38. | 05-May-86 |
 39. | 05-May-86 |
 40. | 05-May-86 |
     +-----------+

I tried using
Code:
generate numyear = date(incorp, "MDY")
(408,405 missing values generated)
but
Code:
. mdesc numyear

    Variable    |     Missing          Total     Percent Missing
----------------+-----------------------------------------------
        numyear |     408,405        408,405         100.00
----------------+-----------------------------------------------
My issue is to extract 1986 if the year is 05-May-86. That is the calendar year. How to do that