Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: date function error?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: date function error?
Date   Thu, 12 Jun 2008 17:49:54 +0100

No Stata error here, just a subtle misunderstanding. 

Step 1. Stata substitutes macro names by their contents. 

Step 2. -display- sees 12Jun and tries to make sense of it but fails.
12Jun is not a number, nor a variable name, nor a scalar name. 

Solution: You need to spell out to Stata that you are dealing with a
string. 

. di "$S_DATE" 

does that. 

Nick 
[email protected] 

Hoffman, George


i've got stata 10 on win32, and have been troubled by an error in the
date function:

. di $S_DATE
12Jun not found
r(111);


*
*   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/



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