Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[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 <>
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: )

Hope this helps,

Maarten L. Buis
Reichpietschufer 50
10785 Berlin
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index