I have a set of data with 1,000 records. There are various columns such as Transaction Date, Customer ID, Age, Town, Zip Code, Country, etc. Of the 1,000 customers that I get every month, about 8% to 10% pay with credit cards.
If I pull a subset of my dataset using a certain age range AND certain zip codes AND a few other things together, I get fewer records e.g. 80 records, with 40 of them being those who buy on credit. With this subset, the percentage credit card customers becomes 50% of the subset.
When I use the same specifications (age range, those same zip codes, etc.) the next month, the subset becomes about 100 with 35 credit card customers. The percentage in this case is 35%
My interest is to pull a subset that has 50% credit card customers, and I don't mind much about what criteria is used. I don't care about how many customers are produced in the subset. I just want that 50% composition. My question is, what SAS/SQL language/clause/function/etc can I use in a code to produce a SUBSET that has 50% credit card customers?