Why you should get 13307 obs? Did you make sure that all {cusip, pfoyr} pairs in h82 have at most one match in h111? Are you sure that there is no {cusip, pfoyr} pair in h111 not listed in h82? Unless you make sure from that, your code does not grantee to have 13307 obs. But if all what you are doing is to look up the value of h82 in h111, and this what i think you are trying to do. Then your code should be like: Data j1; merge h82(in=fromh82x) h1111 (in=fromh1111x); by cusip pfoyr; if fromh82x; run;
... View more