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 at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: use of tempfile


From   Prakash Singh <prakashbhu@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: use of tempfile
Date   Thu, 19 Apr 2012 17:40:51 +0530

Nick I beg to differ you
I have done using stata programming what I intend to do but then I
thought why to have unnecessarily the data file which I do not want. I
ma definite about reshape and separate would not do good.

Let me try final time to explain what I am interested in doing.

suppose we use this sales1.data and do

use sales1.dta, clear
keep if sate_code==1
ren  sate_code sate_code1
ren exp_val exp_val1
ren sales_val sales_val1
save sales1_1.data, replace
.
.
.
use sales1.dta, clear
keep if sate_code==20
ren  sate_code sate_code20
ren exp_val exp_val20
ren sales_val sales_val20
save sales1_20.dta, replace

use sales1_1.data, clear
merge common_id using sales1_2.dta
save sales1_1_2.dta
.
.
.
use sales1_1_19.data, clear
merge common_id using sales1_20.dta
save sales1_1_20.dta

But this way I have 40 data file but what I am trying to in the code
posted in first mail is to have only one file finaly i.e.
sales1_1_20.dta

Thanks
Prakash
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index