Hi:
I don't see a correlation between table A and what you want in table B. Did you mean, perhaps that the data in A was:
[pre]
data A; /*var: age , note*/
ageA 2
ageA 5
ageB 2
ageB 4
[/pre]
OR
data A; /*var: age , note*/
age1 2 A
age2 5 A
age3 2 B
age4 4 B
[/pre]
It's hard to visualize the input data. And if you are talking about SUMBY, you're talking about PROC PRINT. If you're talking about using ageA and ageB as groups, then you're talking about PROC REPORT. So, I'm confused because you said you wanted to use the DATA step to get B -- is B a table or is B a report? Depending on what your INPUT data looks like (table A), the answer will depend on 1) the INPUT data and 2) what you want to get as output -- a table or a report.
And, if this is a DATA step program question and not an ODS/Reporting question, your best bet for help is to contact Tech Support.
cynthia