program lp_merge
set more off
* `1' -- name of the variable
* `2' -- max of cid

local iterate = 1
 while `iterate'<`2' {
       use `1'`iterate'.dta, clear
	 local j=`iterate'+1
	 append using `1'`j'.dta
	 save `1'`j'.dta, replace
	 local iterate=`iterate'+1
	}
	 sort id date
	 save `1'_a, replace
end