Thank you for your reply, Rick. I think I did not describe my question correctly. I have now posted it here: https://communities.sas.com/t5/SAS-Programming/Randomly-assign-a-date-which-also-satisfies-a-condition-from/m-p/577832#M163778