dear, I hope you are very well, how can I create a unique id and that is a combination of the entire row of a database?
How many variables and of what types are they? Are any of the variables dates or times and do you need to see the date in that variable? Do any of the numeric variables have decimal portions and if so, how much to want to see?
How many variables have missing values? How should the missing values appear in the result?
You can try something like:
data want; set have; length uniqueid $ 500; /*<= this number needs to be large enough to represent the maximum number of characters that might result*/ uniqueid = cats(of _all_); run;
Though I won't be surprised if you don't like the result.
Hi Andres,
This macro can be used to take a hash of all the values. It will work with high precision decimals, special missings, and very wide character variables.
It's the same algorithm we use to diff uploads in Data Controller for SAS. The ID will have a length of $32.
https://core.sasjs.io/mp__md5_8sas.html
Best,
Allan
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: