Linus is correct, I also think there's no direct way to mimic the NODUPKEYS feature of PROC SORT in SQL.
One way could be:
proc sql noprint;
create table NODUPKEYS (drop = _N) as
select T1.* from
(select monotonic() as _N, * from A) as T1,
(select monotonic() as _N, count(CUST) from A group by CUST) as T2
where T1._N = T2._N ;
quit;
The monotonic() function here, is used similarly as the automatic variable _N_ (try to run the two selects for T1 and T2 separately to see the results of monotonic()).
But it always involves remerging the data with some stat table (in the example T2).
So I guess it will be always much more "messy", complex and inefficient than the SORT NODUPKEYS options.
Greetings from Portugal.
Daniel Santos at
www.cgd.pt
Message was edited by: Daniel Santos