I was really hoping there were different date format macros for the
"current date" that I did not know exist. But the suggestions provided
are helpful.
Thanks
On Fri, Jun 20, 2008 at 12:07 PM, Nick Cox <[email protected]> wrote:
> Some small confusion here. The global macro in question is called S_DATE
> and thus is referenced by $S_DATE: in fact it is usually better quoted
> as "$S_DATE" . It is an old-style equivalent of c(current_date).
>
> The strict answer to Raphael's question is that you can re-define this
> macro to be without spaces, but it is better to display a copy that
> does not contain the spaces.
>
> As Svend's suggestion implies, this can be done via
>
> subinstr("$S_DATE", " ", "", .)
>
> Nick
> [email protected]
>
> Svend Juul
>
> Raphael wrote:
>
> The macro $_DATE displays current as 20 Jun 2008. I am looking for a
> simply way to remove the spaces.
> That is, 20Jun2008.
>
> =====================================================================
>
> I did not succeed with $_DATE, but with c(current_date) it is:
>
> . local z = subinstr(c(current_date) , " " , "" , .)
> . display "`z'"
> 20Jun2008
>
>
> *
> * 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/