Hi, Can anyone please look through this code and tell me why the groups 3 and 4 are not working as I want then to??? thanks data order11_final; set order11_a; if Group =1 then do; if Stream in ('A01' 'A02' 'A03') then do; SEL_Nope='2122'; Outfile=1; end; else if Stream in ('B01' 'B02' 'B03') then do; SEL_Nope='2123'; Outfile=1; end; else if Stream in ('E01') then do; SEL_Nope='2124'; Outfile=1; end; else if Stream in ('F02') then do; SEL_Nope='2125'; Outfile=1; end; else if Stream in ('G01') then do; SEL_Nope='2126'; Outfile=1; end; end; ;/*correct*/ if Group =2 then do; else if Stream in ('A01' 'A02' 'A03') then do; SEL_Nope='2127'; Outfile=2; end; else if Stream in ('B01' 'B02' 'B03') then do; SEL_Nope='2128'; Outfile=2; end; else if Stream in ('E01') then do; SEL_Nope='2129'; Outfile=2; end; else if Stream in ('F02') then do; SEL_Nope='2130'; Outfile=2; end; else if Stream in ('G01') then do; SEL_Nope='2131'; Outfile=2; end; end; ;/* correct*/ if Group =3 then do; if _N_ <=17500 then do; SEL_Nope='2137'; Outfile=3; end; else if _N_ <=35000 then do; SEL_Nope='2145'; Outfile=5; end; else if _N_ <=52500 then do; SEL_Nope='2146'; Outfile=6; end; else if Stream in ('A01' 'A02' 'A03')and buyer = 0 and Age <65 then do; SEL_Nope='2132'; Outfile=3; end; else if Stream in ('B01' 'B02' 'B03')and buyer = 0 and Age <65 then do; SEL_Nope='2133'; Outfile=3; end; else if Stream in ('E01') and buyer = 0 and Age <65 then do; SEL_Nope='2134'; Outfile=3; end; else if Stream in ('F01') then do; SEL_Nope='2135'; Outfile=3; end; else if Stream in ('N01') then do; SEL_Nope='2136'; Outfile=3; end; end ; if Group =4 then do; if _N_ <=17500 then do; SEL_Nope='2144'; Outfile=4; end; else if Stream in ('A01' 'A02' 'A03') and buyer = 0 and Age >=65 then do; SEL_Nope='2139'; Outfile=4; end; else if Stream in ('B01' 'B02' 'B03') and buyer = 0 and Age >=65 then do; SEL_Nope='2140'; Outfile=4; end; else if Stream in ('E01') then do; SEL_Nope='2141'; Outfile=4; end; else if Stream in ('F01') and Age >=65 then do; SEL_Nope='2142'; Outfile=4; end; else if Stream in ('N01') and Age >=65 then do; SEL_Nope='2143'; Outfile=4; end; end ; run;
... View more