Thank you for your help. I am sorry that I cannot make it clearer at the first place. Let look at one simplest example. I want to see how many record in original file that satisfy conditions listed in Filter_id=1 OR Filter_id=2. of those record, how many with targert=0, how many with target =1. So I create a 2 steps method that can help me do it. First, create the combination of filter. Second, loop the combination through the original file to count. For the first step, this code below helps me to create combination of 2 filter. For the second step, even though the idea is quite clear: take record(i) in original file and check if it satisfy Filter1 OR filter2 listed in combination file. If yes, count target=0 OR=1. It is on top of my head as to how to get it done! One minor question is that: in step 1, I can only make 2 lelve of combination. How can I create say 4 level (say filter 1,2,4,5) Please let me know if it is clear. Many thanks. HHC data comb; drop i id2; set filter nobs=nobs; i+1; do j=i+1 to nobs; set filter (rename=(filter_id=id2 cond1=c1 value1=v1 cond2=c2 value2=v2 cond3=c3 value3=v3)) point=j; filter1st=filter_id; filter2nd=id2; output; end; run;
... View more