Dear all,

I tried to reshape the following nested data into long-year wide-series:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str6 firm str7 series double(y1990 y1991 y1992)
"ID:JSK" "WC02999" . . .
"ID:JSK" "WC03351" . . .
"ID:JSK" "WC03255" . . .
"ID:JSK" "WC08221" . . .
"ID:JSK" "WC03995" . . .
"ID:JSK" "WC02003" . . .
"ID:JSK" "WC08001" . . .
"ID:JSK" "WC01250" . . .
"ID:JSK" "WC04601" . . .
"ID:JSK" "WC02501" . . .
"ID:JSK" "WC01201" . . .
"ID:JSK" "WC01151" . . .
"ID:JSK" "WC05301" . . .
"ID:JSK" "WC05070" . . .
"ID:MRS" "WC02999" . . .
"ID:MRS" "WC03351" . . .
"ID:MRS" "WC03255" . . .
"ID:MRS" "WC08221" . . .
"ID:MRS" "WC03995" . . .
"ID:MRS" "WC02003" . . .
"ID:MRS" "WC08001" . . .
"ID:MRS" "WC01250" . . .
"ID:MRS" "WC04601" . . .
"ID:MRS" "WC02501" . . .
"ID:MRS" "WC01201" . . .
"ID:MRS" "WC01151" . . .
"ID:MRS" "WC05301" . . .
"ID:MRS" "WC05070" . . .
"ID:ISA" "WC02999" . . .
"ID:ISA" "WC03351" . . .
"ID:ISA" "WC03255" . . .
"ID:ISA" "WC08221" . . .
"ID:ISA" "WC03995" . . .
"ID:ISA" "WC02003" . . .
"ID:ISA" "WC08001" . . .
"ID:ISA" "WC01250" . . .
"ID:ISA" "WC04601" . . .
"ID:ISA" "WC02501" . . .
"ID:ISA" "WC01201" . . .
"ID:ISA" "WC01151" . . .
"ID:ISA" "WC05301" . . .
"ID:ISA" "WC05070" . . .
end


By using the following command:
Code:
reshape long y, i(firm series) j(year)
rename y y_
reshape wide y_, i(firm year) j(series) string
rename y_* *

However, after the first command line, it says: "variable id does not uniquely identify the observations". Could you please help? Thank you.