Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Remove duplicates without changing the order of the names

$
0
0

consider the following data

Data ss;infile datalines;input ename $;datalines;RamSitaRamArjunSitaRamArjun;run;#outputRamSitaArjun

I know other approaches like by sorting the data by ename and then using the first., but this way we need to sort data and the output will be starting with Arjun, Ram and Sita. However, we need to retain the order like i mention in the expected output.

proc sort data=ss;by ename;run;data want;set ss;by ename;if first.ename;run;

Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>