BookmarkSubscribeRSS Feed
Salsalvr
Calcite | Level 5

 I'm looking for a way to create a unique Identifier that will account for duplicates of a client based on an old client ID.  Please see below.

I tried a do loop but it just hung up on me.  Does anyone know code for this. Thanks.

 

Old _ClientID    NewID

564                         1

564                         1

345                         2

367                         3

321                         4

111                         5

111                         5

111                         5

1 REPLY 1
novinosrin
Tourmaline | Level 20

data want;

set have;

by old_clientid;

if first.old_clientid then NewID+!;

run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 795 views
  • 1 like
  • 2 in conversation