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

Re: st: mata stata() parameters

From   Phil Schumm <>
Subject   Re: st: mata stata() parameters
Date   Wed, 22 Aug 2007 14:40:30 -0500

On Aug 22, 2007, at 2:14 PM, Sergiy Radyakin wrote:
stata("local _AAA=month(d(`c(current_date)'))",1,1)

This code produces the result I want, e.g. mc becomes equal to 8.
However, after compiling the procedure into an .mo file, I can see
that the call is stored as:

local _AAA=month(d(22 Aug 2007))

note that 22 Aug 2007 is today's date. There seems to be no difference
whether I specify no-macro-expansion parameter or not.

Where is a mistake?

Sorry, I didn't tell you your mistake, though you've pretty much figured it out for yourself. In Mata, macro expansion is performed at compile-time, not at run-time. For more info, see


-- Phil

* For searches and help try:

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