once the new file (new.dataset ?) is created, create an output summary of "groups", perhaps like[pre]
proc summary data = new.dataset missing nway ;
class group_number ;
output out= data.groups_&sysdate( keep= group_number _freq_ ) ;
run;[/pre]
Then you have frequency counts in each group to compare with the previous run, like: [pre]
data changes ;
merge data.latest( keep= group_number _freq_ rename=(_freq_=old_ct ))
data.groups_&sysdate( in= new rename=( _freq_= ct_&sysdate) ) ;
by group_number ;
run; [/pre]
This provides old and new frequencies to support a comparison report, like:[pre]
proc print data= changes ;
title "file load group changes report" ;
title3 " only new Groups and ceasing Groups are shown ";
where not ( ct_&sysdate and old_ct ) ; * = not present in both files;
run;[/pre]
Of course, you have to prepare for the next comparison by placing the latest summary as the "latest" dataset, like: [pre]
data data.latest ;
set data.groups_&sysdate ;
label _freq_ = "counts &sysdate" ;
run;[/pre]
Clearly you have created a second copy of the data, but it makes the process straightforward to run regularly - special situations like re-runs, or comparisons over longer periods, or presentation of growth trends over time are supported too, but without automation ...............
Good Luck
PeterC