BookmarkSubscribeRSS Feed
stateworker
Fluorite | Level 6
Hi. I have a dataset with about 3,000 records. I need to assign a unique ID to these records but I don't want it to just be 1, 2, 3 or A, B, C. I need it to be something that won't be able to be de-coded. Is there a way to create a list of random numbers or alpha-numerics that I could then add as a variable to my dataset? My dataset has names, dates-of-birth, race and sex.

Thanks so much.
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Review the SAS DOC and Data Step Language Elements, focusing on the SAS functions for some ideas to use with generating random numer values and look to convert the value to a character string.

Scott Barry
SBBWorks, Inc.
stateworker
Fluorite | Level 6
Thanks.
GertNissen
Barite | Level 11
data uniqid;
input x y $;
uniqid=md5(cats(x,y));
datalines;
1 A
2 B
3 C
4 D
5 E
;run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1195 views
  • 0 likes
  • 3 in conversation