Help Needed :( - Problem Basic Reshape - Stata

#1
Hi everybody,

I have the following data:
date A AAP AAPL ABC ACN ACT ACXM
8/15/2006 9.3 0.4 3.9 0.3 1 1 0.9
8/16/2006 2.9 6.8 2.3 0.5 2.6 2.4 0.9
8/17/2006 0.8 -0.4 -0.6 -0.3 0.5 0.5 0
8/18/2006 -1.5 -1.5 0.5 0.2 0.6 0.8 0
8/21/2006 -1.5 -1.3 -2 0 -1.8 -1.2 -1

That I would like to "reshape long" in panel data as follow:
date ticker ret
8/15/2006 A 9.3
8/16/2006 A 2.9
8/17/2006 A 0.8
8/15/2006 AAP 0.4
8/16/2006 AAP 6.8
8/17/2006 AAP -0.4
8/15/2006 AAPL 3.9
8/16/2006 AAPL 2.3
8/17/2006 AAPL -0.6
8/15/2006 ABC 0.3
8/16/2006 ABC 0.5
8/17/2006 ABC -0.3

Please help me with that :)
 
#2
Try renaming your variables before the -reshape-:

Code:
clear all
set more off

*----- example data -----

input ///
date A AAP AAPL ABC ACN ACT ACXM
1 9.3 0.4 3.9 0.3 1 1 0.9
2 2.9 6.8 2.3 0.5 2.6 2.4 0.9
3 0.8 -0.4 -0.6 -0.3 0.5 0.5 0
4 -1.5 -1.5 0.5 0.2 0.6 0.8 0
5 -1.5 -1.3 -2 0 -1.8 -1.2 -1
end

format date %td

list

*----- what you want -----

local variables A AAP AAPL ABC ACN ACT ACXM

foreach var of local variables {
    rename `var' ret`var'
}

gen i = _n

reshape long ret, i(i) j(tick) string

sort i tick
list, sepby(i)