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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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