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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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