1) Sas variable names like 22 23 .. are sas invalid names. You probably imported those tables from excel.
I believe that by importing the variables will be var1 var2 .. or alike. You may need to rename those variables.
In order to display my solution I shall use names A22 A23 .. which are sas valid names.
2) possible solution:
Step 1 transpose table from wide to long:
proc transpose data=T2 out=temp;
by ID AGE;
name = 'DEV';
var A22 - A24; /* first age up to last age */
run;
proc sort data=temp; by ID AGE; run;
thus will result into table like:
ID AGE DEV
1 22 10
1 22 20
1 22 30
2 23 50
2 23 60
2 23 70
...
Next step will be to merge table T1 with the temp table by ID and AGE:
data want;
merge T1 temp;
by ID AGE;
run;
It is not tested. In case of issues post the log.