[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: -date- creates missing values

From   "Martin Weiss" <>
To   <>
Subject   st: AW: -date- creates missing values
Date   Mon, 5 Oct 2009 22:04:09 +0200


Have you had a look at -help whatsnew9to10-, particularly "What's new in
data management"? And try both versions of this:

di date("102108", "mdy", 2010)
di date("102108", "MDY", 2010)


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Michael
Gesendet: Montag, 5. Oktober 2009 19:25
An: Statalist Statalist
Betreff: st: -date- creates missing values

Hello friends,
I recently moved a do-file from Stata 9 to 10, and the following short  
date program, instead of creating Stata dates, now creates missing  
values. It's supposed to take dates in MM/DD/YY format imported from  
an Excel .csv file, and translating them to Stata date format.

I'd appreciate any pointers/critiques on my method, or what I missed  
in the 9 to 10 upgrade...

*prep date vars, from mm/dd/yy
    foreach D of varlist d_sample1  ///
                         d_sample2 ///
      generate `D'1 = date(`D', "mdy", 2010)
      format `D'1 %d
      drop `D'
      rename `D'1 `D'

Michael McCulloch, LAc MPH PhD
Pine Street Foundation
124 Pine Street
San Anselmo, CA 94960-2674
tel:	415-407-1357
fax: 	206-338-2391

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index