Hi guys, I have two data sets and, for each ID, I have to split each row of the first including the intervals of the second. Furthermore, while doing this, I need to divide the values in the Count variable of the first data set by the days in the new interval but only when the period refers to the first data set and not to the second because in this last case I will have a Label. Can anyone help me please? Here the data set and desired output: data work; input ID :$20. Start :date9. End :date9. Counts :$20.; format start end yymmdd10.; cards; 0001 01JAN2015 18JAN2015 32499 0001 19JAN2015 30APR2015 23458 0001 01MAY2015 13JAN2016 987 0002 06FEB2019 15FEB2019 3567 0002 16FEB2019 31DEC2019 1254 0003 01JAN2020 18MAR2020 652 0003 19MAR2020 02APR2020 765 0003 03APR2020 31DEC2020 200 data vacations; input ID :$20. Start :date9. End :date9. Label :$20.; format start end yymmdd10.; cards; 0001 03JAN2015 10JAN2015 A 0001 21JAN2015 21JAN2015 B 0001 03MAY2015 09JAN2016 C 0002 08FEB2019 08FEB2019 B 0002 09FEB2019 15FEB2019 A 0003 20FEB2020 25FEB2020 C 0003 21MAR2020 21MAR2020 B 0003 04JAN2020 10JAN2020 A ; data want; input ID :$20. Start :date9. End :date9. Label :$20. Counts_resized :$20.; format start end yymmdd10.; cards; 0001 01JAN2015 02JAN2015 ? 0001 03JAN2015 10JAN2015 A 0001 11JAN2015 18JAN2015 ? 0001 19JAN2015 20JAN2015 ? 0001 21JAN2015 21JAN2015 B 0001 22JAN2015 30APR2015 ? 0001 01MAY2015 02MAY2015 ? 0001 03MAY2015 09JAN2016 C 0001 10MAY2016 13JAN2016 ? …………. ; Thank you in advance
... View more