I have another question, if I want to count the number of records in the group but the records have been defined with more than one key (by) variables (e.g. by id x instead of by id only), is there a way to adjust the following example code for a group of key variables to obtain that number (the count)?
Example (only one key variable, id):
input id x;
IF first.ID THEN count=0;
count = count + 1;
IF last.ID THEN OUTPUT;
KEEP ID count;
The final idea is to obtain the number of many-to-many cases within a merge. I want to identify how many cases (ids) are not unique (e.g. id=1 and x=7 in the previous example) in each data file (i.e. “MERGE statement has more than one data set with repeats of BY values.) to compute the total % of many-to-many cases in the merged file.