This will do it:
di ceil(strpos("jan feb mar apr may jun jul aug sep oct nov dec", "oct")/4)
Sergiy Radyakin
On 2/6/08, Visintainer, Paul <[email protected]> wrote:
> Is there a date function that converts a string variable containing only the text of the month into a numeric version of the month? e.g.: X has string values October, April, December, etc. I want to create a new variable that is numeric with numbers 10, 04, 12, etc. I thought -monthly( )- would do it, but I can't seem to get the right syntax.
>
> Thanks.
>
> -p
>
>
> ______________________________________
> Paul F. Visintainer, PhD
>
> *
> * For searches and help try:
> * http://www.stata.com/support/faqs/res/findit.html
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/