How do I give priority to the sex of the enumeration area when randomly selecting a household member into a survey?

If it is a female enumeration area, I want the female eligibles to be given priority in the random selection. But if there are no female eligibles I want to include male eligibles in the random selection of participants in the survey

I think you'll need to provide your survey as an example for someone to help. What have you tried so far? For example - are you selecting from a preexisting list, or from names gathered during the survey?

Please share more details about your data colection process to help us understand your requirement better. What do you mean by randomization and where it needs to be done? In general, you can use random() function to generate random numbers in your survey (read more here).

@danbjoseph & @joybindroo, Happy Friday! Were you able to check my code? Do you I need to be clearer with stating the issue?