Hi Nicolas,
Great blog!
Just want to clarify that the 3rd option: DATA Step BY … the last variable of the table should be used for the first./last. option to have the same result as the select distinct.
Ex:
VarX VarY
1 2
1 1
2 3
2 4
1 2
data public.test_dedup_ds(copies=0) ;
set public.test ;
by _all_ ;
if last.varY;
run ;
Results:
(a) DATA Step BY … if first./last.
VarX VarY
1 1
1 2
2 3
2 4
(b) Select distinct *
VarX VarY
1 2
1 1
2 3
2 4
For Viya 3.5, the PROC SORT NODUPKEY is now supported with source and target being CAS tables.
https://go.documentation.sas.com/?activeCdc=pgmsascdc&cdcId=sasstudiocdc&cdcVersion=5.2&docsetId=proc&docsetTarget=n0zvfxnprrsapfn1puzcbskaqbcp.htm&locale=en
... View more