Patricia Vera Rojas wrote:
> I have three numeric variables :
>
> X Y Z
> 5 8 2003
> 10 1 2003
>
> I want to generate a date variable in %d format
>
> X Y Z date
> 5 8 2003 05aug2003
> 10 1 2003 10jan2003
. clear
. input X Y Z
X Y Z
1. 5 8 2003
2. 10 1 2003
3. end
. g edate=mdy(Y,X,Z)
. format edate %d
. l
+---------------------------+
| X Y Z edate |
|---------------------------|
1. | 5 8 2003 05aug2003 |
2. | 10 1 2003 10jan2003 |
+---------------------------+
Take a look at [U] 27 (Commands for dealing with dates) for more on this.
CLIVE NICHOLAS |t: 0(044)7903 397793
Politics |e: [email protected]
Newcastle University |http://www.ncl.ac.uk/geps
Whereever you go and whatever you do, just remember this. No matter how
many like you, admire you, love you or adore you, the number of people
turning up to your funeral will be largely determined by local weather
conditions.
*
* 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/