Svend & Mosca:
You may want to go one additional step...
After constructing year,
> gen x = strpos(datetime," ")
> gen year = substr(datetime, x-4, 4)
>
year is obviously a string variable. If this does not suit your purposes, then
destring year, replace
should do it for you.
EGW
--
===================================================
Eric G. Wruck
Econalytics
2535 Sherwood Road
Columbus, OH 43209
ph: 614.231.5034
cell: 614.330.8846
eFax: 614.573.6639
eMail: [email protected]
website: http://www.econalytics.com
====================================================
*
* 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/