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 Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1133 views
  • 0 likes
  • 3 in conversation