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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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