I have a vector of numerous variables (>100) that I need to reshape. Basically the format of the variables are the following.


Country GDP Population v1_2000 v1_2001 v1_2002 .. v1_2020 v2_2000 v2_2001 v2_2002 ... v2_2020 .... v50_2000 v50_2001 ... v50_2020


For the simplicity I generated data as suggested.
Code:
clear
    input str72 country str24 units float(v1_2000 v1_2001 v1_2002 v1_2003) double(v2_2000 v2_2001  v2_2002 v2_2003)
    "Austria" "Percent change" 2.048 -3.613 1.329 1.708 1.806 1.999 2.086 2.197
    "Austria" "Percent of potential GDP" -1.804 -2.958 -4.279 -4.092 . . . .
    "Belgium" "Percent change" .832 -3.006 1.153 1.336 1.605 1.707 1.83 1.876
    "Belgium" "Percent of potential GDP" -2.112 -4.786 -4.257 -3.425 . . . .
    "Czech Republic" "Percent change" 2.464 -4.287 1.675 2.629 3.5 3.5 3.5 3.5
    "Czech Republic" "Percent of potential GDP" . . . . . . . .
    "Denmark" "Percent change" -.87 -5.071 1.2 1.557 2.567 2.634 2.297 2.344
    "Denmark" "Percent of potential GDP" 3.692 .038 -1.726 -1.494 . . . .
end
Then of course, here I have only two variables (v1_, v2_), so I can simply do
Code:
reshape long v1_ v2_ , i(country units) j(year)
But in my actual data, I have v1_, v2_, ...... v_100.
I tried to define

Code:
local varlist v1_ v2_ ... v_100
and etc, but so far nothing works.

How can we reshape such large list of variables v1_, ..... v100_ ?