Dear all,

I am using this code to reshape data. It does reshape but the date order of the original file gets altered. i want to reshape but keep the order of date and entity intact. Kindly help me to update this code:

foreach var of varlist * {
local j = "`: variable l `var''"
local newname = strtoname("`j'", 1)
rename `var' V_`newname'
}

destring,replace
generate id = _n
reshape long V_ , i(id) j(dat) string
list, sepby(id)

Thanks in anticipation.