BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rav31
Calcite | Level 5

I have a large dataset where each rate is the same for all ages between age_first and age_last. Below is an example of one row of the dataset:

 

age_first   age_last   rate

   15             20         4.16

 

My goal is to convert this row into many, with one row for each age, like so:

 

age   rate

15     4.16

16     4.16

17     4.16

18     4.16

19     4.16

20     4.16

1 ACCEPTED SOLUTION
2 REPLIES 2
Reeza
Super User

Use those values as the do loop start and stop.

 

data want;
set have;

do age=age_first to age_list;
       output; *writes a record for each age;
end;

run;

@rav31 wrote:

I have a large dataset where each rate is the same for all ages between age_first and age_last. Below is an example of one row of the dataset:

 

age_first   age_last   rate

   15             20         4.16

 

My goal is to convert this row into many, with one row for each age, like so:

 

age   rate

15     4.16

16     4.16

17     4.16

18     4.16

19     4.16

20     4.16