I have a data set with an ID column, and a primary reviewer column. I've randomly assigned a second reviewer for every observation. Now what I need is a way to print out 50% of the observations from every primary reviewer. So for example if Anna is the primary reviewer for 10 ID's- I want to choose 5 of those IDs at random and print those rows. (If she has 11, then I'd want to round to the nearest whole number, so 6 in this case) The basic framework is something like proc print data=mydata; where nobs=%randbetween(1, _n_(primary_reviewer)*.5); quit; Obviously there's some issues with the syntax and it doesn't run, so that's what I need some help with. The randbetween macro is something I've built already(looks like the below) %macro RandBetween(min, max); (&min + floor((1+&max-&min)*rand("uniform"))) %mend;
... View more