Reputation: 1
I have a data set like this
YEAR GENDER RACE AGE COUNT
2015 Female W 30 3
So in 2015, there were 3 White 30 year females. I'd like to transpose this into line list data, like this:
YEAR GENDER RACE AGE
2015 Female W 30
2015 Female W 30
2015 Female W 30
Any help would be greatly appreciated! Thank you!
Upvotes: 0
Views: 35
Reputation: 783
I added a row for purpose of illustration:
data have;
input YEAR GENDER $ RACE $ AGE COUNT;
datalines;
2015 Female W 30 3
2014 Male B 45 4
;
The following code will hopefully accomplish what you are asking for:
data want (drop=i count);
set have;
do i = 1 to count;
output;
end;
run;
Upvotes: 1