PG, Sorry for the delayed reply. Ive actually been pouring over this code / dataset trying to figure out how to get things correct. So in reference to the first piece code that you helped me with. I used the following: data adtc.ss7 (drop = i); set adtc.ss6; count1 = 1; dm1 = sic1; array items{35} sic36-sic70; do i = 1 to 35; if count1 then if items{i} = sic1 then call missing(count1, dm1); end; run; data adtc.ss7 (drop = i); set adtc.ss7; count2 = 1; dm2 = sic2; array items{35} sic36-sic70; do i = 1 to 35; if count2 then if items{i} = sic2 then call missing(count2, dm2); end; run; And I repeated the code for each SIC I need to compare for sic codes 1-35 (sic1-sic35). However, when Im done and add things up across count1-35, Im not getting an accurate count. The reason is because the array (e.g., sic36-sic70) may have missing cells (sometimes only some missing, sometimes all) and in that case, any value (sic1-sic35) that is compared is treated as though it is not in the array and is counted. Second, the values Im comparing (sic1-sic35) may have duplicates. For example, sic1 may be 5149, sic2 may be 5149, sic3 may be 5149, etc. So, I need to modify the code so that it takes into account missing values in the array (sic37-sic70) when comparing and I need to have it only count the unique sic's that didn't match. It seems like I need more complicated code and would need to do this in one step as opposed to the two steps Im currently doing it in. Or maybe, there's a better two step approach. However, Im not sure how to expand upon my code.
... View more