Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Attaching a set of local macros to a dataset
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: Attaching a set of local macros to a dataset
Date
Mon, 5 Nov 2012 13:23:02 +0100
On Mon, Nov 5, 2012 at 12:09 PM, Amadou DIALLO wrote:
> I thought of char:
> char _dta[one] `macro1'
> but in the created pr file, I can't find a way to put back the
> contents of the char into a local macro. The command:
> loc macro1 `_dta[one]
> is not working.
*------------- begin example ---------------
sysuse auto
// add the characteristics
char _dta[foo] "hello world"
// save the file
tempfile temp
save `temp'
// load the file
use `temp'
// put the characteristic in local macro bar
local bar : char _dta[foo]
// display the content of local macro bar
di "`bar'"
*-------------- end example ----------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )
Hope this helps,
Maarten
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany
http://www.maartenbuis.nl
---------------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/