[pre]
data all;
input month$ pay bonus;
cards;
jan 20000 1000
jan 10000 1100
jan 5000 2000
feb 4000 3000
feb 5000 4000
mar 4800 600
mar 5000 800
;;;;
run;
data _null_;
set all;
by month notsorted;
if _n_ eq 1 then do;
declare hash d(ordered:'a');
d.definekey('_n_');
d.definedata('month','pay','bonus');
d.definedone();
end;
if first.month then d.clear();
d.add();
if last.month then d.output(dataset:month);
run;
[/pre]
If you need to generate a SAS file with unique/distinct values for a variable, consider using PROC SORT with NODUPKEY and a specific BY statement variable list.
[pre]
data temp;
input month $ pay bonus;
cards;
jan 20000 1000
jan 10000 1100
jan 5000 2000
feb 4000 3000
feb 5000 4000
mar 4800 600
mar 5000 800
;
run;