Bookmark and Share

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: Some basic help on programming


From   Prakash Singh <[email protected]>
To   [email protected]
Subject   Re: st: Some basic help on programming
Date   Tue, 17 Apr 2012 14:50:33 +0530

Thanks Kieran
Thanks every one

It worked


Thanks
Prakash

On Tue, Apr 17, 2012 at 12:39 PM, Kieran McCaul
<[email protected]> wrote:
> ...
> try this:
>
> use "level3data.dta", clear
> save "level3_9data.dta",replace
>
> local levels "4 5 6 7 8 9"
> foreach l of local levels {
> merge common_id using "level`l'data.dta"
> drop _merge
> sort common_id
>  }
> save "level3_9data.dta",replace
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Prakash Singh
> Sent: Tuesday, 17 April 2012 11:30 AM
> To: [email protected]
> Subject: Re: st: Some basic help on programming
>
> Friedrich, I have tried this change also but it is still not helping.
> I am rephrasing my problem. I have 9 data  file with name -
> level`l'data.dta - for which I  want to write  code
>
> this is how I have done
>
> local levels "3 4 5 6 7 8 9"
> foreach l of local levels {
> use "level`l'data.dta", clear
> merge common_id using "\level`=l'+1' data.dta"
> drop _merge
> sort common_id
>  }
> save "level3_9data.dta",replace
>
>
> Please help as it is really bugging me
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index