BookmarkSubscribeRSS Feed
pooja0108
Calcite | Level 5
I am working on data with 10000 unique accounts. I have to assign these accounts as per percentage. Like 40% of count of accounts gets value 'ABC' ,30% of count of accounts get 'DEF' and remaining 30% gets 'XYZ'
for instance : 40% of 10000= 4000 accounts get value ABC
30% of 10000=3000 accounts get DEF
30% of 10000=3000 accounts get XYZ

Please write a code for this query.
3 REPLIES 3
PaigeMiller
Diamond | Level 26

Assign at random, or otherwise? Explain further.

--
Paige Miller
pooja0108
Calcite | Level 5
Randomly assign values ABC, DEF , XYZ as per given ratio on total count of cases

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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