Hi guys,
suppose to have the following dataset:
data DB;
input ID :$20. Admission :date09. Discharge :date09. Code1 Code2 Code3;
format Admission date9. Discharge date9.;
cards;
0001 13JAN2017 25JAN2017 345 6 8
0001 22FEB2018 03MAR2018 5 21 64
0001 30JAN2019 04MAR2019 V45 6 43
0002 01DEC2016 14DEC2016 56 0 998
0002 01DEC2016 14DEC2016 54 V321 65
0002 25DEC2017 02JAN2018 543 987 098
0002 06JAN2018 09JAN2018 21 468 765
;run;
and a list of codes in combination as follows:
1) 345, 8
2) 543, 098
Is there a way to count how many times the combinations occur in DB (looking at variables Code1, Code2, Code3), and subset the records (rows) where they appear and save into two different datasets according to the combinations? In other words two sub-datasets will be generated: one for combination 1) and the other for combination 2).
Thank you in advance